OSDN Git Service

set portable directory setting like 3.6.1
[jnethack/source.git] / doc / tmac.nh
1 .\" NetHack 3.6 tmac.nh $NHDT-Date: $ $NHDT-Branch: $:$NHDT-Revision: $
2 .
3 .\"   Miscellaneous tmac.n-style macros specifically for nethack's Guidebook.
4 .\"
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.)
10 .
11 .\" labeled paragraph start
12 .\" .PS word
13 .\"     set the width for the label column
14 .\" .PL word
15 .\"     label for the entry
16 .\" .PE
17 .\"     clean up
18 .de PS
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
24 ..
25 .\" labeled paragraph label (and first line)
26 .de PL
27 .br
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
33 .                                       \" section 4.2)
34 ..
35 .\" labeled paragraph end
36 .de PE
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
40 ..
41 .\" end of labeled paragraph
42 .
43 .\"
44 .\" aligned single character key with SHORT definition (if it overflows one
45 .\" line, all bets are off)
46 .\" Usage:
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
50 .de CC
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
56 ..
57 .
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)
61 .\"    n - not indented
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"
66 .el \{\
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'
71 .\}
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
78 ..
79 .\" .ED = .ed with support for \n(SF (indent vs no-indent); pair with .SD
80 .de ED                                  \" end display
81 .br                                     \" flush line
82 .ie \\n(id<=0 .er "end display has no corresponding begin display"
83 .el \{\
84 .       nr id -1                        \" decrement level of display
85 .       if \\n(id=0 \{\
86 .               di                      \" end diversion
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
93 .               zi                      \" save indents
94 .               ie \\n(sf .in (\\n(llu-\\n(dlu)/2u      \" center
95 .               el .if \\n(SF .in +\\n(piu              \" indent
96 .               dd                      \" drop display
97 .               yi                      \" restore indents
98 .       \}
99 .\}
100 .fi                                     \" resume filling
101 .sn \\n(pdu                             \" a little bit of space
102 ..
103 .
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
108 .el \{\
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 ...
114 .\}
115 ..
116 .
117 .\" .BR - hard line break with vertical padding inserted
118 .\"    $1 - repeat count for amount of padding (optional; default is 1)
119 .de BR
120 .ie \\.$==0 .nr bR 1v
121 .el .nr bR (\\$1-0)v
122 \0
123 .sp \\n(bR
124 .br
125 ..
126 .\" .UR url
127 .\" Just a pass-through here; converted to a link when generating HTML.
128 .de UR
129 \\$1\\$2
130 ..
131 .
132 .\"tmac.nh/"