1 .\" NetHack 3.6 tmac.nh $NHDT-Date: $ $NHDT-Branch: $:$NHDT-Revision: $
3 .\" Miscellaneous tmac.n-style macros specifically for nethack's Guidebook.
5 .\" Most are modelled after, or variations of, macros in tmac.n whose author
6 .\" has specified that that file remain unmodified if it gets distributed.
7 .\" These used to be inline within Guidebook.mn but it was becoming too
8 .\" cluttered as their number increased. It now uses the '.so' directive
9 .\" to include this file. (tmac.n is passed to 'roff on the command line.)
11 .\" labeled paragraph start
13 .\" set the width for the label column
15 .\" label for the entry
19 .nr PY \\w'\\$1\ -\ 'u \" width of label plus " - "
20 .nr PX \\w'\ -\ 'u \" width of " - "
21 .sn \\n(pdu \" tmac.n: inter-paragraph space
22 .in +\\n(PYu \" additional indent past label (etc)
23 .si \" tmac.n: start indented section
25 .\" labeled paragraph label (and first line)
28 \\h'|-\\n(PYu'\\$1\\h'|-\\n(PXu'\ -\ \\c \" back up, output the label, then
29 . \" skip to width-of(" - ") before the
30 . \" normal indentation, output the " - "
31 . \" then attach the next line (the
32 . \" text) without stopping (\c: nroff
35 .\" labeled paragraph end
37 .ei \" tmac.n: end indented section
38 .in -\\n(PYu \" undo indent past label (etc)
39 .sn \\n(pdu \" tmac.n: inter-paragraph space
41 .\" end of labeled paragraph
44 .\" aligned single character key with SHORT definition (if it overflows one
45 .\" line, all bets are off)
47 .\" .CC k "definition here"
48 .nr CZ \w'\fBW' \" width of the key character column
49 .nr CW \n(CZ/2 \" half the width of the key character column
51 .nr CX \\w'\\fB\\$1'u/2 \" half the width of the key character
52 .nr CY \\n(CWu-\\n(CXu \" difference between the two half widths
53 .\" output: move right CR units, print the key letter, move right to
54 .\" the full width of the column, print " - " and the definition
55 \\h'|\\n(CYu'\\fB\\$1\\fP\\h'|\\n(CZu'\ -\ \\$2
58 .\" .SD = .sd with extra choices for argument; pair with .ED
59 .\" c - centered (original choice; as of this writing, not used by nethack)
60 .\" i - indented (default if choice is omitted)
62 .\" SF - set (1=>indent, 0=>no-indent) by .SD, used by .ED unless centering
63 .de SD \" start display
64 . \" look for nested displays -- ILLEGAL
65 .ie \\n(id>0 .er "display within display"
67 . nr sf 0 \" don't center by default
68 . nr SF 1 \" assume indent
69 . ie '\\$1'c' .nr sf 1 \" center the sucker
70 . el .if '\\$1'n' .nr SF 0 \" don't indent if 'n'
72 .sn \\n(pdu \" a little bit of space
73 .ev 2 \" switch to display environment
74 .nf \" what you type is what you get
75 .if \\n(id=0 .di dd \" start saving text
76 .rs \" don't eat leading space
77 .nr id +1 \" increment level of display
79 .\" .ED = .ed with support for \n(SF (indent vs no-indent); pair with .SD
82 .ie \\n(id<=0 .er "end display has no corresponding begin display"
84 . nr id -1 \" decrement level of display
87 . fi \" resume filling
88 . in -\\n(piu \" dedent
89 . ev \" pop environment
90 . ne \\n(dnu \" be sure you have room
91 . nf \" don't reprocess display
92 . rs \" don't eat leading space
94 . ie \\n(sf .in (\\n(llu-\\n(dlu)/2u \" center
95 . el .if \\n(SF .in +\\n(piu \" indent
97 . yi \" restore indents
100 .fi \" resume filling
101 .sn \\n(pdu \" a little bit of space
104 .\" '.UX' is verbatim copy of tmac.n's '.ux' with the exception that
105 .\" the trademark owner for "UNIX" has been updated.
106 .de UX \" print "UNIX"
107 .ie \\n(ux \\&\\$2\\s-1UNIX\\s0\\$1
109 . nr ux +1 \" mark footnote as dropped
110 \\&\\$2\\s-1UNIX\\s0\\*(rg\\$1
111 . fn \" put out the footnote
112 \\&\\*(rgUNIX is a registered trademark of The Open Group.
113 . ef \" short and sweet ...
117 .\" .BR - hard line break with vertical padding inserted
118 .\" $1 - repeat count for amount of padding (optional; default is 1)
120 .ie \\.$==0 .nr bR 1v
127 .\" Just a pass-through here; converted to a link when generating HTML.