diff options
Diffstat (limited to 'demo/demo.tr')
-rw-r--r-- | demo/demo.tr | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/demo/demo.tr b/demo/demo.tr new file mode 100644 index 0000000..2a3621a --- /dev/null +++ b/demo/demo.tr @@ -0,0 +1,166 @@ +.\" Neatroff Tutorial #1 +.\" +.\" The demo subdirectory of neatroff_make contains a few examples of +.\" using Neatroff; they help particularly those users who have good +.\" experience in using Troff. What follows demonstrates the basics of +.\" using Neatroff, assuming that the reader has never used Troff before. +.\" Nevertheless, this section would probably help any new user of +.\" Neatroff. +.\" +.\" =================== +.\" SETTING UP NEATROFF +.\" =================== +.\" +.\" You can set up Neatroff as follows. +.\" +.\" $ git clone https://github.com/aligrudi/neatroff_make.git +.\" $ cd neatroff_make +.\" $ make init # Downloads the required programs and some fonts +.\" $ make neat # Compiles the programs +.\" +.\" For rendering this file, you can perform the following steps. +.\" +.\" + Create a directory to store your Neatroff documents. +.\" + Copy the Makefile in neatroff_make/demo to this directory. +.\" + Edit the value of BASE in the Makefile to point to neatroff_make. +.\" + Edit the line beginning with "all:"; remove the names of files +.\" that appear after it in this line. +.\" + Create a file name demo.tr with the contents of this file. +.\" + Add demo.pdf after "all:" in the Makefile. +.\" +.\" ============ +.\" TROFF BASICS +.\" ============ +.\" +.\" As you have already guessed, lines starting with .\" are comments. +Hello Neatroff. +.\" Blank lines cause a line break and some vertical spacing (unless +.\" using blm request). + +Basic requests: +.\" The br request causes a line break as well. +.br +.\" Requests can start with a dot or quote in a separate line, or +.\" combined with the text after a backslash. +Words \s[16]can\s0 be \s+[5]Larger\s0 or \s-[5]Smaller\s0. +.\" You can also insert vertical space using sp request. +.sp 3 +.\" You can also use ps request to change font size, and vs to change +.\" the vertical space between lines. +.ps 14 +.vs 14 +.\" Defaults fonts: R (Roman), B (bold), I (italic); P is the previous +.\" font. +Fonts can be \fBchanged\fP. +.\" You can also use ft request. +.ft I +This is \m[cyan]cyan\m[]; \m[#382]colour\m[] does help +.\" The colour can be also changed using cl request +.cl #244 +sometimes. +.\" Without argument, requests like cl, ft, and ps change font face, +.\" colour, and size respectively to its previous value. +.cl +.ft +.sp +.\" =============== +.\" DEFINING MACROS +.\" =============== +.\" +.\" A multi-line macro can be defined as follows; the definition ends +.\" at a line containing "..". +.de mac1 +. ft B +. cl #824 +\\$1 +. ft P +. cl +.. +.\" This is a single-line macro. +.ds mac2 "\m[\\$2]\\$1\m[] (\\$2) +.\" They can be invoked as follows (\\$N is replaced by argument N). +.mac1 Macros +in \*[mac2 colour red]. +.sp +.\" Numbers and strings can be saved in registers. +.nr count 20 +.ds name "Page +There are \n[count] of \*[name]s. +.sp +.\" =============== +.\" TEXT ADJUSTMENT +.\" =============== +.ce +Centred line +.sp +.\" Without paragraph formatting, line breaks are respected. +.nf +With no paragraph +formatting. +.sp +.\" With paragraph formatting, words are collected and lines +.\" are filled. +.fi +Enable paragraph +formatting. +.sp +.\" Paragraph adjustment type (lp, rp, and bp enable whole paragraph +.\" formatting algorithm): +.\" + l, lp: Left +.\" + r, rp: Right +.\" + b, bp: Adjust both margins +.ad r +Right adjusted text. +.sp +.ad b +.\" You can specify identation with in, temporary indentation +.\" with ti, and line length with ll. +.in 1c +.ll 15c +.ti 2c +Text indentation is applied to the all lines (its current value is \n[.i]), +whereas temporary indentation is applied only on the next line. +.in 0 +.sp +.\" ============= +.\" OTHER REQUSTS +.\" ============= +.\" Scale indicators: +.\" + i: Inch +.\" + c: Centimeters +.\" + m: Em (current size points) +.\" + n: En (Em / 2) +.\" + p: Points (1/72 inch) +.\" + u: Basic unit +.\" + v: Vertical space +.\" + none: Default (depends on the request) +.ad l +.nf +Horizontal \h'1c'movement and vertical \v'1m'movement. +Width of \(lqabc\(rq is \w'abc' in basic units. +.sp +.\" Drawing commands: +Lines: horizontal \l'1m' and vertical \L'-1m' +Lines: \D'l 1m -1n' +Circles: \D'c 1n' +Polygons: \D'p 1n 0 0 -1n -1n 1n' +Filled polygons: \D'P 1n 0 0 -1n -1n 1n' +.sp +.\" Fonts can be mounted using fp; the second argument is font +.\" short name and the third argument is font name (the name of +.\" the font descriptor file). +.fp - AB CB +.fp - MYFONT URWGothic-Book +Fonts: \f[AB]number 1\fP and \f[MYFONT]number 2\fP. +.\" You can also replace standard fonts +.fp - R CB +This is the new Roman font. +.\" ========== +.\" NEXT STEPS +.\" ========== +.\" +.\" + Read "Troff User's Manual," "Neatroff Introduction," and +.\" "UNIX Text Processing". +.\" + Use macro packages. +.\" + Read available macro packages like those in neatroff_make/tmac. +.\" + Write your own macro package. |