From 7ce1da8edd9450f662d76aa7aea223db003c0557 Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Thu, 1 Jul 2021 22:10:09 +0200 Subject: Rename mu to mk The u*.tmac namespace is already a bit busy. --- HACKING.pdf | Bin 24518 -> 24407 bytes HACKING.t | 28 ++-- Makefile | 10 +- README | 8 +- README.pdf | Bin 63686 -> 63464 bytes README.t | 72 +++++------ k.tmac | 417 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ kx.tmac | 59 +++++++++ toc/README.t | 4 +- u.tmac | 417 ----------------------------------------------------------- ux.tmac | 59 --------- 11 files changed, 537 insertions(+), 537 deletions(-) create mode 100644 k.tmac create mode 100644 kx.tmac delete mode 100644 u.tmac delete mode 100644 ux.tmac diff --git a/HACKING.pdf b/HACKING.pdf index a7da708..33ca978 100644 Binary files a/HACKING.pdf and b/HACKING.pdf differ diff --git a/HACKING.t b/HACKING.t index 10d2a31..9084dd3 100644 --- a/HACKING.t +++ b/HACKING.t @@ -1,4 +1,4 @@ -.so u.tmac +.so k.tmac . .de @h . sp |36p @@ -12,7 +12,7 @@ . .t Hacking on the -.x µ +.x mk macro package .d John Ankarström @@ -20,9 +20,9 @@ John Ankarström . .h What is -.x µ ? +.x mk ? .p -.i µ +.i Mk or .i mu is a simple macro package for troff @@ -33,23 +33,23 @@ writing advanced documents. . .h How is the source code of -.x µ +.x mk organized? .p If you run .c "grep -n [-]-" on the -.i u.tmac +.i k.tmac source file, you are presented with an overview of -.i µ 's +.i mk 's macros: .l .eo -!grep -n [-]- u.tmac +!grep -n [-]- k.tmac .ec .p This is a sufficient summary of the entire -.i µ +.i mk source code, as nothing is performed outside of these macros. All initialization is performed in the .c @a @@ -57,12 +57,12 @@ macro, which is automatically called at the first invocation of any other macro. .p The above summary reflects a categorization in the macros defined by -.i µ . +.i mk . There are internal and external macros. The former are to be used within -.i u.tmac +.i k.tmac itself, while the latter are to be used in -.i µ +.i mk documents. Among the external macros, there are inline, environment (or block-level) and other macros. @@ -90,7 +90,7 @@ Where is document state stored? .p Most state is stored by troff itself within the different environments. In addition, -.i µ +.i mk associates three extra registers with each environment: .c sp , the amount of space to be added by @@ -158,5 +158,5 @@ contains the total number of collected footnotes. .p Note that none of these registers and strings should be directly accessed or modified by -.i µ +.i mk documents. diff --git a/Makefile b/Makefile index 8d132db..0c59a31 100644 --- a/Makefile +++ b/Makefile @@ -8,14 +8,16 @@ PDFROFF ?= troff | dpost | ps2pdf - all: README.pdf HACKING.pdf install: - install -m 644 u.tmac t/toc.tmac $(TMACDIR) + install -m 644 k.tmac t/toc.tmac $(TMACDIR) install -m 644 toc/toc.1 list/list.1 $(MANDIR)/man1 install toc/toc list/list $(BINDIR) -HACKING.pdf: HACKING.t u.tmac +HACKING.pdf: HACKING.t k.tmac perl -pe '$$_=`$$_` if s/^\!//' HACKING.t |\ + LC_ALL=en_US.UTF-8\ $(PDFROFF) > HACKING.pdf -README.pdf: README.t u.tmac - TROFFONTS=/usr/pkg/share/fonts/X11/TTF/ \ +README.pdf: README.t k.tmac + TROFFONTS=/usr/pkg/share/fonts/X11/TTF/\ + LC_ALL=en_US.UTF-8\ README.pdf diff --git a/README b/README index 392d2c8..c124f46 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ This repository can be divided into three parts: - * mu (top directory) + * mk (top directory) * toc * list @@ -11,11 +11,11 @@ TMACDIR, BINDIR and MANDIR before installing. --- Summary --- -* Mu is a simple and modern troff macro package. It is divided +* Mk is a simple and modern troff macro package. It is divided into two files: - u.tmac -- base macros - ux.tmac -- extra macros (optional) + k.tmac -- base macros + kx.tmac -- extra macros (optional) * Toc provides a simple method of creating forward references, such as tables of contents, in troff documents. It consists of a diff --git a/README.pdf b/README.pdf index 4b99ea5..e01f88c 100644 Binary files a/README.pdf and b/README.pdf differ diff --git a/README.t b/README.t index 3c6c2be..c264db6 100644 --- a/README.t +++ b/README.t @@ -1,5 +1,5 @@ -.so u.tmac -.so ux.tmac +.so k.tmac +.so kx.tmac .so toc/toc.tmac .mediasize letter .fp 0 M DejaVuSansMono ttf @@ -60,7 +60,7 @@ . .\" start document .t -.x µ , +.x Mk , a simple macro package for troff .d John Ankarström @@ -78,9 +78,7 @@ John Ankarström . .he Introduction .p -.i µ -or -.i mu +.i Mk is a simple macro package for troff with the following features: .n 1 It is designed to be easy to understand and to customize @@ -93,13 +91,13 @@ It is designed to be practically easy to use. Macros consist of a single lowercase letter. .p While -.i µ +.i mk 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 µ +.i mk are encouraged to .n 1 a ) modify the source code @@ -109,19 +107,19 @@ use built-in troff requests for some things that other packages might provide custom macros for. .p All in all, -.i µ +.i mk aspires to abstract as little as possible from the underlying troff requests and registers. In its author's humble opinion, it is the ideal macro package for learning troff. .p In this document, the fundamental concepts of -.i µ +.i mk are explained. The document itself also serves as a demonstration of -.i µ . +.i mk . With a couple of exceptions, it uses -.i µ 's +.i mk 's default settings. The reader is encouraged to inspect the document's source code in order to see how the macro package is used in practice. @@ -133,7 +131,7 @@ See p. \n[&toc] for more information. .he Environments .te .nr &env \n% .p -.i µ +.i Mk makes heavy use of named environments, supported by implementations such as GNU troff, Heirloom troff and Neatroff. Environments obliviate the need for many special registers @@ -145,7 +143,7 @@ keeps track of the document's font size in the register. For the font size of headings, it has yet another register. -.i µ +.i mk has no such registers. If the user wishes to modify the default font size, he or she can simply switch to the relevant environment @@ -171,7 +169,7 @@ the default environment (0) is copied, meaning that all environment-relevant settings defined before the first macro call are applied to all -.i µ +.i mk environments. It is thus remarkably simple and intuitive to set, for example, the default font of a document: @@ -184,7 +182,7 @@ First paragraph. .l) .p In addition to the normal environment-relevant settings, -.i µ +.i mk manually associates a few special registers with the current environment: .n 1 .c sp , @@ -209,17 +207,17 @@ and do not support these registers. . .he External macros .p -.i µ +.i Mk defines a number of macros. Some of them are used internally by -.i µ +.i mk itself; these carry an at .c @ ) ( prefix and are going to be explored later. For now, we will focus on the external macros provided by -.i µ . +.i mk . . .se Inline macros .p @@ -248,9 +246,9 @@ italic font bold italic font .p For example, the following request outputs -.i µ .\(rq: \(lq +.i mk .\(rq: \(lq .l( -.i µ . +.i mk . .l) . .p @@ -377,7 +375,7 @@ and .c ) are called at such a position that the collected footnotes cannot fit on the current page, -.i µ +.i mk will print the footnotes on the next page instead. .p The @@ -394,7 +392,7 @@ which takes an exact amount of space as its argument, takes a declarative specification describing the amount of desired space in terms of -.i µ +.i mk environments. For example: .l( @@ -407,9 +405,9 @@ For example: . .he Internal macros .p -.i µ 's +.i Mk internal macros are generally not meant to be used outside of -.i u.tmac . +.i k.tmac . Documented in this section are the exceptions to this rule. For examples of how these macros are used in practice, see the FAQ section on page \n[&faq]. @@ -425,7 +423,7 @@ and macros control the page header and footer. .p At document initialization, -.i µ +.i mk automatically creates traps for .c @th and @@ -440,7 +438,7 @@ and .c @t , which control the text and spacing of the header and footer. .p -.i µ +.i Mk will avoid creating a trap for .c @tf if any trap has already been set before document initialization. @@ -478,7 +476,7 @@ are equivalent to troff's and .c evc , but perform some extra work to keep track of -.i µ 's +.i mk 's special environment variables (see .i Environments , @@ -504,11 +502,11 @@ in the full GNU troff manual are configured with the standard troff requests. If you set the point size at the beginning of the document, before any -.i µ +.i mk macros have been called, it will be correctly set for the entire document. This works because -.i µ 's +.i mk 's environments initially copy all their settings from 0, the default environment. .p @@ -518,7 +516,7 @@ at 9 points and a vertical spacing of 12 points, you would start the document like this (before you call any -.i µ +.i mk macros): .l( .fam N @@ -606,7 +604,7 @@ Environments are a feature built into troff, accessed via the .c ev request, but because -.i µ +.i mk extends environments with additional functionality, it provides special macros to be used instead of .c ev : @@ -626,7 +624,7 @@ The .c @e macro can be used to activate any environment that supports -.i µ 's +.i mk 's extensions (see .i Environments , p. \n[&env]). @@ -651,7 +649,7 @@ and defines a corresponding macro: Some macro packages have a concept of ." keeps , sections that are kept together across page breaks. -.i µ +.i Mk does not (at least yet) define any such macros by default. The simplest solution is to use troff's .c ne @@ -663,7 +661,7 @@ request: .p If you want to keep text of various styles together, you can use -.i µ 's +.i mk 's own .c w macro: @@ -736,7 +734,7 @@ to translate backticks and apostrophes accordingly: .te .nr &toc \n% .p Included with the -.i µ +.i mk distribution is a package called .i toc , which includes the following files: @@ -838,7 +836,7 @@ See page \n[&refname]. .se How do I include source code without needing to escape it? .p The -.i µ +.i mk distribution includes a troff preprocessor called .i list , which filters text delimited by diff --git a/k.tmac b/k.tmac new file mode 100644 index 0000000..2091474 --- /dev/null +++ b/k.tmac @@ -0,0 +1,417 @@ +.\" "/. +.\" mu macro package for troff "/. +.\" created by John Ankarström "/. +.\" "/. +.\" Permission to use, copy, modify and/or "/. +.\" distribute this software for any purpose "/. +.\" with or without fee is hereby granted. "/. +.\" "/. +.\" For an index of the macros defined in "/. +.\" this file, issue `grep -n [-]- u.tmac'. "/. +.\" "/. +.\" When editing the source of mu, keep the "/. +.\" following rules in mind: "/. +.\" "/. +.\" * Prefix temporary strings and registers "/. +.\" with _. "/. +.\" * Prefix internal registers and environ- "/. +.\" ments with @. "/. +.\" * Prefix internal macros with @ (normal "/. +.\" macros), * (variants of the same "/. +.\" macro) or % (strings). "/. +.\" * Place macros in alphabetical order. "/. +.\" * Do not use .ev and .evc directly; use "/. +.\" (e, @e and @c instead. "/. +.\" "/. +. +.do xflag 3 \" enable modern extensions +.eo \" disable backslash escapes +. +.\" Internal macros ---------------------------- +. +.\" @a -- setup document +.de @a +. nr @a 1 +. +. \" set header/footer traps +. wh 0 @th +. em @tf +. if \n(nl<=0 .@th +. nr _ \n(.p-\n(nl +. if \n(.t=\n_ .wh -1i @tf +. +. \" configure environments +. @e d \" date +. @c 0 +. nr sp 0.4v +. ad c +. @e h \" heading +. @c 0 +. nr sp 1.2v +. ps +1p +. ft B +. @e l \" literal display +. @c 0 +. nr sp 0.3v +. nf +. in 18p +. ft CR +. ps -1p +. vs -1p +. @e n \" name (of author) +. @c 0 +. nr sp 0.4v +. ad c +. @e p \" paragraph +. @c 0 +. nr sp 0.3v +. nr ti 18p +. ad b +. @e q \" quotation +. @c 0 +. nr sp 0.3v +. nr ti 18p +. in 18p +. ps -1p +. vs -1p +. @e s \" section heading +. @c 0 +. nr sp 1v +. ft B +. @e t \" title +. @c 0 +. ps +4p +. vs +2p +. ft B +. ad c +. @e +. +. \" configure special environments +. (e @f \" footnote +. @c 0 +. ps -2p +. vs -1p +. (e @m \" margins (header, footer) +. @c 0 +. (e +. +. \" create formatted dates +. af mo 00 +. af dy 00 +. ds #i \n[year]-\n(mo-\n(dy +. af mo 1 +. af dy 1 +. ds #e \n(dy +. ie \n(mo=1 .ds #e \*(%e January +. el .ie \n(mo=2 .ds #e \*(#e February +. el .ie \n(mo=3 .ds #e \*(#e March +. el .ie \n(mo=4 .ds #e \*(#e April +. el .ie \n(mo=5 .ds #e \*(#e May +. el .ie \n(mo=6 .ds #e \*(#e June +. el .ie \n(mo=7 .ds #e \*(#e July +. el .ie \n(mo=8 .ds #e \*(#e August +. el .ie \n(mo=9 .ds #e \*(#e September +. el .ie \n(mo=10 .ds #e \*(#e October +. el .ie \n(mo=11 .ds #e \*(#e November +. el .ds #e \*(#e December +. ds #e \*(#e \n[year] +.. +. +.\" @c -- copy environment +.de @c +. evc \$1 +. nr sp \n[@\$1_sp] +. nr sq \n[@\$1_sq] +. nr ti \n[@\$1_ti] +.. +. +.\" (e -- set environment +.de (e +. ev \$1 +.. +. +.\" @e -- set extended environment +.de @e +. +. \" initialize document if not initialized +. if '\n(@a'0' .@a +. +. \" save special environment variables +. if !'\n[.ev]'0' \{\ +. nr @\n[.ev]_sp \n(sp \" vertical space before any environment +. nr @\n[.ev]_sq \n(sq \" vertical space before different environment +. nr @\n[.ev]_ti \n(ti \" first line indentation +. ev +. \} +. +. \" keep track of previous and new environment +. ds %penv \*[%env] +. ds %env \$1 +. +. \" post-environment operations +. if !'\$1'' \{\ +. \" add small space after title +. if '\*[%penv]'t' .if '\*[%env]'d' .sp 0.1v +. +. \" add space after title block +. nr _ 0 +. if !'\*[%env]'d' .nr _ 1 +. if !'\*[%penv]'t' .if !'\*[%penv]'d' .nr _ 0 +. if \n_ \{\ +. sp 0.5i +. ns +. \} +. +. \" activate new environment +. ev \$1 +. nr sp \n[@\n[.ev]_sp] +. nr sq \n[@\n[.ev]_sq] +. nr ti \n[@\n[.ev]_ti] +. sp \n(spu +. if !'\*[%env]'\*[%penv]' .sp \n(squ +. \} +.. +. +.\" @f -- footer +.de @f +. sp |\n(.pu-48p +. tl ''%'' +.. +. +.\" @h -- header +.de @h +. sp |36p +. tl '''' +. sp |1i +.. +. +.\" @tf -- footer trap +.de @tf +. +. \" skip automatic trigger if manual mode active, unless forced +. if \n(@m>0 .if !'\$1'f' \{\ +. nr @m -1 +. return +. \} +. +. \" print footer +. br +. (e @m +. @f +' bp +.. +. +.\" @th -- header trap +.de @th +. (e @m +. rt 0 +. @h +. (e \*[%env] +. ns +.. +. +.\" @tn -- footnote trap +.de @tn +. +. nr @m 1 +. \" print collected footnotes +. (e @m +___________________ +. br +. sp 1p +. (e @f +. +. \" escape control characters +. char . \&. +. char ' \&' +. +. @n +. br +. +. \" restore control characters +. char . . +. char ' ' +. +. \" clear footnotes +. ch @tn +. nr @.t 0 +. nr @dn 0 +. rm @n +. @tf f +.. +. +. +.\" Inline macros ------------------------------ +. +.\" " -- inline quotation +.de " +\&\$3\(lq\$1\(rq\$2 +.. +. +.\" b -- bold font +.de b +\&\$3\fB\$1\fP\$2 +.. +. +.\" c -- constant-width font +.de c +. +. \" save original interword spacing +. nr _ss \n[.ss] +. +. \" copy family and (relative) point size from l environment +. (e 0 +. nr _s0 \n(.s +. (e +. (e l +. ds _fl \n(.f +. nr _sl \n(.s +. (e +. +\&\$3\c +. ft \*[_fl] +. ss 7 +. ie d nrf .nrf _s (\n(.s*(\n[_sl]/(\n[_s0]))) +. el .nr _s \n(.s+(\n[_sl]-\n[_s0]) +. ps \n(_sp +\&\$1\c +. ft +. ss \n[_ss] +. ps +\&\$2 +.. +. +.\" i -- italic font +.de i +\&\$3\fI\$1\fP\$2 +.. +. +.\" x -- bold italic font +.de x +\&\$3\f(BI\$1\fP\$2 +.. +. +. +.\" Environment macros ------------------------- +. +. +.\" d -- centered date +.de d +. br +. @e d +. if !'\$1'' \*[#\$1] +.. +. +.\" h -- heading +.de h +. br +. w h p +. @e h +. +.. +.\" l -- literal display +.de l +. br +. w ll +. @e l +.. +. +.\" p -- paragraph +.de p +. br +. @e p +. if '\*[%penv]'p' .ti \n(tiu +.. +. +.\" q -- quotation +.de q +. br +. @e q +. ti \n(tiu +.. +. +.\" s -- subheading +.de s +. br +. w s p +. @e s +.. +. +.\" t -- centered title +.de t +. br +. @e t +.. +. +. +.\" Other macros ------------------------------- +. +.\" ( -- begin footnote +.de ( +. if !'\$1'' \&\$1\c +. +. \" increment and print number +. nr @n \n(@n+1 +\v'-.3m'\s'\En(.s*80/100'\n(@n\s0\v'.3m'\c +. +. \" switch environment and capture footnote +. (e @f +. boxa @n +\h'9p'\v'-.3m'\s'\En(.s*80/100'\n(@n\s0\v'.3m'\h'2p'\c +.. +. +.\" ) -- end footnote +.de ) +. br +\!.br +. boxa +. (e \*[%env] +. ie !'\$1'' \&\$1 +. el \& +. +. \" get position of footer (or next trap) +. if \n[@.t]=0 .nr @.t \n(nl+\n(.t +. +. +. \" print footnote at bottom of page +. ch @tn +. nr @dn +\n(dnu +. nr _tn \n[@.t]u-\n[@dn]u-12p +. wh \n[_tn]u @tn +.. +. +.\" w -- want space +.de w +. *w 0 \$@ +.. +.de *w +. +. \" parse specification -> _s : accumulated space +. nr _s \$1 \" _e : environment name (e.g. eee -> e) +. ds _e \$2 \" _n : number of lines specified (e.g. eee -> 3) +. substring _e 0 0 +. length _n \$2 +. +. \" add environment spacing +. nr _s +\n[@\*(_e_sp] +. nr _s +\n[@\*(_e_sq] +. +. \" add environment line height (for each line) +. (e \*(_e +. nr _v \n(.v +. (e +. nr _s +(\n(_n*\n(_v) +. shift 2 +. +. \" recurse or request space if done +. ie \n(.$>0 .*w \n(_s \$@ +. el \{\ +. nr _s \n(_s-\n(_v+1u \" do not request too much +. if (\n(_su)>\n(.tu \{\ +. br +. bp +. \} +. \} +.. +. +.ec \" re-enable backslash escapes diff --git a/kx.tmac b/kx.tmac new file mode 100644 index 0000000..2b75f6d --- /dev/null +++ b/kx.tmac @@ -0,0 +1,59 @@ +.\" "/. +.\" extra stuff for mu "/. +.\" "/. +.\" Permission to use, copy, modify and/or "/. +.\" distribute this software for any purpose "/. +.\" with or without fee is hereby granted. "/. +.\" "/. +. +.eo +. +.\" he -- toc-enabled heading +.de he +. h +\$* +. te .the \$*\t\n% +.. +. +.\" se -- toc-enabled subheading +.de se +. s +\$* +. te .the \\h'18p'\$*\t\n% +.. +. +.\" the -- toc entry +.de the +. ta \n(.luR +. tc . +\$* +. tc +. br +.. +. +.\" n -- numbered list item +.de n +. if !'\$1'' \{\ +. nr ni \$1-1 +. af ni 0 +. if !'\$2'' .af ni \$2 +. ds n. . +. if !'\$3'' .ds n. \$3 +. \} +. nr ni +1 +. br +. @e n +. ti \n(tiu +\n(ni\*(n. \c +.. +. +.am @a +. @e n +. @c p +. nr sq \n(sp +. nr sp 0 +. ta 3n +3n +3n +3n +. @e +.. +. +.ec diff --git a/toc/README.t b/toc/README.t index f4d9687..919b300 100644 --- a/toc/README.t +++ b/toc/README.t @@ -1,5 +1,5 @@ -.so ../u.tmac -.so ../ux.tmac +.so ../k.tmac +.so ../kx.tmac .so toc.tmac . .t diff --git a/u.tmac b/u.tmac deleted file mode 100644 index 2091474..0000000 --- a/u.tmac +++ /dev/null @@ -1,417 +0,0 @@ -.\" "/. -.\" mu macro package for troff "/. -.\" created by John Ankarström "/. -.\" "/. -.\" Permission to use, copy, modify and/or "/. -.\" distribute this software for any purpose "/. -.\" with or without fee is hereby granted. "/. -.\" "/. -.\" For an index of the macros defined in "/. -.\" this file, issue `grep -n [-]- u.tmac'. "/. -.\" "/. -.\" When editing the source of mu, keep the "/. -.\" following rules in mind: "/. -.\" "/. -.\" * Prefix temporary strings and registers "/. -.\" with _. "/. -.\" * Prefix internal registers and environ- "/. -.\" ments with @. "/. -.\" * Prefix internal macros with @ (normal "/. -.\" macros), * (variants of the same "/. -.\" macro) or % (strings). "/. -.\" * Place macros in alphabetical order. "/. -.\" * Do not use .ev and .evc directly; use "/. -.\" (e, @e and @c instead. "/. -.\" "/. -. -.do xflag 3 \" enable modern extensions -.eo \" disable backslash escapes -. -.\" Internal macros ---------------------------- -. -.\" @a -- setup document -.de @a -. nr @a 1 -. -. \" set header/footer traps -. wh 0 @th -. em @tf -. if \n(nl<=0 .@th -. nr _ \n(.p-\n(nl -. if \n(.t=\n_ .wh -1i @tf -. -. \" configure environments -. @e d \" date -. @c 0 -. nr sp 0.4v -. ad c -. @e h \" heading -. @c 0 -. nr sp 1.2v -. ps +1p -. ft B -. @e l \" literal display -. @c 0 -. nr sp 0.3v -. nf -. in 18p -. ft CR -. ps -1p -. vs -1p -. @e n \" name (of author) -. @c 0 -. nr sp 0.4v -. ad c -. @e p \" paragraph -. @c 0 -. nr sp 0.3v -. nr ti 18p -. ad b -. @e q \" quotation -. @c 0 -. nr sp 0.3v -. nr ti 18p -. in 18p -. ps -1p -. vs -1p -. @e s \" section heading -. @c 0 -. nr sp 1v -. ft B -. @e t \" title -. @c 0 -. ps +4p -. vs +2p -. ft B -. ad c -. @e -. -. \" configure special environments -. (e @f \" footnote -. @c 0 -. ps -2p -. vs -1p -. (e @m \" margins (header, footer) -. @c 0 -. (e -. -. \" create formatted dates -. af mo 00 -. af dy 00 -. ds #i \n[year]-\n(mo-\n(dy -. af mo 1 -. af dy 1 -. ds #e \n(dy -. ie \n(mo=1 .ds #e \*(%e January -. el .ie \n(mo=2 .ds #e \*(#e February -. el .ie \n(mo=3 .ds #e \*(#e March -. el .ie \n(mo=4 .ds #e \*(#e April -. el .ie \n(mo=5 .ds #e \*(#e May -. el .ie \n(mo=6 .ds #e \*(#e June -. el .ie \n(mo=7 .ds #e \*(#e July -. el .ie \n(mo=8 .ds #e \*(#e August -. el .ie \n(mo=9 .ds #e \*(#e September -. el .ie \n(mo=10 .ds #e \*(#e October -. el .ie \n(mo=11 .ds #e \*(#e November -. el .ds #e \*(#e December -. ds #e \*(#e \n[year] -.. -. -.\" @c -- copy environment -.de @c -. evc \$1 -. nr sp \n[@\$1_sp] -. nr sq \n[@\$1_sq] -. nr ti \n[@\$1_ti] -.. -. -.\" (e -- set environment -.de (e -. ev \$1 -.. -. -.\" @e -- set extended environment -.de @e -. -. \" initialize document if not initialized -. if '\n(@a'0' .@a -. -. \" save special environment variables -. if !'\n[.ev]'0' \{\ -. nr @\n[.ev]_sp \n(sp \" vertical space before any environment -. nr @\n[.ev]_sq \n(sq \" vertical space before different environment -. nr @\n[.ev]_ti \n(ti \" first line indentation -. ev -. \} -. -. \" keep track of previous and new environment -. ds %penv \*[%env] -. ds %env \$1 -. -. \" post-environment operations -. if !'\$1'' \{\ -. \" add small space after title -. if '\*[%penv]'t' .if '\*[%env]'d' .sp 0.1v -. -. \" add space after title block -. nr _ 0 -. if !'\*[%env]'d' .nr _ 1 -. if !'\*[%penv]'t' .if !'\*[%penv]'d' .nr _ 0 -. if \n_ \{\ -. sp 0.5i -. ns -. \} -. -. \" activate new environment -. ev \$1 -. nr sp \n[@\n[.ev]_sp] -. nr sq \n[@\n[.ev]_sq] -. nr ti \n[@\n[.ev]_ti] -. sp \n(spu -. if !'\*[%env]'\*[%penv]' .sp \n(squ -. \} -.. -. -.\" @f -- footer -.de @f -. sp |\n(.pu-48p -. tl ''%'' -.. -. -.\" @h -- header -.de @h -. sp |36p -. tl '''' -. sp |1i -.. -. -.\" @tf -- footer trap -.de @tf -. -. \" skip automatic trigger if manual mode active, unless forced -. if \n(@m>0 .if !'\$1'f' \{\ -. nr @m -1 -. return -. \} -. -. \" print footer -. br -. (e @m -. @f -' bp -.. -. -.\" @th -- header trap -.de @th -. (e @m -. rt 0 -. @h -. (e \*[%env] -. ns -.. -. -.\" @tn -- footnote trap -.de @tn -. -. nr @m 1 -. \" print collected footnotes -. (e @m -___________________ -. br -. sp 1p -. (e @f -. -. \" escape control characters -. char . \&. -. char ' \&' -. -. @n -. br -. -. \" restore control characters -. char . . -. char ' ' -. -. \" clear footnotes -. ch @tn -. nr @.t 0 -. nr @dn 0 -. rm @n -. @tf f -.. -. -. -.\" Inline macros ------------------------------ -. -.\" " -- inline quotation -.de " -\&\$3\(lq\$1\(rq\$2 -.. -. -.\" b -- bold font -.de b -\&\$3\fB\$1\fP\$2 -.. -. -.\" c -- constant-width font -.de c -. -. \" save original interword spacing -. nr _ss \n[.ss] -. -. \" copy family and (relative) point size from l environment -. (e 0 -. nr _s0 \n(.s -. (e -. (e l -. ds _fl \n(.f -. nr _sl \n(.s -. (e -. -\&\$3\c -. ft \*[_fl] -. ss 7 -. ie d nrf .nrf _s (\n(.s*(\n[_sl]/(\n[_s0]))) -. el .nr _s \n(.s+(\n[_sl]-\n[_s0]) -. ps \n(_sp -\&\$1\c -. ft -. ss \n[_ss] -. ps -\&\$2 -.. -. -.\" i -- italic font -.de i -\&\$3\fI\$1\fP\$2 -.. -. -.\" x -- bold italic font -.de x -\&\$3\f(BI\$1\fP\$2 -.. -. -. -.\" Environment macros ------------------------- -. -. -.\" d -- centered date -.de d -. br -. @e d -. if !'\$1'' \*[#\$1] -.. -. -.\" h -- heading -.de h -. br -. w h p -. @e h -. -.. -.\" l -- literal display -.de l -. br -. w ll -. @e l -.. -. -.\" p -- paragraph -.de p -. br -. @e p -. if '\*[%penv]'p' .ti \n(tiu -.. -. -.\" q -- quotation -.de q -. br -. @e q -. ti \n(tiu -.. -. -.\" s -- subheading -.de s -. br -. w s p -. @e s -.. -. -.\" t -- centered title -.de t -. br -. @e t -.. -. -. -.\" Other macros ------------------------------- -. -.\" ( -- begin footnote -.de ( -. if !'\$1'' \&\$1\c -. -. \" increment and print number -. nr @n \n(@n+1 -\v'-.3m'\s'\En(.s*80/100'\n(@n\s0\v'.3m'\c -. -. \" switch environment and capture footnote -. (e @f -. boxa @n -\h'9p'\v'-.3m'\s'\En(.s*80/100'\n(@n\s0\v'.3m'\h'2p'\c -.. -. -.\" ) -- end footnote -.de ) -. br -\!.br -. boxa -. (e \*[%env] -. ie !'\$1'' \&\$1 -. el \& -. -. \" get position of footer (or next trap) -. if \n[@.t]=0 .nr @.t \n(nl+\n(.t -. -. -. \" print footnote at bottom of page -. ch @tn -. nr @dn +\n(dnu -. nr _tn \n[@.t]u-\n[@dn]u-12p -. wh \n[_tn]u @tn -.. -. -.\" w -- want space -.de w -. *w 0 \$@ -.. -.de *w -. -. \" parse specification -> _s : accumulated space -. nr _s \$1 \" _e : environment name (e.g. eee -> e) -. ds _e \$2 \" _n : number of lines specified (e.g. eee -> 3) -. substring _e 0 0 -. length _n \$2 -. -. \" add environment spacing -. nr _s +\n[@\*(_e_sp] -. nr _s +\n[@\*(_e_sq] -. -. \" add environment line height (for each line) -. (e \*(_e -. nr _v \n(.v -. (e -. nr _s +(\n(_n*\n(_v) -. shift 2 -. -. \" recurse or request space if done -. ie \n(.$>0 .*w \n(_s \$@ -. el \{\ -. nr _s \n(_s-\n(_v+1u \" do not request too much -. if (\n(_su)>\n(.tu \{\ -. br -. bp -. \} -. \} -.. -. -.ec \" re-enable backslash escapes diff --git a/ux.tmac b/ux.tmac deleted file mode 100644 index 2b75f6d..0000000 --- a/ux.tmac +++ /dev/null @@ -1,59 +0,0 @@ -.\" "/. -.\" extra stuff for mu "/. -.\" "/. -.\" Permission to use, copy, modify and/or "/. -.\" distribute this software for any purpose "/. -.\" with or without fee is hereby granted. "/. -.\" "/. -. -.eo -. -.\" he -- toc-enabled heading -.de he -. h -\$* -. te .the \$*\t\n% -.. -. -.\" se -- toc-enabled subheading -.de se -. s -\$* -. te .the \\h'18p'\$*\t\n% -.. -. -.\" the -- toc entry -.de the -. ta \n(.luR -. tc . -\$* -. tc -. br -.. -. -.\" n -- numbered list item -.de n -. if !'\$1'' \{\ -. nr ni \$1-1 -. af ni 0 -. if !'\$2'' .af ni \$2 -. ds n. . -. if !'\$3'' .ds n. \$3 -. \} -. nr ni +1 -. br -. @e n -. ti \n(tiu -\n(ni\*(n. \c -.. -. -.am @a -. @e n -. @c p -. nr sq \n(sp -. nr sp 0 -. ta 3n +3n +3n +3n -. @e -.. -. -.ec -- cgit v1.2.3