1 .\" NetHack 3.7 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 .\" Protect against being sourced twice.
15 .\" labeled paragraph start
17 .\" set the width for the label column
19 .\" label for the entry
23 .nr PY \\w'\\$1\ -\ 'u \" width of label plus " - "
24 .nr PX \\w'\ -\ 'u \" width of " - "
25 .sn \\n(pdu \" tmac.n: inter-paragraph space
26 .in +\\n(PYu \" additional indent past label (etc)
27 .si \" tmac.n: start indented section
29 .\" labeled paragraph label (and first line)
32 \\h'|-\\n(PYu'\\$1\\h'|-\\n(PXu'\ -\ \\c \" back up, output the label, then
33 . \" skip to width-of(" - ") before the
34 . \" normal indentation, output the " - "
35 . \" then attach the next line (the
36 . \" text) without stopping (\c: nroff
39 .\" labeled paragraph end
41 .ei \" tmac.n: end indented section
42 .in -\\n(PYu \" undo indent past label (etc)
43 .sn \\n(pdu \" tmac.n: inter-paragraph space
45 .\" end of labeled paragraph
48 .\" aligned single character key with SHORT definition (if it overflows one
49 .\" line, all bets are off)
51 .\" .CC k "definition here"
52 .nr CZ \w'\fBW' \" width of the key character column
53 .nr CW \n(CZ/2 \" half the width of the key character column
55 .nr CX \\w'\\fB\\$1'u/2 \" half the width of the key character
56 .nr CY \\n(CWu-\\n(CXu \" difference between the two half widths
57 .\" output: move right CR units, print the key letter, move right to
58 .\" the full width of the column, print " - " and the definition
59 \\h'|\\n(CYu'\\fB\\$1\\fP\\h'|\\n(CZu'\ -\ \\$2
62 .\" .SD = .sd with extra choices for argument; pair with .ED
63 .\" c - centered (original choice; as of this writing, not used by nethack)
64 .\" i - indented (default if choice is omitted)
66 .\" SF - set (1=>indent, 0=>no-indent) by .SD, used by .ED unless centering
67 .de SD \" start display
68 . \" look for nested displays -- ILLEGAL
69 .ie \\n(id>0 .er "display within display"
71 . nr sf 0 \" don't center by default
72 . nr SF 1 \" assume indent
73 . ie '\\$1'c' .nr sf 1 \" center the sucker
74 . el .if '\\$1'n' .nr SF 0 \" don't indent if 'n'
76 .sn \\n(pdu \" a little bit of space
77 .ev 2 \" switch to display environment
78 .nf \" what you type is what you get
79 .if \\n(id=0 .di dd \" start saving text
80 .rs \" don't eat leading space
81 .nr id +1 \" increment level of display
83 .\" .ED = .ed with support for \n(SF (indent vs no-indent); pair with .SD
86 .ie \\n(id<=0 .er "end display has no corresponding begin display"
88 . nr id -1 \" decrement level of display
91 . fi \" resume filling
92 . ie \\n(.i<\\n(pi .in 0
93 . el .in -\\n(piu \" dedent
94 . ev \" pop environment
95 . ne \\n(dnu \" be sure you have room
96 . nf \" don't reprocess display
97 . rs \" don't eat leading space
99 . ie \\n(sf .in (\\n(llu-\\n(dlu)/2u \" center
100 . el .if \\n(SF .in +\\n(piu \" indent
102 . yi \" restore indents
105 .fi \" resume filling
106 .sn \\n(pdu \" a little bit of space
109 .\" '.UX' is verbatim copy of tmac.n's '.ux' with the exception that
110 .\" the trademark owner for "UNIX" has been updated.
111 .de UX \" print "UNIX"
112 .ie \\n(ux \\&\\$2\\s-1UNIX\\s0\\$1
114 . nr ux +1 \" mark footnote as dropped
115 \\&\\$2\\s-1UNIX\\s0\\*(rg\\$1
116 . fn \" put out the footnote
117 \\&\\*(rgUNIX is a registered trademark of The Open Group.
118 . ef \" short and sweet ...
122 .\" .BR - hard line break with vertical padding inserted
123 .\" $1 - repeat count for amount of padding (optional; default is 1)
125 .ie \\.$==0 .nr bR 1v
132 .\" Just a pass-through here; converted to a link when generating HTML.
137 .\" groff and AT&T-descended troffs use different hyphenation patterns.
138 .\" Don't hyphenate the last word on a page or column, or
139 .\" before/after last/first 2 characters of a word.