summaryrefslogtreecommitdiff
path: root/contrib/mom/momdoc/goodies.html
blob: 00e2db03796e5982de3044e1a744d74a613bfb0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is part of groff, the GNU roff type-setting system.

Copyright (C) 2004-2020 Free Software Foundation, Inc.
Written by Peter Schaffter (peter@schaffter.ca).

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.

A copy of the Free Documentation License is included as a file called
FDL in the main directory of the groff source package.
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
  <title>Mom -- Goodies</title>
  <link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>

<body style="background-color: #f5faff;">

<!-- ==================================================================== -->

<div id="top" class="page">

<!-- Navigation links -->
<table style="width: 100%;">
<tr>
  <td><a href="toc.html">Back to Table of Contents</a></td>
  <td style="text-align: right;"><a href="inlines.html#top">Next: Inline escapes</a></td>
</tr>
</table>

<h1 id="goodies" class="docs">Goodies</h1>

<p>
The macros in this section are a collection of useful (and sometimes
nearly indispensable) routines to simplify typesetting.
</p>

<div id="goodies-macros-mini-toc" style="margin-top: -1em; font-size: 95%;">
<div class="mini-toc-col-1">
<ul class="no-enumerator">
<li class="list-head-goodies"><a href="#alias">ALIAS</a> <span class="normal-smaller">&ndash; rename macros</span></li>
<li class="list-head-goodies"><a href="#caps">CAPS</a> <span class="normal-smaller">&ndash; convert to upper case</span></li>
<li class="list-head-goodies"><a href="#center-block">CENTER_BLOCK</a> <span class="normal-smaller">&ndash; centre blocks of type with quad intact</span></li>
<li class="list-head-goodies"><a href="#esc-char">ESC_CHAR</a> <span class="normal-smaller">&ndash; change the escape character to something other than a backslash</span></li>
<li class="list-head-goodies"><a href="#hang">HANG</a> <span class="normal-smaller">&ndash; hang character(s) outside right margin (inline escape)</span></li>
<li class="list-head-goodies"><a href="#left-hang">LEFT_HANG</a> <span class="normal-smaller">&ndash; hang character(s) outside left margin</span></li>
<li class="list-head-goodies"><a href="#silent">SILENT</a> <span class="normal-smaller">&ndash; hide input lines from output</span></li>
<li class="list-head-goodies"><a href="#sizespecs">SIZESPECS</a> <span class="normal-smaller">&ndash; get cap-height, x-height and descender depth of a font</span></li>
<li class="list-head-goodies"><a href="#smartquotes">SMARTQUOTES</a> <span class="normal-smaller">&ndash; convert typewriter doublequotes to proper doublequotes</span></li>
<li class="list-head-goodies"><a href="#string">STRING</a> <span class="normal-smaller">&ndash; user-definable strings</span></li>
<li class="list-head-goodies"><a href="#trap">TRAP</a> <span class="normal-smaller">&ndash; suspend/re-invoke traps</span></li>
<li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Underscoring/underlining</span>
<ul class="sublist">
  <li class="list-head-goodies text-color"><a href="#underscore">UNDERSCORE</a> <span class="normal-smaller">&ndash; single underscore</span>
  <ul class="sublist sub">
    <li class="list-head-goodies text-color"><a href="#underscore-weight">Controlling the weight of underscores</a></li>
    <li class="list-head-goodies text-color"><a href="#underscore-color">Colourising underscores</a></li>
  </ul></li>
  <li class="list-head-goodies text-color"><a href="#underscore2">UNDERSCORE2</a> <span class="normal-smaller">&ndash; double underscore</span></li>
  <li class="list-head-goodies text-color"><a href="#underline">UNDERLINE</a>
  <ul class="sublist sub">
    <li class="list-head-goodies text-color"><a href="#ul">\*[UL]</a> <span class="normal-sub-sub">&ndash; inline escape to underline</span></li>
  </ul></li>
</ul></li>
<li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Padding</span>
<ul class="sublist">
  <li class="list-head-goodies text-color"><a href="#pad">PAD</a> <span class="normal-smaller">&ndash; insert equalized whitespace into lines</span>
  <ul class="sublist sub">
    <li class="list-head-goodies text-color"><a href="#pad-marker">PAD_MARKER</a> <span class="normal-sub-sub">&ndash; change/set the marker used with PAD</span></li>
  </ul></li>
</ul></li>
</ul>
</div>
<div class="mini-toc-col-2">
<ul class="no-enumerator">
<li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Leaders</span>
<ul class="sublist">
  <li class="list-head-goodies text-color"><a href="#leader">\*[LEADER]</a> <span class="normal-smaller">&ndash; inline escape to add leaders to a line</span></li>
  <li class="list-head-goodies text-color"><a href="#leader-character">LEADER_CHARACTER</a> <span class="normal-smaller">&ndash; change/set the leader character</span></li>
</ul></li>
<li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Drop caps</span>
<ul class="sublist">
  <li class="list-head-goodies text-color"><a href="#dropcap">DROPCAP</a> <span class="normal-smaller">&ndash; set a drop cap</span></li>
  <li class="list-head-goodies text-color" style="list-style-type: none;"><a href="#dropcap-support"><span class="normal-smaller" style="font-weight: bold;">Support macros for DROPCAP</span></a>
  <ul class="sublist sub">
    <li class="list-head-goodies text-color"><a href="#dropcap-family">DROPCAP_FAMILY</a> <span class="normal-sub-sub">&ndash; change drop cap family</span></li>
    <li class="list-head-goodies text-color"><a href="#dropcap-font">DROPCAP_FONT</a> <span class="normal-sub-sub">&ndash; change drop cap font</span></li>
    <li class="list-head-goodies text-color"><a href="#dropcap-adjust">DROPCAP_ADJUST</a> <span class="normal-sub-sub">&ndash; alter size of drop cap</span></li>
    <li class="list-head-goodies text-color"><a href="#dropcap-color">DROPCAP_COLOR</a> <span class="normal-sub-sub">&ndash; change colour of drop cap</span></li>
    <li class="list-head-goodies text-color"><a href="#dropcap-gutter">DROPCAP_GUTTER</a> <span class="normal-sub-sub">&ndash; change space between drop cap and running text</span></li>
  </ul></li>
