From 782815777b64d40b71a1d8109fd1779ec71a23ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 18 Jun 2021 08:45:15 +0200 Subject: g.tmac: Re-organize code, implement h (heading) macro --- example.t | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 example.t (limited to 'example.t') diff --git a/example.t b/example.t new file mode 100644 index 0000000..3ca19bb --- /dev/null +++ b/example.t @@ -0,0 +1,55 @@ +.so g.tmac +.s +.t +.x Mg , +a simple macro package for troff +.n +John Ankarstr\[u00F6]m +.d +.p +.i Mg +is a simple macro package for troff with the following features: +.p +1. +It is designed to be easy to understand and to customize +by editing the source code. +.p +2. +It makes use of the extended support for environments +offered by many modern troff implementations +(but it can be made compatible with the original troff if need be). +.p +3. +It is designed to be practically easy to use. +Macros are consistently one letter long and written in lowercase. +.p +While +.i mg +does provide macros for many common tasks, +including footnotes, +it is at the end of the day an idiosyncratic macro package, +written to serve the author's personal needs. +Users of +.i mg +are encouraged to modify the source code +according to their own needs. +.h +Internal design +.p +.i Mg +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. +For example, +.i ms +keeps track of the document's font size in the PS register. +.i Mg , +on the other hand, +simply sets the font size inside the environment named +.i p +(for paragraph). +If the user wishes to modify the default font size, +he or she can simply switch to the +.i p +environment and set the font size as desired. -- cgit v1.2.3