aboutsummaryrefslogtreecommitdiff
path: root/example.t
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-18 10:40:06 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-18 10:40:06 +0200
commit9365fec1a278974b4cabc9192f0797fc5d1d1682 (patch)
treecb13dd0b83fac1ecb40c4972ea5c9755ee1c8c16 /example.t
parent782815777b64d40b71a1d8109fd1779ec71a23ef (diff)
downloadmk-9365fec1a278974b4cabc9192f0797fc5d1d1682.tar.gz
g.tmac: Add c (code) macro, rework margins
Diffstat (limited to 'example.t')
-rw-r--r--example.t51
1 files changed, 42 insertions, 9 deletions
diff --git a/example.t b/example.t
index 3ca19bb..1ea01b1 100644
--- a/example.t
+++ b/example.t
@@ -1,26 +1,26 @@
.so g.tmac
-.s
+.p
+.ta 3n +3n +3n +3n
.t
.x Mg ,
a simple macro package for troff
.n
John Ankarstr\[u00F6]m
.d
+.h
+Introduction
.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
+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
+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.
+3. It is designed to be practically easy to use.
Macros are consistently one letter long and written in lowercase.
.p
While
@@ -33,7 +33,7 @@ Users of
.i mg
are encouraged to modify the source code
according to their own needs.
-.h
+.s
Internal design
.p
.i Mg
@@ -52,4 +52,37 @@ simply sets the font size inside the environment named
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.
+environment and set the font size as desired:
+.c
+.eo
+.cc ,
+.\" set heading font
+.h
+.fam H
+.ps +1p
+,cc
+.ec
+.p
+The environments are initialized
+as soon as the first
+.q block-level
+macro is called.
+At the initialization of each environment,
+the default environment (0) is copied,
+meaning that all environment-relevant settings
+defined before the first macro call
+are applied to all
+.i mg
+environments.
+It is thus remarkably simple and intuitive to set,
+for example, the default font of a document:
+.c
+.cc ,
+.fam N
+.t
+Document title
+.p
+First paragraph.
+,cc
+.p
+\&...