shithub: nime

ref: 60929ada1a066c49396d48bf45cf347a50f8e363
dir: /doc/macros/

View raw version
.\" Macroset by Ethan Long, a compilation of small macros from various sources
.\" Requires the s macroset (-ms).

.\" To source this in a document, use the following command
.\" .so /usr/USERNAME/refs/macros

.\" FOR NEATREFER ONLY:
.\" Macro for superscript, allows for references to be superscript in text.
.\" neatrefer will look at the argument and replace it with a citation number
.\" corresponding to the reference list.
.de RE
\*([.\\$1\*(.]
..

.\" Macro for inserting PostScript images, unfortunately non-postscript is not
.\" supported, so things need to be converted first. (Takes up a fair bit of
.\" space.
.de FG \" Usage: .FG <basename>
.ie h .html - <img src="\\$1.\\$2" />
.el .BP \\$1.ps
.br
..

.\" Macro for bullet points in a bullet point list
.de BU
.IP "•" 3
..

\" Macro for numbered point in a list
.de NU
.IP "\\$1." 3
..

\" Macro for numbering figures, will optionally take in an input describing the
\" figure.
\" Syntax:
\"   .FI "string describing figure"
.nr fi 1
.de FI
.ps 8
.if '\\$1'' \{
.ce
Figure \\n(fi
.nr fi +1 \}
.if !'\\$1'' \{
.ce
Figure \\n(fi: \\$1
.nr fi +1 \}
.ps
..

\" Macro for custom heading with cumulative numbering
.nr se 0
.de HC
.nr se +1
.SH
.ps +4
.ft NB
\\n(se. 
.nr su 1
..

\" Macro for heading monospace fonts
.de CT
.nr PQ \\n(.f
.if t .if \\n(.$>0 \%\&\\$3\f(CB\\$1
.ft
..

\" Macro for custom subheading with cumulative numbering
.de SC
.SH
.ps +2
.ft BI
\\n(se.\\n(su. 
.nr su +1
..

\" Macro for subheading monospace fonts,
\" partly stolen from ms source ;)
.de CI
.nr PQ \\n(.f
.if t .if \\n(.$>0 \%\&\\$3\f(CX\\$1
.ft
..

\" Fix the boarders on default ms documents:
.po +1.7