</ul></li>
<li class="list-head-goodies text-color no-anchor"><span style="font-size: 90%;">Superscripts</span>
<ul class="sublist">
  <li class="list-head-goodies text-color"><a href="#sup">\*[SUP]</a> <span class="normal-smaller">&ndash; inline escape to set superscripts</span>
  <ul class="sublist sub">
    <li class="list-head-goodies text-color"><a href="#sup-raise">SUPERSCRIPT_RAISE_AMOUNT</a> <span class="normal-sub-sub">(control superscript raise amount</span></li>
    <li class="list-head-goodies text-color"><a href="#cond-or-ext-sup">\*[CONDSUP]</a> <span class="normal-sub-sub">&ndash; condensed superscripts</span></li>
    <li class="list-head-goodies text-color"><a href="#cond-or-ext-sup">\*[EXTSUP]</a> <span class="normal-sub-sub">&ndash; extended superscripts</span></li>
  </ul></li>
</ul></li>
</ul>
</div>
</div>

<div class="rule-medium" style="padding-bottom: 1em;"><hr/></div>

<!-- -ALIAS- -->

<div class="macro-id-overline">
<h3 id="alias" class="macro-id">Rename macros</h3>
</div>

<div class="box-macro-args">
Macro: <b>ALIAS</b> <kbd class="macro-args">&lt;new name&gt; &lt;old name&gt;</kbd>
</div>

<p>
The ALIAS macro may well be your best friend.  With it, you can
change the name of a macro to anything you like (provided the new
name is not already being used by mom).
</p>

<p>
Groff has always been a bit intimidating for new users because
its standard macro packages use very terse macro names.  Mom
doesn&#8217;t like people to feel intimidated; she wants them
to feel welcome.  Consequently, she tries for easy-to-grasp,
self-explanatory macro names.  However, mom knows that people have
their own ways of thinking, their own preferences, their own habits.
Some of her macro names may not suit you; they might be too long,
or aren&#8217;t what you automatically think of when you want to
do a particular thing, or might conflict with habits you&#8217;ve
developed over the years.
</p>

<p>
If you don&#8217;t like one of mom&#8217;s macro names, say,
PAGEWIDTH, change it, like this:
<br/>
<span class="pre-in-pp">
  .ALIAS PW PAGEWIDTH
         |      |
    new--+      +--official
    name             name
</span>
The first argument to ALIAS is the new name you want for a macro.
The second is the &#8220;official&#8221; name by which the macro is
normally invoked.  After ALIAS, either can be used.
</p>

<div class="box-tip">
<p class="tip">
<span class="tip">Tip:</span>
A particularly good candidate for ALIAS is the macro
<a href="typesetting.html#ps">PT_SIZE</a>.
A more natural name for it would simply be PS, but PS conflicts
with the <b>eqn</b> equation preprocessor and thus mom uses the
longer form.  However, if you&#8217;re not using <b>eqn</b>, you can
happily rename PT_SIZE to
PS:
<br/>
<span class="pre-in-pp">
  .ALIAS PS PT_SIZE
</span>
</p>
</div>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
If you use ALIAS a lot, and always for the same things, consider
creating an aliases file of the form
<br/>
<span class="pre-in-pp">
  .ALIAS &lt;new name&gt; &lt;old name&gt;
  .ALIAS &lt;new name&gt; &lt;old name&gt;
  .ALIAS &lt;new name&gt; &lt;old name&gt;
  ...etc
</span>
Put the file someplace convenient and source it (include it) at the
beginning of your documents with the
<a href="docprocessing.html#include">INCLUDE</a>
macro.  Assuming that you&#8217;ve created an aliases file called
<b>mom-aliases</b> in your home directory under a directory called
<b>Mom</b>, you&#8217;d source it by placing
<br/>
<span class="pre-in-pp">
  .INCLUDE /home/&lt;username&gt;/Mom/mom-aliases
</span>
at the top of your documents.
</p>

<p class="tip-bottom">
If you share documents that make use of an alias file, remember that
other people don&#8217;t have the file.  Paste the whole thing at
the top of your documents, please.
</p>
</div>

<div class="box-tip">
<p class="tip">
<span class="experts">Experts:</span>
ALIAS is an alias of <kbd>.als</kbd>.  You can use either, or mix
&#8217;n&#8217; match with impunity.
</p>
</div>

<!-- -SILENT- --> 
<div class="macro-id-overline">
<h3 id="silent" class="macro-id">Hide input lines from output</h3>
</div>

<div class="box-macro-args">
 Macro: <b>SILENT</b> <kbd class="macro-args">toggle</kbd>
</div>

<p class="alias" style="margin-bottom: 0;">
<i>Alias:</i> <b>COMMENT</b>
</p>

<p>
Sometimes, you want to &#8220;hide&#8221;
<a href="definitions.html#inputline">input lines</a>
from final output.  This is most likely to be the case when setting
up string tabs (see the
<a href="typesetting.html#string-tabs-tut">quickie tutorial on string tabs</a>
for an example), but there are other places where you might want
input lines to be invisible as well.  Any place you don&#8217;t want
input lines to appear in the output, use the SILENT macro.
</p>

<p>
SILENT is a toggle.  Invoking it without an argument turns it on;
any argument turns it off.  E.g.,
<br/>
<span class="pre-in-pp">
  .SILENT
  A line of text
  .SILENT OFF
</span>
The line &#8220;A line of text&#8221; will not appear in the
output copy.
</p>

<p>
SILENT is aliased as COMMENT.  If you want to insert non-printing
comments into your documents, you may prefer this.
</p>

<div class="box-tip">
<p class="tip">
<span class="tip">Tip:</span>
SILENT does not automatically break an
<a href="definitions.html#inputline">input line</a>
(see
<a href="typesetting.html#br">BR</a>)
when you&#8217;re in one of the
<a href="definitions.html#filled">fill modes</a>
(<a href="typesetting.html#justify">JUSTIFY</a>
or
<a href="typesetting.html#quad">QUAD&nbsp;L&nbsp;|&nbsp;R&nbsp;|&nbsp;C&nbsp;|&nbsp;J</a>).
The same applies to tabs
(<a href="typesetting.html#tab-set">typesetting</a>
or
<a href="typesetting.html#st">string</a>)
to which you&#8217;ve passed the J or QUAD argument.  You must
insert <kbd>.BR</kbd> yourself, or risk a portion of your text
disappearing into a black hole.
</p>
</div>

<!-- -TRAP- -->

<div class="macro-id-overline">
<h3 id="trap" class="macro-id">Suspend / re-invoke traps</h3>
</div>

<div class="box-macro-args">
Macro: <b>TRAP</b> <kbd class="macro-args">toggle</kbd>
</div>

<p>
Traps are vertical positions on the output page at which
you or mom have instructed groff to start doing something
automatically.  Commonly, this is near the bottom of the page, where
behind-the-scenes processing is needed in order for one page to
finish and another to start.
</p>

<p>
Sometimes, traps get sprung when you don&#8217;t want them.  If this
happens, surround just the offending macros and input lines with
<br/>
<span class="pre-in-pp">
    .TRAP OFF
    ...
    .TRAP
</span>
TRAP is a toggle, therefore any argument turns it off (i.e., suspends
the trap), and no argument turns it (back) on.
</p>

<!-- -SMARTQUOTES- -->

<div class="macro-id-overline">
<h3 id="smartquotes" class="macro-id">Convert typewriter doublequotes to proper doublequotes</h3>
</div>

<div class="box-macro-args">
Macro: <b>SMARTQUOTES</b> <kbd class="macro-args">[&lt;off&gt;] [ ,, | &gt;&gt; | &lt;&lt; ]</kbd>
</div>

<span style="margin-left: .5em">or</span>

<div class="box-macro-args">
Macro: <b>SMARTQUOTES</b> <kbd class="macro-args">DA | DE | ES | FR | IT | NL | NO | PT | SV</kbd>
</div>

<p>
If you invoke SMARTQUOTES without an argument, mom converts all
instances of the inch-mark, (<kbd>"</kbd>), also called
a doublequote, into the appropriate instances of true Anglo-American
open-and close-doublequotes.  (See
<a href="#sq-international">Internationalization</a>
for how to get SMARTQUOTES to behave correctly for non-English
quoting styles.)
</p>

<p>
Typographically, there is a difference between the inch-mark and
quotation marks&mdash;a big difference.  Sadly, typewriters and computer
keyboards supply only one: the inch-mark.  While using inches for
doublequotes is, and always has been, acceptable in typewriter-style
copy, it has never been, and, God willing, never will be acceptable in
typeset copy.  Failure to turn inches into quotes is the first thing
a professional typesetter notices in documents prepared by amateurs.
And you don&#8217;t want to look like an amateur, do you?
</p>

<h3 id="sq-international" class="docs">Internationalization</h3>
<p>
If you invoke SMARTQUOTES with one of the optional arguments
(<kbd>,,</kbd> or <kbd>&gt;&gt;</kbd>
or <kbd>&lt;&lt;</kbd>) you can use
<kbd>&quot;</kbd> (i.e. the inch-mark/doublequotes key)
as &#8220;cheap&#8221; open-and close-quotes when inputting text in
a language other than English, and have mom convert them, on output,
into the chosen open-and close-quote style.
</p>

<p>
<kbd>,,</kbd> opens quotes with &#8220;lowered
doublequotes&#8221; and closes them with &#8220;raised
doublequotes&#8221;, as in this ascii approximation:
<br/>
<span class="pre-in-pp">
  ,,Hilfe !``
</span>

<kbd>&gt;&gt;</kbd> opens quotes with guillemets
pointing to the right, and closes them with guillemets pointing to
the left, as in this ascii approximation:
<br/>
<span class="pre-in-pp">
  &gt;&gt;Zurück !&lt;&lt;
</span>
<kbd>&lt;&lt;</kbd> opens quotes with guillemets
pointing to the left, and closes them with guillemets pointing to
the right, as in this ascii approximation:
<br/>
<span class="pre-in-pp">
  &lt;&lt;Mais monsieur! Je ne suis pas ce genre de fille!&gt;&gt;
</span>
Please note: the above arguments to SMARTQUOTES are literal
ASCII characters. <kbd>,,</kbd> is two commas;
<kbd>&lt;&lt;</kbd> is two less-than signs;
<kbd>&gt;&gt;</kbd> is two greater-than signs.
</p>

<p>
Alternatively, you can pass SMARTQUOTES the two-letter, ISO 639
abbreviation for the language you&#8217;re writing in, and mom will
output the correct quotes.
<br/>
<span class="pre-in-pp">
  .SMARTQUOTES DA     = Danish      &gt;&gt;text&lt;&lt;
  .SMARTQUOTES DE     = German      ,,text``
  .SMARTQUOTES ES     = Spanish     ``text´´
  .SMARTQUOTES FR     = French      &lt;&lt; text &gt;&gt;
  .SMARTQUOTES IT     = Italian     &lt;&lt; text &gt;&gt;
  .SMARTQUOTES NL     = Dutch       ´´text´´
  .SMARTQUOTES NO     = Norwegian   &lt;&lt;text&gt;&gt;
  .SMARTQUOTES PT     = Portuguese  &lt;&lt;text&gt;&gt;
  .SMARTQUOTES SV     = Swedish     &gt;&gt;text&gt;&gt;
</span>
</p>

<p>
Turn SMARTQUOTES off by passing it any argument not in the argument
list (e.g. <kbd>OFF</kbd>, <kbd>QUIT</kbd>, <kbd>X</kbd>, etc)
</p>

<p>
If you&#8217;re using the
<a href="docprocessing.html#docprocessing">document processing macros</a>
with
<a href="docprocessing.html#printstyle">PRINTSTYLE&nbsp;TYPESET</a>,
smartquotes are on by default (in the Anglo-American style); with
<a href="docprocessing.html#printstyle">PRINTSTYLE&nbsp;TYPEWRITE</a>,
it&#8217;s off by default (and should probably stay that way).
</p>

<p>
Finally, if you&#8217;re fussy about the kerning of quote marks in
relation to the text they surround, or have special quoting needs,
you have to enter quote marks by hand using groff&#8217;s native
<a href="definitions.html#inlines">inline escapes</a>
for special characters (see <kbd>man&nbsp;groff-char</kbd>
for a complete list of special characters).  Entering quote marks
this way allows you to use mom&#8217;s
<a href="inlines.html#inline-kerning-mom">inline kerning escapes</a>
to fine-tune the look of quotes.
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
SMARTQUOTES does not work on single quotes, which most people
input with the apostrophe (found at the right-hand end of the
&#8220;home row&#8221; on a QWERTY keyboard).  Groff will interpret
all instances of the apostrophe as an apostrophe, making the symbol
useless as an open-single-quote.  For open single quotes, input
the backtick character typically found under the tilde on most
keyboards.  Here&#8217;s an example of correct input copy with
single quotes:
<br/>
<span class="pre-in-pp">
  "But she said, `I don&#8217;t want to!'"    
</span>
</p>

<p class="tip-bottom" style="margin-top: -1em;">
<span class="additional-note">Additional note:</span>
Whether or not you have SMARTQUOTES turned on, get into the habit of
entering the foot-and inch-marks, when you need them, with the
<a href="definitions.html#inlines">inline escapes</a>
<kbd><span class="nobr">\*[FOOT]</span></kbd> and
<kbd><span class="nobr">\*[INCH]</span></kbd>, instead of
<kbd>'</kbd> and <kbd>"</kbd>.
</p>
</div>

<!-- -CAPS- -->

<div class="macro-id-overline">
<h3 id="caps" class="macro-id">Convert to upper case</h3>
</div>

<div class="box-macro-args">
Macro: <b>CAPS</b> <kbd class="macro-args">toggle</kbd>
</div>

<p>
CAPS converts all lower case letters to upper case.
Primarily, it&#8217;s a support macro used by the
<a href="docprocessing.html#docprocessing">document processing macros</a>,
but you may find it helpful on occasion. CAPS is a toggle, therefore
no argument turns it on, any argument (<kbd>OFF</kbd>,
<kbd>QUIT</kbd>, <kbd>X</kbd>, etc) turns it off.
<br/>
<span class="pre-in-pp">
  .CAPS
  All work and no play makes Jack a dull boy.
  .CAPS OFF
</span>

produces, on output
<br/>
<span class="pre-in-pp">
  ALL WORK AND NO PLAY MAKES JACK A DULL BOY.
</span>
If you wish to capitalise a section of type inline, use the
<a href="definitions.html#inlines">inline escapes</a>,
<a href="inlines.html#uc-lc"><kbd><span class="nobr">\*[UC]...\*[LC]</span></kbd></a>
like this:
<br/>
<span class="pre-in-pp">
  All work \*[UC]and\*[LC] no play makes Jack a dull boy.
</span>

The above produces, on output
<br/>
<span class="pre-in-pp">
  All work AND no play makes Jack a dull boy.
</span>
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
<kbd>\*[LC]</kbd> must come after a terminating period.
<br/>
<span class="pre-in-pp">
  \*[UC]All work and no play makes Jack a dull boy.\*[LC]
</span>
not
<span class="pre-in-pp">
  \*[UC]All work and no play makes Jack a dull boy\*[LC].
</span>
Conversely, an initial period must come <em>before</em>
<kbd>\*[UC]</kbd>, or be preceded by <kbd>\&amp;</kbd>, like this:
<br/>
<span class="pre-in-pp">
  .\*[UC]start\*[LC] is used to begin document processing.
</span>
or
<span class="pre-in-pp">
  \*[UC]\&amp;.start\*[LC] is used to begin document processing.
</span>
Upon output, either will produce
<br/>
<span class="pre-in-pp">
  START is used to begin document processing.
</span>
</p>
</div>

<!-- -STRING- -->

<div class="macro-id-overline">
<h3 id="string" class="macro-id">User-defined strings</h3>
</div>

<div class="box-macro-args">
Macro: <b>STRING</b> <kbd class="macro-args">&lt;name&gt; &lt;what you want in the string&gt;</kbd>
</div>

<p>
You may find sometimes that you have to type out portions of text
repeatedly.  If you&#8217;d like not to wear out your fingers, you can
define a string that, whenever you call it by name, outputs whatever
you put into it.
</p>

<p>
For example, say you&#8217;re creating a document that repeatedly uses
the phrase &#8220;the Montreal/Windsor corridor&#8221;.  Instead
of typing all that out every time, you could define a string, like
this:
<br/>
<span class="pre-in-pp">
  .STRING mw the Montreal/Windsor corridor
</span>
Once a string is defined, you can call it any time with the
<a href="definitions.html#inlines">inline escape</a>
<kbd><span class="nobr">\*[&lt;name&gt;]</span></kbd>.  Using the example
string above
<br/>
<span class="pre-in-pp">
  The schedule for trains along \*[mw]:
</span>
produces, on output
<br/>
<span class="pre-in-pp">
  The schedule for trains along the Montreal/Windsor corridor:
</span>
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
Be very careful not to put any spaces at the ends of strings
you&#8217;re defining, unless you want them.  Everything after
the name argument you pass to STRING goes into the string,
including trailing spaces.  It&#8217;s a good idea to get into the
habit of using groff&#8217;s native commenting mechanism, <kbd
class="bold">\"</kbd>, immediately following any string definition
in order to avoid spaces you can&#8217;t see, like this
<br/>
<span class="pre-in-pp">
  .STRING mw the Montreal/Windsor corridor\"
</span>
</p>
</div>

<div class="box-tip">
<p class="tip">
<span class="experts">Experts:</span>
STRING is an alias for <b>ds</b>.  You can use either, or mix
&#8217;n&#8217; match with impunity.
</p>
</div>

<!-- -ESC_CHAR- -->

<div class="macro-id-overline">
<h3 id="esc-char" class="macro-id">Change the escape character</h3>
</div>

<div class="box-macro-args">
Macro: <b>ESC_CHAR</b> <kbd class="macro-args">&lt;new character&gt; | &lt;anything&gt;</kbd>
</div>

<p>
Groff&#8217;s and mom&#8217;s default escape character is
the backslash.  Sometimes, you may want to include a literal
backslash in your document.  There are two ways to accomplish
this.  One is simply to double the backslash character (<kbd
class="bold">\\</kbd>), which is convenient if you don&#8217;t have
a lot of backslashes to input.  If you need to input a whole batch
of backslashes (say, when including code snippets in your document),
you can use ESC_CHAR to make the change permanent (until you decide
to restore the escape character to its default, the backslash).
</p>

<p>
ESC_CHAR with a single character argument changes the escape
character to whatever the argument is.  ESC_CHAR with no argument
restores the escape character to the backslash.
</p>

<div class="box-tip">
<p class="tip">
<span class="important">Important:</span>
Changing the escape character prevents macros, which require that
the backslash be the escape character, from functioning correctly.
Do not introduce any subsequent macros without first restoring the
escape character to its default.
</p>
</div>

<div class="box-tip">
<p class="tip">
<span class="experts">Experts:</span>
ESC_CHAR is an alias of <kbd>.ec</kbd>.  Mix &#8217;n&#8217; match
the two with impunity.
</p>
</div>

<!-- -SIZESPECS- -->

<div class="macro-id-overline">
<h3 id="sizespecs" class="macro-id">Get cap-height, x-height and descender depth of a font</h3>
</div>

<div class="box-macro-args">
Macro: <b>SIZESPECS</b>
</div>

<p>
Whenever you need to get the
<a href="definitions.html#capheight">cap-height</a>,
<a href="definitions.html#xheight">x-height</a>
or
<a href="definitions.html#descender">descender</a>
depth of type at the current point size, invoke <kbd
class="bold">.SIZESPECS</kbd>, which takes no argument.
The dimensions are stored in the string registers
<b><span class="nobr">\*[$CAP_HEIGHT]</span></b>,
<b><span class="nobr">\*[$X_HEIGHT]</span></b>,
and
<b><span class="nobr">\*[$DESCENDER]</span></b>, respectively, in
<a href="definitions.html#units">machine units</a>
to which the
<a href="definitions.html#unitofmeasure">unit of measure</a>,
<b>u</b>, is already appended.
</p>

<p>
Thus, if you wanted to advance 2 inches from your current position
on the page plus the cap-height of the current point size of type
<br/>
<span class="pre-in-pp">
  .PT_SIZE &lt;n&gt;
  .SIZESPECS
  .ALD 2i+\*[$CAP_HEIGHT]
</span>
would do the trick.
</p>

<!-- -UNDERSCORE- -->

<div class="macro-id-overline">
<h3 id="underscore" class="macro-id">Single underscore</h3>
</div>

<div class="box-macro-args">
Macro: <b>UNDERSCORE</b> <kbd class="macro-args">[ &lt;distance below baseline&gt; ] &quot;&lt;string&gt;&quot;</kbd>
</div>

<p class="requires">
&bull;&nbsp;Optional argument requires a <a href="definitions.html#unitofmeasure">unit of measure</a>
</p>

<p>
By default, UNDERSCORE places an underscore 2 points beneath the
required
<a href="definitions.html#stringargument">string argument</a>.
The string must be enclosed in double-quotes, like this:
<br/>
<span class="pre-in-pp">
  .UNDERSCORE "Unmonitored monopolies breed high prices and poor products."
</span>
If you wish to change the distance of the rule from the baseline,
use the optional argument
<kbd>&lt;distance&nbsp;below&nbsp;baseline&gt;</kbd>
(with a unit of measure).
<br/>
<span class="pre-in-pp">
  .UNDERSCORE 3p "Unmonitored monopolies breed high prices and poor products."
</span>
The above places the upper edge of the underscore 3 points below the
<a href="definitions.html#baseline">baseline</a>.
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Tip:</span>
UNDERSCORE can also be used for strikethrough effects by supplying a
negative value to the distance argument.
</p>
</div>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
UNDERSCORE does not work across line breaks in output copy, which is
to say that you can&#8217;t underscore a multi-line passage simply
by putting the text of the whole thing in the string you pass to
UNDERSCORE.  If you need to underscore several lines of type, use
<a href="#underline">UNDERLINE</a>.
</p>
</div>

<div class="box-tip">
<p class="tip">
<span class="note">Additional note:</span>
In
<a href="definitions.html#filled">nofill modes</a>,
UNDERSCORE causes a break before and after, meaning the underscored
word or phrase will appear as a separate line in your output.  If
you wish to embed an underscored word or phrase into non-filled
text, temporarily change to the corresponding fill mode with
<a href="typesetting.html#quad">QUAD</a>
and insert breaks manually with
<a href="typesetting.html#br">BR</a>
as appropriate, reverting to the original nofill mode afterwards.
</p>
</div>

<h3 id="underscore-weight" class="docs">Controlling the weight of underscores</h3>
<p>
The weight (thickness) of underscores may be controlled with the
macro UNDERSCORE_WEIGHT.  Thus, if you want underscores with a
weight of 1-1/2 points, you&#8217;d invoke:
<br/>
<span class="pre-in-pp">
  .UNDERSCORE_WEIGHT 1.5
</span>
prior to invoking <kbd>.UNDERSCORE</kbd>.  Every
subsequent instance of <kbd>.UNDERSCORE</kbd> will use
this weight.
</p>

<p>
Mom&#8217;s default underscore weight is 1/2 point.
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
UNDERSCORE_WEIGHT also sets the weight of
<a href="#UNDERSCORE2">double underscores.</a>
</p>
</div>

<h3 id="underscore-color" class="docs">Colourising underscored text</h3>
<p>
If you want underscored text to be in a different colour from the
text around it, use the
<a href="color.html#color">COLOR</a>
macro rather than the
<a href="color.html#color-inline">inline escape for changing colour</a>.
In other words, assuming your prevailing text colour is black and
you want underscored text in red
<br/>
<span class="pre-in-pp">
  .COLOR red
  .UNDERSCORE "text to underscore"
  .COLOR black
</span>
rather than
<br/>
<span class="pre-in-pp">
  .UNDERSCORE "\*[red]text to underscore\*[black]"
</span>
The latter will render the text in red but the underscore in black.
You can use this to create truly rainbow effects if you want, e.g.
text in red, underscore in blue, and prevailing type in black:
<br/>
<span class="pre-in-pp">
  .UNDERSCORE "\*[red]text to underscore\*[blue]"
  .COLOR black
</span>
</p>

<!-- -UNDERSCORE2- -->

<div class="macro-id-overline">
<h3 id="underscore2" class="macro-id">Double underscore</h3>
</div>

<div class="box-macro-args">
Macro: <b>UNDERSCORE2</b> <kbd class="macro-args">[ &lt;distance below baseline&gt; [ &lt;distance between rules&gt; ] ] &quot;&lt;string&gt;&quot;</kbd>
</div>

<p class="requires">
&bull;&nbsp;Optional arguments require a <a href="definitions.html#unitofmeasure">unit of measure</a>
</p>

<p>
By default, UNDERSCORE2 places a double underscore 2 points beneath
the required
<a href="definitions.html#stringargument">string argument</a>.
The string must be enclosed in double-quotes, like this:
<br/>
<span class="pre-in-pp">
  .UNDERSCORE2 "Unmonitored monopolies breed high prices and poor products."
</span>
The default distance between the two rules is 2 points, measured
from the bottom edge of the upper rule to the top edge of the lower
one.
</p>

<p>
If you wish to change the distance of the double underscore from the
<a href="definitions.html#baseline">baseline</a>,
use the optional argument
<kbd>&lt;distance&nbsp;below&nbsp;baseline&gt;</kbd>
(with a unit of measure), e.g.
<br/>
<span class="pre-in-pp">
  .UNDERSCORE2 3p "Unmonitored monopolies breed high prices and poor products."
</span>
which places the upper edge of the first rule of the double
underscore 3 points below the baseline.
</p>

<p>
If you wish to change the distance between the two rules as well,
use the second optional argument
<kbd>&lt;distance&nbsp;between&nbsp;rules&gt;</kbd>
(with a unit of measure).  Be aware that you must give a value for
the first optional argument if you want to use the second.  The
distance between the two rules is measured from the bottom edge of
the upper rule to the top edge of the lower one.
</p>

<p>
The weight (thickness) of double underscores may be controlled with
the macro
<a href="#underscore-weight">UNDERSCORE_WEIGHT</a>
(q.v).
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
In
<a href="definitions.html#filled">nofill modes</a>,
UNDERSCORE2 causes a break before and after, meaning the double-underscored
word or phrase will appear as a separate line in your output.  If
you wish to embed a double-underscored word or phrase into non-filled
text, temporarily change to the corresponding fill mode with
<a href="typesetting.html#quad">QUAD</a>
and insert breaks manually with
<a href="typesetting.html#br">BR</a>
as appropriate, reverting to the original nofill mode afterwards.
</p>
</div>

<!-- -UNDERLINE- --> 
<div class="macro-id-overline">
<h3 id="underline" class="macro-id">Underline</h3>
</div>

<div class="box-macro-args">
Macro: <b>UNDERLINE</b> <kbd class="macro-args">toggle</kbd>
</div>

<p>
The distinction between underscoring and underlining is that
underscoring is suitable for occasional effects (a word here,
a phrase there), whereas underlining underlines whole passages
of type.  Furthermore, you cannot colourise underlining.
There&#8217;s a special macro,
<a href="#underline-specs">UNDERLINE_SPECS</a>,
to control the weight and distance from the baseline of the
underline.
</p>

<p>
Lastly, files that use UNDERLINE must be processed with
<br/>
<span class="pre-in-pp">
  pdfmom -Tps filename.mom | ps2pdf - filename.pdf
</span>
since groff&#8217;s pdf driver does not recognize UNDERLINE.
</p>

<p>
Note that
<a href="docprocessing.html#printstyle">PRINTSTYLE&nbsp;TYPEWRITE</a>
uses UNDERLINE to underline italics
and pseudo-italics (<a href="typesetting.html#slant-inline">SLANT</a>)
by default.  The default may be changed (see
<a href="docprocessing.html#printstyle-italics">Underlining of italics</a>)
but if it's what you want, you must process your document as shown
above.
</p>

<p>
UNDERLINE is a toggle macro, therefore you invoke it by itself (i.e.
with no argument) to initiate underlining, and with any argument
(<kbd>OFF</kbd>, <kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc)
to turn it off.
</p>

<div class="box-tip">
<p class="tip-top">
<span class="note">Note:</span>
Underlining may also be turned on and off
<a href="definitions.html#inlines">inline</a>
with the escapes
<a href="#ul"><kbd><span class="nobr">\*[UL]...\*[ULX]</span></kbd></a>.
</p>

<p class="tip-bottom">
<span class="additional-note">Additional note:</span>
In document processing, neither <kbd>.UNDERLINE</kbd> nor
<kbd><span class="nobr">\*[UL]</span></kbd> persist past the current document element tag.
For example, if you turn underlining on in a paragraph
(<kbd><a href="docelement.html#pp">.PP</a></kbd>),
your next paragraph will not be underlined.
</p>
</div>

<h4 id="underline-specs" class="docs">UNDERLINE_SPECS</h4>

<p>
The weight of underlining and the distance from the baseline is
set with
<br/>
<span class="pre-in-pp">
  .UNDERLINE_SPECS &lt;weight&gt; &lt;distance&gt;
</span>
The <kbd>&lt;weight&gt;</kbd> argument can be expressed in any
<a href="definitions.html#unitofmeasure">unit of measure</a>
you like, but points is the most usual.  Mom&#8217;s default is 1/2 point
(.5p).  The same holds for the <kbd>&lt;distance&gt;</kbd> argument;
mom&#8217;s default is 1-1/4 points (1.25p).
</p>

<!-- -UL- -->

<h4 id="ul" class="docs">INLINE ESCAPE FOR UNDERLINING</h4>

<p>
The macro pair,
<kbd><a href="#underline">.UNDERLINE</a></kbd> /
<kbd>.UNDERLINE&nbsp;OFF</kbd>, and the inline escapes,
<span class="nobr"><kbd>\*[UL]</kbd> / <kbd>\*[ULX]</kbd></span>, are
functionally identical, hence, in
<a href="definitions.html#filled">fill</a>
modes
<br/>
<span class="pre-in-pp">
  Which should I heed?
  .UNDERLINE
  Just do it
  .UNDERLINE OFF
  or
  .UNDERLINE
  just say no?
  .UNDERLINE OFF
</span>
produces the same result as
<br/>
<span class="pre-in-pp">
  Which should I heed? \*[UL]Just do it\*[ULX] or \*[UL]just say no?\*[ULX]
</span>
In either case, this is a misuse of UNDERLINE.
<a href="#underscore">UNDERSCORE</a>
is preferable.
</p>

<!-- -PAD- -->

<div class="macro-id-overline">
<h3 id="pad" class="macro-id">Insert equalized whitespace into lines</h3>
</div>

<div class="box-macro-args">
Macro: <b>PAD</b> <kbd class="macro-args">&quot;&lt;string with pad markers inserted&gt;&quot; [ NOBREAK ]</kbd>
</div>

<p>
With PAD, you can insert proportional amounts of whitespace into a
line.  The optional <kbd id="nobreak" class="bold">NOBREAK</kbd>
argument tells mom not to advance on the page after the PAD macro
has been invoked.
</p>

<p>
PAD calculates the difference between the length of text on the line
and the distance remaining to its end, then inserts the difference
(as whitespace) at the place(s) you specify.
</p>

<p>
Take, for example, the following relatively common typesetting
situation, found at the bottom of legal agreements:
<br/>
<span class="pre">
  Date             Signature                               |
</span>
</p>

<p>
The person signing the agreement is supposed to fill in the date
as well as a signature.  Space needs to be left for both, but the
exact amount is neither known, nor important.  All that matters is
that there be a little space after Date, and rather more space after
Signature.  (In the above, <kbd>|</kbd> represents the
end of the line at the prevailing line length.)
</p>

<p>
The
<a href="goodies.html#pad-marker">pad marker</a>
(see below) is <kbd>#</kbd> (the pound or number sign
on your keyboard) and can be used multiple times in a line.  With
that in mind, here&#8217;s how you&#8217;d input the Date/Signature line
(assuming a length of 30 picas):
<br/>
<span class="pre">
  .LL 30P
  .PAD "Date#Signature###"
</span>
</p>

<p>
When the line is output, the space remaining on the line, after
&quot;Date&quot; and &quot;Signature&quot; have been taken into
account, is split into four (because there are four # signs).  One
quarter of the space is inserted between Date and Signature, the
remainder is inserted after Signature.
</p>

<div class="examples-container">
<h3 id="pad-example" class="docs notes">Example of PAD usage</h3>
<p style="margin-top: .5em;">
One rarely wants merely to insert space in a line; one usually wants
to fill it with something, hence PAD is particularly useful in
conjunction with
<a href="typesetting.html#string-tabs">string tabs</a>.
The following uses the Date/Signature example, above, but adds
rules into the whitespace through the use of string tabs and
mom&#8217;s
<a href="definitions.html#inlines">inline escape</a>
<a href="inlines.html#inline-rule-mom"><kbd><span class="nobr">\*[RULE]</span></kbd></a>.
<br/>
<span class="pre-in-pp">
  .LL 30P
  .PAD "Date \*[ST1]#\*[ST1X] Signature \*[ST2]###\*[ST2X]" NOBREAK
  .ST 1 J
  .ST 2 J
  .TAB 1
  \*[RULE]
  .TN
  \*[RULE]
  .TQ
</span>
</p>

<p>
Here&#8217;s what the example does:
</p>
<ol style="margin-top: -.5em; margin-bottom: -.5em;">
  <li>Pads the Date/Signature line with a shorter space for Date
     (<kbd>#</kbd>) and a longer space for Signature
     (<kbd>###</kbd>), encloses the padded space with string tabs
     markers, and outputs the line without advancing on the page.
  </li>
  <li>Sets the quad for the two string tabs (in this instance, justified).
  </li>
  <li>Calls the first string tab and draws a rule to its full
      length.
  </li>
  <li>Calls the second tab with
      <a href="typesetting.html#tn">TN</a>
      (which moves to tab 2 and stays on the same baseline)
      then draws a rule to the full length of string tab 2.
  </li>
</ol>

<p>
Often, when setting up string tabs this way, you don&#8217;t want the
padded line to print immediately.  To accomplish this, use
<kbd><a href="#silent">SILENT</a></kbd>.
See the
<a href="typesetting.html#string-tabs-tut">quickie tutorial on string tabs</a>
for an example.
</p>
</div>

<div class="box-tip">
<p class="tip-top">
<span class="note">Note:</span>
Because the pound sign
(<kbd>#</kbd>) is used as the pad marker, you
can&#8217;t use it as a literal part of the pad string.  If you need
the sign to appear in the text of a padded line, change the pad
marker with
<kbd><a href="#pad-marker">PAD_MARKER</a></kbd>.
Also, be aware that <kbd>#</kbd> as a pad marker
only applies within the PAD macro; at all other times it prints
literally, just as you&#8217;d expect.
</p>

<p class="tip-bottom">
Another important consideration when using PAD is that because the
string must be enclosed in double-quotes, you can&#8217;t use the
double-quote (<kbd>"</kbd>) as part of the string.  The
way to circumvent this is to use the groff
<a href="definitions.html#inlines">inline escapes</a>
<kbd>\(lq</kbd> and <kbd>\(rq</kbd>
(leftquote and rightquote respectively) whenever double-quotes are
required in the string passed to PAD.
</p>
</div>

<!-- -PAD_MARKER- -->

<div class="macro-id-overline">
<h3 id="pad-marker" class="macro-id">Change/set the marker used with PAD</h3>
</div>

<div class="box-macro-args">
Macro: <b>PAD_MARKER</b> <kbd class="macro-args">"&lt;character to use as the pad marker&gt;</kbd>
</div>

<p>
If you need to change mom&#8217;s default pad marker (<kbd
class="bold">#</kbd>), either because you want a literal # in
the padded line, or simply because you want to use another character
instead, use PAD_MARKER, whose argument is the new pad marker
character you want.
<br/>
<span class="pre-in-pp">
  .PAD_MARKER @
</span>
changes the pad marker to <kbd>@</kbd>.
</p>

<p>
Once you&#8217;ve changed the pad marker, the new marker remains in effect
for every instance of
<a href="#pad">PAD</a>
until you change it again (say, back to the pound sign).
</p>

<!-- -\*[LEADER]- -->

<div class="macro-id-overline">
<h3 id="leader" class="macro-id">Inline escape to add leaders to a line</h3>
</div>

<div class="box-macro-args">
Inline: <b>\*[LEADER]</b>
</div>

<p>
Whenever you want to fill a line or tab with
<a href="definitions.html#leader">leaders</a>,
use the
<a href="definitions.html#inlines">inline escape</a>
<kbd><span class="nobr">\*[LEADER]</span></kbd>.  The remainder of the line or
tab will be filled with the leader character. Mom&#8217;s default
leader character is a period (dot), but you can change it to any
character you like with
<kbd><a href="#leader-character">LEADER_CHARACTER</a></kbd>.
</p>

<div class="box-tip">
<p class="tip-top">
<span class="note">Note:</span>
<kbd>\*[LEADER]</kbd> fills lines or tabs right to
their end.  You cannot insert leaders into a line or tab and have
text following the leader on the same line or in the same tab.
Should you wish to achieve such an effect typographically, create
tabs for each element of the line and fill them appropriately with
the text and leaders you need.
<a href="typesetting.html#string-tabs">String tabs</a>
are perfect for this.  An example follows.
<br/>
<span class="pre">
  .LL 30P
  .PAD "Date\*[ST1]#\*[ST1X]  Signature\*[ST2]###\*[ST2X]" NOBREAK
  .EL
  .ST 1 J
  .ST 2 J
  .TAB 1
  \*[LEADER]
  .TN
  \*[LEADER]
  .TQ
</span>
</p>

<p class="tip-bottom">
The PAD line sets the words Date and Signature, and marks string
tabs around the pad space inserted in the line.  The string tabs are
then &quot;set&quot;, called, and filled with leaders.  The result
looks like this:
<br/>
<span class="pre" style="margin-bottom: -1em;">
  Date.............Signature.....................................
</span>
</p>
</div>

<!-- -LEADER_CHARACTER- -->

<div class="macro-id-overline">
<h3 id="leader-character" class="macro-id">Change/set the leader character</h3>
</div>

<div class="box-macro-args">
Macro: <b>LEADER_CHARACTER</b> <kbd class="macro-args">&lt;character&gt;</kbd>
</div>

<p>
LEADER_CHARACTER takes one argument: a single character you would
like to be used for
<a href="definitions.html#leader">leaders</a>.
(See
<a href="#leader"><kbd><span class="nobr">\*[LEADER]</span></kbd></a>
for an explanation of how to fill lines with leaders.)
</p>

<p>
For example, to change the leader character from mom&#8217;s
default (a period) to the underscore character, enter
<br/>
<span class="pre-in-pp">
  .LEADER_CHARACTER _
</span>
</p>

<div class="box-tip">
<p class="tip">
<span class="tip">Tip:</span>
A particularly useful function of LEADER_CHARACTER is that it can be
used to increase the spacing of mom&#8217;s default leaders.  This is
done by assigning to LEADER_CHARACTER both the period (dot) and a
space.  The technique requires a little low-level groffing:
<br/>
<span class="pre-in-pp">
  .char \[leader] . \"
  .LEADER_CHARACTER \[leader]
</span>
The <kbd>.char</kbd>
<a href="definitions.html#primitives">primitive</a>
allows you to define a character called <kbd>leader</kbd>, to which
you assign a period and a space.  The <kbd>\"</kbd>, which, in
groff, is used to add non-printing comments to a line, is not
strictly necessary.  Its presence here lets you see that
there&#8217;s a space after the period.
</p>
</div>

<!-- -DROPCAP- -->

<div class="macro-id-overline">
<h3 id="dropcap" class="macro-id">Drop caps</h3>
</div>

<div class="box-macro-args">
Macro: <b>DROPCAP</b> <kbd class="macro-args">&lt;dropcap letter&gt; &lt;number of lines to drop&gt; [ COND &lt;percentage&gt; | EXT &lt;percentage&gt; ]</kbd>
</div>

<p>
The first two arguments to DROPCAP are the letter you want to be the
<a href="definitions.html#dropcap">drop cap</a>
and the number of lines you want it to drop.  By default, mom uses
the current family and font for the drop cap.
</p>

<p>
The optional argument (<kbd>COND</kbd> or <kbd>EXT</kbd>) indicates
that you want the drop cap condensed (narrower) or extended (wider).
If you use <kbd class="bold">COND</kbd> or <kbd>EXT</kbd>, you must
follow the argument with the percentage of the letter&#8217;s normal
width you want it condensed or extended.  No percent sign
(<kbd>%</kbd>) is required.
</p>

<p>
Mom will do her very best to get the drop cap to line up with the
first line of text indented beside it, then set the correct number
of indented lines, and restore your left margin when the number of
drop cap lines has been reached.
</p>

<p>
Beginning a paragraph with a drop cap &#8220;T&#8221; looks like this:
<br/>
<span class="pre">
  .DROPCAP T 3 COND 90
  he thousand injuries of Fortunato I had borne as best I
  could, but when he ventured upon insult, I vowed revenge.
  You who so well know the nature of my soul will not suppose,
  however, that I gave utterance to a threat...
</span>
</p>

<p>
The drop cap, slightly condensed but in the current family and font,
will be three lines tall, with whatever text fills those three
lines indented to the right of the letter.  The remainder of the
paragraph&#8217;s text will revert to the left margin.
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
When using the
<a href="docprocessing.html#docprocessing">document processing macro</a>
<a href="docelement.html#pp">PP</a>,
DROPCAP only works
</p>
<ul style="margin-top: -1em; margin-bottom: -.5em;">
  <li>with initial paragraphs (i.e. at the start of the document,
      or after
      <a href="docelement.html#heading">HEADING</a>),</li>
  <li>when <kbd>.DROPCAP</kbd> comes immediately after <kbd>.PP</kbd>,</li>
  <li>the
      <a href="docprocessing.html#printstyle">PRINTSTYLE</a>
      is TYPESET.</li>
</ul>
<p>
If these conditions aren&#8217;t met, DROPCAP is silently ignored.
</p>

<p class="tip-bottom" style="margin-top: -1em;">
<span class="additional-note">Additional note:</span>
If you have dropcaps after
<a href="docelement.html#heading">HEADING</a>s,
you must increase the <kbd>NEEDS</kbd> argument to
<a href="docelement.html#heading-style">HEADING_STYLE</a>
to match the number of dropcap lines.  For example, assuming
dropcaps that are three lines tall:
<br/>
<span class="pre-in-pp">
  .HEADING_STYLE 1 NEEDS 3
</span>
</p>
</div>

<div class="box-important">
<p class="tip">
<span class="important">Warning:</span>
DROPCAP puts a bit of a strain on resource-challenged systems.  If
you have such a system and use drop caps extensively in a document,
be prepared for a wait while mom does her thing.
</p>
</div>

<h3 id="dropcap-support" class="docs control-macros-header">Support macros for DROPCAP</h3>
<p>
Drop caps are the bane of most typesetters&#8217; existence.
It&#8217;s very difficult to get the size of the drop cap right
for the number of drop lines, especially if the drop cap is in a
different family from the prevailing family of running text.  Not
only that, but there&#8217;s the gutter around the drop cap to take
into account, plus the fact that the letter may be too wide or too
narrow to look anything but odd or misplaced.
</p>

<p>
Mom solves the last of these problems with the <kbd>COND</kbd> and
<kbd>EXT</kbd> arguments.  The rest she solves with macros that
change the default behaviour of DROPCAP, namely
</p>
<ul class="no-enumerator" style="margin-top: -.5em; margin-left: -.5em;">
  <li><a href="#dropcap-family">DROPCAP_FAMILY</a></li>
  <li><a href="#dropcap-font">DROPCAP_FONT</a></li>
  <li><a href="#dropcap-color">DROPCAP_COLOR</a></li>
  <li><a href="#dropcap-adjust">DROPCAP_ADJUST</a></li>
  <li><a href="#dropcap-gutter">DROPCAP_GUTTER</a></li>
</ul>

<p style="margin-top: -.5em;">
These macros must, of course, come before you invoke DROPCAP.
</p>

<h3 id="dropcap-family" class="control-macro">&bull;&nbsp;DROPCAP_FAMILY</h3>
<p style="margin-left: .66em;">
Set the drop cap family by giving DROPCAP_FAMILY the name of the
family you want, e.g.
<br/>
<span class="pre-in-pp">
  .DROPCAP_FAMILY H
</span>
which will set the family to Helvetica for the drop cap only.
</p>

<h3 id="dropcap-font" class="control-macro">&bull;&nbsp;DROPCAP_FONT</h3>
<p style="margin-left: .66em;">
Set the drop cap font by giving DROPCAP_FONT the name of the font
you want, e.g.
<br/>
<span class="pre-in-pp">
  .DROPCAP_FONT I
</span>
which will set the font to italic for the drop cap only.
</p>

<h3 id="dropcap-adjust" class="control-macro">&bull;&nbsp;DROPCAP_ADJUST</h3>
<p style="margin-left: .66em;">
If the size mom calculates for the drop cap isn&#8217;t precisely
what you want, you can increase or decrease it with DROPCAP_ADJUST,
like this: e.g.
<br/>
<span class="pre-in-pp">
  .DROPCAP_ADJUST +1
</span>
or
<br/>
<span class="pre">
  .DROPCAP_ADJUST -.75
</span>
</p>

<p style="margin-left: .66em;">
DROPCAP_ADJUST only understands
<a href="definitions.html#picaspoints">points</a>,
therefore do not append any
<a href="definitions.html#unitofmeasure">unit of measure</a>
to the argument.  And always be sure to prepend the plus or
minus sign, depending on whether you want the drop cap larger or
smaller.
</p>

<h3 id="dropcap-color" class="control-macro">&bull;&nbsp;DROPCAP_COLOR</h3>
<p style="margin-left: .66em;">
If you&#8217;d like your drop cap colourized, simply invoke
<kbd>.DROPCAP_COLOR&nbsp;&lt;color&gt;</kbd> with the name of a
colour you&#8217;ve already created (&#8220;initialized&#8221;) with
<a href="color.html#newcolor">NEWCOLOR</a>
or
<a href="color.html#xcolor">XCOLOR</a>.
Only the drop cap will be colourized; all other text will remain at
the current colour default (usually black).
</p>

<h3 id="dropcap-gutter" class="control-macro">&bull;&nbsp;DROPCAP_GUTTER</h3>
<p style="margin-left: .66em;">
By default, mom puts three points of space between the drop cap
and the text indented beside it.  If you want another value, use
DROPCAP_GUTTER (with a unit of measure), like this:
<br/>
<span class="pre-in-pp">
  .DROPCAP_GUTTER 6p
</span>
</p>

<!-- -\*[SUP]- -->

<div class="macro-id-overline">
<h3 id="sup" class="macro-id">Superscript</h3>
</div>

<div class="box-macro-args">
Inlines: <kbd>\*[SUP]...\*[SUPX]</kbd>
</div>

<p>
Superscripts are accomplished
<a href="definitions.html#inlines">inline</a>.
Whenever you need one, typically for numerals, all you need
to do is surround the superscript with the inlines above.
<kbd><span class="nobr">\*[SUP]</span></kbd> begins superscripting;
<kbd><span class="nobr">\*[SUPX]</span></kbd> turns it off.
</p>

<p id="cond-or-ext-sup">
If your running type is
<a href="typesetting.html#cond-inline">pseudo-condensed</a>
or
<a href="typesetting.html#ext-inline">pseudo-extended</a>
and you want your superscripts to be equivalently pseudo-condensed
or -extended, use
<br/>
<kbd><span class="nobr">\*[CONDSUP]...\*[CONDSUPX]</span></kbd> or
<kbd><span class="nobr">\*[EXTSUP]...\*[EXTSUPX]</span></kbd>.
</p>

<p>
The superscript inlines are primarily used by the
<a href="docprocessing.html#docprocessing">document processing macros</a>
for automatic generation of numbered footnotes.  However, you may
find them useful for other purposes.
</p>

<div class="box-tip">
<p class="tip">
<span class="note">Note:</span>
Mom does a pretty fine job of making superscripts look good in any
font and at any size.  If you&#8217;re fussy, though (and I am),
about precise vertical placement, kerning, weight, size, and so on,
you may want to roll your own solution.
</p>
</div>

<h3 id="sup-raise" class="docs">SUPERSCRIPT RAISE AMOUNT</h3>
<p>
By default, mom raises superscripts 1/3 of an
<a href="definitions.html#em">em</a>
above the baseline.  If you&#8217;re not happy with this default,
you can change it by invoking SUPERSCRIPT_RAISE_AMOUNT with the
amount you want them raised.  A
<a href="definitions.html#unitofmeasure">unit of measure</a>
must be appended directly to the amount.  Thus, if you want
superscripts raised by 3
<a href="definitions.html#picaspoints">points</a>
instead of 1/3 em, you&#8217;d do
<br/>
<span class="pre-in-pp">
  .SUPERSCRIPT_RAISE_AMOUNT 3p
</span>
and all subsequent superscripts would be raised by 3 points.
</p>

<!-- -CENTER BLOCK- -->

<div class="macro-id-overline">
<h3 id="center-block" class="macro-id">Centre blocks of type</h3>
</div>

<div class="box-macro-args">
Macro: <b>CENTER_BLOCK</b> <kbd class="macro-args">&lt;toggle&gt;</kbd>
</div>

<p>
Blocks of type sometimes need to be centred on the page with their quad
direction (left, centre, right) left intact.  The
document processing macros
<a href="docelement.html#quote">QUOTE</a>
and
<a href="docelement.html#blockquote">BLOCKQUOTE</a>
take care of this automatically, but there are other situations
where you may want to centre blocks of type.  An example might be
left-quadded
<a href="docelement.html#list-intro">nested lists</a>.
</p>

<p>
Whenever you want to centre a block of type on the page, surround it
with <kbd>.CENTER_BLOCK/.CENTER_BLOCK OFF</kbd> (or <kbd>QUIT</kbd>,
<kbd>X</kbd>, etc).
</p>

<div class="macro-id-overline">
<h3 id="left-hang" class="macro-id">Hanging characters</h3>
</div>
<br/>
<div class="box-macro-args">
Macro: <b>LEFT_HANG</b> <kbd class="macro-args">&lt;character&gt; [ &lt;gutter&gt;</kbd> ]
</div>
<p class="requires">
&bull;&nbsp;left-hung characters
</p>

<div class="box-macro-args" style="margin-top: 1em">
Inline: <b>\*[HANG <kbd class="macro-args">&lt;character&gt;</kbd>]</b>
</div>
<p class="requires">
&bull;&nbsp;right-hung characters
</p>

<p>
Hung characters, frequently punctuation, fall outside the left or
right margin.  Their purpose is usually to fine-tune justification.
Consider the following:
</p>

<table style="margin-left: 3%; margin-right: 6%; text-align: justify">
<tr>
<td style="padding-right: 1em">
&#8220;Play the man, Master Ridley; we
shall this day light such a candle,
by God's grace, in England, as I
trust shall never be put out.&#8221;
</td>
<td>
&nbsp;&nbsp;
</td>
<td style="margin-right: 0; padding-right: 0">
&#8220;
<br/>
<br/>
<br/>
<br/>
</td>
<td style="margin-left: 0; padding-left: 0">
Play the man, Master Ridley; we
shall this day light such a candle,
by God's grace, in England, as I
trust shall never be put out.&#8221;</td>
</tr>
</table>

<p>
In the right hand example, the opening double-quote hangs outside
the left margin, creating a uniform left margin for the text.
</p>

<h4 class="docs">Left hung characters</h4>

<p>
LEFT_HANG hangs its first argument, the character to be hung, to
the left of the left margin.  The optional second argument lets you
specify an amount of space to insert between the hung character and
the text.
</p>

<p>
Input text after LEFT_HANG must begin with the character to be hung
PLUS a
<a href="inlines.html#inline-horizontal-mom">horizontal motion</a>
corresponding to <kbd>&lt;gutter&gt;</kbd> if one was given.
If the hung character is a left double-quote, <kbd>\[lq]</kbd>
must be used as the argument to LEFT_HANG and the usual keyboard
double-quote (<kbd>"</kbd>) entered as the input text so as not to
confuse
<a href="goodies.html#smartquotes">SMARTQUOTES</a>
The following example demonstrates:
<br/>
<span class="pre-in-pp">
  .LEFT_HANG \[lq] 1p
  "\*[FWD 1p]This line will have its opening double-quote
  plus one point of space hung outside the left margin."
</span>
</p>

<p style="margin-top: -1em">
Note that what follows LEFT_HANG must be an input line and therefore
it cannot be used to left-hang a
<a href="docelement.html#heading">HEADING</a>
character.
</p>

<div class="box-tip">
<p class="tip">
<span class="important">Important:</span>
Versions of mom lower than 2.5_a that included LEFT_HANG required
that the character and its gutter be entered as a single,
concatenated argument, using horizontal motions to establish the
gutter
(e.g.
<a href="inlines.html#inline-horizontal-mom">FWD</a>,
<a href="inlines.html#inline-horizontal-mom">BCK</a>).
Documents created with versions prior to 2.5_a may have to be
updated.
</p>
</div>

<h4 class="docs">Right hung characters</h4>

<p>
The <kbd>\*[HANG&nbsp;c]</kbd> inline escape hangs its argument outside
the right margin of justified or quad right copy.  The argument may
be a single character, or a single character preceded by a
horizontal motion, effectively establishing a gutter between the
right margin and the hung character:
<br/>
<span class="pre-in-pp" style="margin-bottom: .25em">
  This line will have its closing period hung outside
  the right margin with a one point gutter\*[HANG \*[FWD 1p].]
</span>
If the hung character is a right double-quote, <kbd>"\[rq]"</kbd>
must be used as the argument (that is, the <kbd>\[rq]</kbd>
character surrounded by double-quotes).  The double-quotes are
required for all special characters of the form
<kbd style="whitespace: nowrap">\[name]</kbd>.
Horizontal motion, if any, must fall inside the double-quotes:
<br/>
<span class="pre-in-pp">
   ...and they all lived happily ever after.\*[HANG "\*[FWD 1p]\[rq]"]
</span>
</p>

<p>
If the hung character is a hyphen,
<kbd style="whitespace: nowrap"><span class="nobr">\*[HANG&nbsp;-]</span></kbd>
must come at the end of an
<a href="definitions.html#inputline">input line</a>.
This restriction does not apply to other characters, which may come
anywhere in an input line provided that, on output, the line breaks
at the point you introduced the hung character.
</p>

<p>
For the exceptionally fussy, <kbd>\*[HANG]</kbd> may also be used to
improve visual centring; when text is centred, <kbd
style="whitespace: nowrap">\*[HANG&nbsp;c]</kbd>
hangs the character to the right of the centred line instead of the
margin.
</p>

<div class="rule-long"><hr/></div>

<!-- Navigation links -->
<table style="width: 100%; margin-top: 12px;">
<tr>
  <td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td>
  <td style="width: 33%; text-align: center;"><a href="#top">Top</a></td>
  <td style="width: 33%; text-align: right;"><a href="inlines.html#top">Next: Inline escapes</a></td>
</tr>
</table>

</div>

<div class="bottom-spacer"><br/></div>

</body>
</html>