diff options
-rw-r--r-- | example.t | 9 | ||||
-rw-r--r-- | g.tmac | 45 |
2 files changed, 43 insertions, 11 deletions
@@ -42,10 +42,12 @@ Internal design makes heavy use of named environments, supported by implementations such as GNU troff and Neatroff. Environments obliviate the need for many special registers -that a macro package would need to keep track of. +that a macro package (and its user) would need to keep track of. For example, .i ms -keeps track of the document's font size in the PS register. +keeps track of the document's font size in the +.i PS +register. .i Mg , on the other hand, simply sets the font size inside the environment named @@ -98,3 +100,6 @@ the amount of vertical space to add before environment. 2. \c .c ti , the indentation of the first line in the environment. +.p +These can be set inside a given environment +to control its behavior when invoked. @@ -1,3 +1,9 @@ +.\"----------------------------"/. +.\" MG MACRO PACKAGE FOR TROFF "/. +.\" created by JOHN ANKARSTRÖM "/. +.\" released under MIT LICENSE "/. +.\"----------------------------"/. +. .eo \" disable backslash escapes . .\" Internal macros @@ -50,11 +56,18 @@ . l \" literal display . evc 0 . nr sp 0.3v -. nr in 0.5c . nf . in 0.5c . fam C . ps -1p +. vs -1p +. q \" quotation +. evc 0 +. nr sp 0.3v +. nr ti 1c +. in 0.5c +. ps -1p +. vs -1p . _e .. . @@ -94,7 +107,6 @@ . \" save special environment variables . if !'\n[.ev]'0' \{\ . nr \n[.ev]_sp \n(sp -. nr \n[.ev]_in \n(in . nr \n[.ev]_ti \n(ti . ev . \} @@ -107,10 +119,8 @@ . if !'\$1'' \{\ . ev \$1 . nr sp \n[\n[.ev]_sp] -. nr in \n[\n[.ev]_in] . nr ti \n[\n[.ev]_ti] . sp \n(spu -. in \n(inu . \} . . \" perform post-environment operations @@ -138,17 +148,22 @@ .\" Inline macros .\" ------------- . -.\" i -- italic +.\" b -- bold font +.de b +\$3\fB\$1\fP\$2 +.. +. +.\" i -- italic font .de i \$3\fI\$1\fP\$2 .. . -.\" x -- bold italic +.\" x -- bold italic font .de x \$3\f(BI\$1\fP\$2 .. . -.\" c -- constant-width +.\" c -- constant-width font .de c \$3\c . fam \*[cfam] @@ -159,9 +174,21 @@ \$2 .. . -.\" q -- quote +. +.\" Hybrid macros +.\" ------------- +. +.\" q -- quotation .de q -\$3\(lq\$1\(rq\$2 +. +. \" inline quotation +. ie !'\$1'' \$3\(lq\$1\(rq\$2 +. +. \" block quotation +. el \{\ +. _e q +. ti \n(tiu +. \} .. . . |