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
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
|
'\" t
.TH roff @MAN7EXT@ "@MDATE@" "groff @VERSION@"
.SH Name
roff \- concepts and history of
.I roff
typesetting
.
.
.\" TODO: Synchronize this material with introductory section(s) of our
.\" Texinfo manual, and then keep it that way.
.
.\" ====================================================================
.\" Legal Terms
.\" ====================================================================
.\"
.\" Copyright (C) 2000-2023 Free Software Foundation, Inc.
.\"
.\" This file is part of groff, the GNU roff type-setting system.
.\"
.\" 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.
.
.
.\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
.do nr *groff_roff_7_man_C \n[.cp]
.cp 0
.
.\" Define fallback for groff 1.23's MR macro if the system lacks it.
.nr do-fallback 0
.if !\n(.f .nr do-fallback 1 \" mandoc
.if \n(.g .if !d MR .nr do-fallback 1 \" older groff
.if !\n(.g .nr do-fallback 1 \" non-groff *roff
.if \n[do-fallback] \{\
. de MR
. ie \\n(.$=1 \
. I \%\\$1
. el \
. IR \%\\$1 (\\$2)\\$3
. .
.\}
.rr do-fallback
.
.
.\" ====================================================================
.SH Description
.\" ====================================================================
.
The term
.I roff
denotes a family of document formatting systems known by names like
.IR troff ,
.IR nroff ,
and
.IR ditroff .
.
A
.I roff
system consists of an interpreter for an extensible text formatting
language and a set of programs for preparing output for various devices
and file formats.
.
Unix-like operating systems often distribute a
.I roff
system.
.
The manual pages on Unix systems
(\[lq]man\~pages\[rq])
and bestselling books on software engineering,
including Brian Kernighan and Dennis Ritchie's
.I The C Programming Language
and W.\& Richard Stevens's
.I Advanced Programming in the Unix Environment
have been written using
.I roff
systems.
.
GNU
.IR roff \[em] groff \[em]is
arguably the most widespread
.I roff
implementation.
.
.
.P
Below we present
typographical concepts that form the background of all
.I roff
implementations,
narrate the development history of some
.I roff
systems,
detail the command pipeline managed by
.MR groff @MAN1EXT@ ,
survey the formatting language,
suggest tips for editing
.I roff
input,
and recommend further reading materials.
.
.
.\" ====================================================================
.SH Concepts
.\" ====================================================================
.
.\" BEGIN Keep roughly parallel with groff.texi nodes "Text" through
.\" "Tab Stops".
.I roff
input files contain text interspersed with instructions to control the
formatter.
.
Even in the absence of such instructions,
a
.I roff
formatter still processes its input in several ways,
by filling,
hyphenating,
breaking,
and adjusting it,
and supplementing it with inter-sentence space.
.
These processes are basic to typesetting,
and can be controlled at the input document's discretion.
.
.
.P
When a device-independent
.I roff
formatter starts up,
it obtains information about the device for which it is preparing
output from the latter's description file
(see
.MR groff_font @MAN5EXT@ ).
.
An essential property is the length of the output line,
such as \[lq]6.5 inches\[rq].
.
.
.P
The formatter interprets plain text files employing the Unix line-ending
convention.
.
It reads input a character at a time,
collecting words as it goes,
and fits as many words together on an output line as it can\[em]this
is known as
.I filling.
.
To a
.I roff
system,
a
.I word
is any sequence of one or more characters that aren't spaces or
newlines.
.
The exceptions separate words.
.
.
.P
A
.I roff
formatter attempts to detect boundaries between sentences,
and supplies additional inter-sentence space between them.
.
It flags certain characters
(normally
.RB \[lq] !\& \[rq],
.RB \[lq] ?\& \[rq],
and
.RB \[lq] .\& \[rq])
as potentially ending a sentence.
.
When the formatter encounters one of these
.I end-of-sentence characters
at the end of an input line,
or one of them is followed by two (unescaped) spaces on the same input
line,
it appends an inter-word space
followed by an inter-sentence space in the output.
.
The dummy character escape sequence
.B \[rs]&
can be used after an end-of-sentence character to defeat end-of-sentence
detection on a per-instance basis.
.
Normally,
the occurrence of a visible non-end-of-sentence character
(as opposed to a space or tab)
immediately after an end-of-sentence
character cancels detection of the end of a sentence.
.
However,
several characters are treated
.I transparently
after the occurrence of an end-of-sentence character.
.
That is,
a
.I roff
does not cancel end-of-sentence detection when it processes them.
.
This is because such characters are often used as footnote markers or to
close quotations and parentheticals.
.
The default set is
.BR \[dq] ,
.BR \[aq] ,
.BR ) ,
.BR ] ,
.BR * ,
.BR \[rs][dg] ,
.BR \[rs][dd] ,
.BR \[rs][rq] ,
and
.BR \[rs][cq] .
.
The last four are examples of
.I special characters,
escape sequences whose purpose is to obtain glyphs that are not easily
typed at the keyboard,
or which have special meaning to the formatter
(like
.BR \[rs] ).
.\" slack wording: itself).
.
.
.P
When an output line is nearly full,
it is uncommon for the next word collected from the input to exactly
fill it\[em]typically,
there is room left over only for part of the next word.
.
The process of splitting a word so that it appears partially on one line
(with a hyphen to indicate to the reader that the word has been broken)
with its remainder on the next is
.I hyphenation.
.
Hyphenation points can be manually specified;
.I groff
also uses a hyphenation algorithm and language-specific pattern files to
decide which words can be hyphenated and where.
.
Hyphenation does not always occur even when the hyphenation rules for a
word allow it;
it can be disabled,
and when not disabled there are several parameters that can prevent it
in certain circumstances.
.
.
.P
Once an output line is full,
the next word
(or remainder of a hyphenated one)
is placed on a different output line;
this is called a
.I break.
.
In this document and in
.I roff
discussions generally,
a \[lq]break\[rq] if not further qualified always refers to the
termination of an output line.
.
When the formatter is filling text,
it introduces breaks automatically to keep output lines from exceeding
the configured line length.
.
After an automatic break,
a
.I roff
formatter
.I adjusts
the line if applicable
(see below),
and then resumes collecting and filling text on the next output line.
.
.
.br
.ne 2v
.P
Sometimes,
a line cannot be broken automatically.
.
This usually does not happen with natural language text unless the
output line length has been manipulated to be extremely short,
but it can with specialized text like program source code.
.
.I groff
provides a means of telling the formatter where the line may be broken
without hyphens.
.
This is done with the non-printing break point escape sequence
.BR \[rs]: .
.
.
.P
.\" What if the document author wants to stop filling lines temporarily,
.\" for instance to start a new paragraph? There are several solutions.
There are several ways to cause a break at a predictable location.
.
A blank input line not only causes a break,
but by default it also outputs a one-line vertical space
(effectively a blank output line).
.
Macro packages may discourage or disable this \[lq]blank line
method\[rq] of paragraphing in favor of their own macros.
.
A line that begins with one or more spaces causes a break.
.
The spaces are output at the beginning of the next line without being
.I adjusted
(see below).
.
Again,
macro packages may provide other methods of producing indented
paragraphs.
.
Trailing spaces on
.I text lines
(see below)
are discarded.
.
The end of input causes a break.
.
.
.P
After the formatter performs an automatic break,
it may then
.I adjust
the line,
widening inter-word spaces until the text reaches the right margin.
.
Extra spaces between words are preserved.
.
Leading and trailing spaces are handled as noted above.
.
Text can be aligned to the left or right margin only,
or centered,
using
.I requests.
.
.
.P
A
.I roff
formatter translates horizontal tab characters,
also called simply \[lq]tabs\[rq],
in the input into movements to the next tab stop.
.
These tab stops are by default located every half inch measured from the
current position on the input line.
.
With them,
simple tables can be made.
.
However,
this method can be deceptive,
as the appearance
(and width)
of the text in an editor and the results from the formatter can vary
greatly,
particularly when proportional typefaces are used.
.
A tab character does not cause a break and therefore does not interrupt
filling.
.
The formatter provides facilities for sophisticated table composition;
there are many details to track
when using the \[lq]tab\[rq] and \[lq]field\[rq] low-level features,
so most users turn to the
.MR @g@tbl @MAN1EXT@
preprocessor to lay out tables.
.\" END Keep roughly parallel with groff.texi nodes "Text" through "Tab
.\" Stops".
.
.
.\" ====================================================================
.SS "Requests and macros"
.\" ====================================================================
.
.\" BEGIN Keep roughly parallel with groff.texi node "Requests and
.\" Macros".
.\" We have now encountered almost all of the syntax there is in the
.\" @code{roff} language, with an exception already noted in passing.
A
.I request
is an instruction to the formatter that occurs after a
.I control character,
which is recognized at the beginning of an input line.
.
The regular control character is a dot
.RB \[lq] .\& \[rq].
.
Its counterpart,
the
.I no-break control character,
a neutral apostrophe
.RB \[lq] \|\[aq]\| \[rq],
suppresses the break
.\" slack wording: that is
implied by some requests.
.
These characters were chosen because it is uncommon for lines of text in
natural languages to begin with them.
.
If you require a formatted period or apostrophe
(closing single quotation mark)
where
.\" GNU @code{troff}
the formatter is expecting a control character,
prefix the dot or neutral apostrophe with the dummy character escape
sequence,
.RB \[lq] \[rs]& \[rq].
.
.
.P
An input line beginning with a control character is called a
.I control line.
.
Every line of input that is not a control line is a
.I text line.
.
.
.P
Requests often take
.I arguments,
words
(separated from the request name and each other by spaces)
that specify details of the action
.\" GNU @code{troff}
the formatter is expected to perform.
.
If a request is meaningless without arguments,
it is typically ignored.
.
.\" TODO: roff(7): We haven't introduced escape sequences yet.
.\" GNU @code{troff}'s requests and escape sequences comprise the
.\" control language of the formatter.
.
Of key importance are the requests that define macros.
.
Macros are invoked like requests,
enabling the request repertoire to be extended or overridden.
.\" @footnote{Argument handling in macros is more flexible but also more
.\" complex. @xref{Calling Macros}.}
.
.
.P
A
.I macro
can be thought of as an abbreviation you can define for a
collection of control and text lines.
.
When the macro is
.I called
by giving its name after a control character,
it is replaced with what it stands for.
.
The process of textual replacement is known as
.I interpolation.
.\" @footnote{Some escape sequences undergo interpolation as well.}
Interpolations are handled as soon as they are recognized,
and once performed,
a
.I roff
formatter scans the replacement for further requests,
macro calls,
and escape sequences.
.
.
.P
In
.I roff
systems,
the
.RB \[lq] de \[rq]
request defines a macro.
.\" @footnote{GNU @code{troff} offers additional ones. @xref{Writing
.\" Macros}.}
.\" END Keep roughly parallel with groff.texi node "Requests and
.\" Macros".
.
.
.\" ====================================================================
.SS "Page geometry"
.\" ====================================================================
.
.\" BEGIN Keep parallel with groff.texi node "Page Geometry".
.I roff
systems format text under certain assumptions about the size of the
output medium,
or page.
.
For the formatter to correctly break a line it is filling,
it must know the line length,
which it derives from the page width.
.\" (@pxref{Line Layout}).
.
For it to decide whether to write an output line to the current page or
wait until the next one,
it must know the page length.
.\" (@pxref{Page Layout}).
.
.
A device's
.I resolution
converts practical units like inches or centimeters to
.I basic units,
a convenient length measure for the output device or file format.
.
The formatter and output driver use basic units to reckon page
measurements.
.
The device description file defines its resolution and page dimensions
(see
.MR groff_font @MAN5EXT@ ).
.\" (@pxref{DESC File Format}).
.
.
.P
A
.I page
is a two-dimensional structure upon which a
.I roff
system imposes a rectangular coordinate system with its upper left
corner as the origin.
.
Coordinate values are in basic units and increase down and to the right.
Useful ones are therefore always positive and within numeric ranges
corresponding to the page boundaries.
.
.
.P
While the formatter
(and,
later,
output driver)
is processing a page,
it keeps track of its
.I drawing position,
which is the location at which the next glyph will be written,
from which the next motion will be measured,
or where a geometric object will commence rendering.
.
Notionally,
glyphs are drawn from the text baseline upward and to the right.
.RI ( groff
does not yet support right-to-left scripts.)
.
The
.I text baseline
is a
(usually invisible)
line upon which the glyphs of a typeface are aligned.
.
A glyph therefore \[lq]starts\[rq] at its bottom-left corner.
.
If drawn at the origin,
a typical letter glyph would lie partially or wholly off the page,
depending on whether,
like \[lq]g\[rq],
it features a descender below the baseline.
.
.
.P
Such a situation is nearly always undesirable.
.
It is furthermore conventional not to write or draw at the extreme edges
of the page.
.
Therefore the initial drawing position of a
.I roff
formatter is not at the origin,
but below and to the right of it.
.
This rightward shift
from the left edge is known as the
.I page offset.
.
.RI ( groff 's
terminal output devices have page offsets of zero.)
.
The downward shift leaves room for a text output line.
.
.
.P
Text is arranged on a one-dimensional lattice of text baselines from
the top to the bottom of the page.
.
.I Vertical spacing
is the distance between adjacent text baselines.
.
Typographic tradition sets this quantity to 120% of the type size.
.
The initial vertical drawing position is one unit of vertical spacing
below the page top.
.
Typographers term this unit a
.I vee.
.
.
.P
Vertical spacing has an impact on page-breaking decisions.
.
Generally,
when a break occurs,
the formatter moves the drawing position to the next text baseline
automatically.
.
If the formatter were already writing to the last line that would fit on
the page,
advancing by one vee would place the next text baseline off the page.
.
Rather than let that happen,
.I roff
formatters instruct the output driver to eject the page,
start a new one,
and again set the drawing position to one vee below the page top;
this is a
.I page break.
.
.
.P
When the last line of input text corresponds to the last output line
that fits on the page,
the break caused by the end of input will also break the page,
producing a useless blank one.
.
Macro packages keep users from having
to confront this difficulty by setting \[lq]traps\[rq];
.\" (@pxref{Traps});
moreover,
all but the simplest page layouts tend to have headers and footers,
or at least bear vertical margins larger than one vee.
.\" END Keep parallel with groff.texi node "Page Geometry".
.
.
.\" ====================================================================
.SS "Other language elements"
.\" ====================================================================
.
.I Escape sequences
start with the
.I escape character,
a backslash
.BR \[rs] ,
and are followed by at least one additional character.
.
They can appear anywhere in the input.
.
.
.P
With requests,
the escape and control characters can be changed;
further,
escape sequence recognition can be turned off and back on.
.
.
.P
.I Strings
store character sequences.
.
In
.IR groff ,
they can be parameterized as macros can.
.
.
.P
.I Registers
store numerical values,
including measurements.
.
The latter are generally in basic units;
.I scaling units
can be appended to numeric expressions to clarify their meaning when
stored or interpolated.
.
Some read-only predefined registers interpolate text.
.
.
.P
.I Fonts
are identified either by a name or by a mounting position
(a non-negative number).
.
Four styles are available on all devices.
.
.B R
is \[lq]roman\[rq]:
normal,
upright text.
.
.B B
is
.BR bold ,
an upright typeface with a heavier weight.
.
.B I
is
.IR italic ,
a face that is oblique on typesetter output devices and usually
underlined instead on terminal devices.
.
.B BI
is \f[BI]bold-italic\f[]\/, \" indulging a bit of man(7) evil here
combining both of the foregoing style variations.
.
Typesetting devices group these four styles into
.I families
of text fonts;
they also typically offer one or more
.I special
fonts that provide unstyled glyphs;
see
.MR groff_char @MAN7EXT@ .
.
.
.P
.I groff
supports named
.I colors
for glyph rendering and drawing of geometric objects.
.
Stroke and fill colors are distinct;
the stroke color is used for glyphs.
.
.
.P
.I Glyphs
are visual representation forms of
.I characters.
.
In
.I groff,
the distinction between those two elements is not always obvious
(and a full discussion is beyond our scope).
.
In brief,
\[lq]A\[rq] is a character when we consider it in the abstract:
to make it a glyph,
we must select a typeface with which to render it,
and determine its type size and color.
.
The formatting process turns input characters into output glyphs.
.
A few characters commonly seen on keyboards are treated
specially by the
.I roff
language and may not look correct in output if used unthinkingly;
they are
the (double) quotation mark
.RB ( \|\[dq]\| ),
the neutral apostrophe
.RB ( \|\[aq]\| ),
the minus sign
.RB ( \- ),
the backslash
.RB ( \|\[rs]\| ),
the caret or circumflex accent
.RB ( \[ha] ),
the grave accent
.RB ( \|\[ga]\| ),
and the tilde
.RB ( \[ti] ).
.
All of these and more can be produced with
.I special character
escape sequences;
see
.MR groff_char @MAN7EXT@ .
.
.
.P
.I groff
offers
.IR streams ,
identifiers for writable files,
but for security reasons this feature is disabled by default.
.
.
.\" BEGIN Keep roughly parallel with first paragraphs of groff.texi node
.\" "Deferring Output".
.P
A further few language elements arise as page layouts become more
sophisticated and demanding.
.
.I Environments
collect formatting parameters like line length and typeface.
.
A
.I diversion
stores formatted output for later use.
.
A
.I trap
is a condition on the input or output,
tested automatically by the formatter,
that is associated with a macro,
calling it when that condition is fulfilled.
.
.
.P
Footnote support often exercises all three of the foregoing features.
.
A simple implementation might work as follows.
.
A pair of macros is defined:
one starts a footnote and the other ends it.
.
The author calls the first macro where a footnote marker is desired.
.
The macro establishes a diversion so that the footnote text is collected
at the place in the body text where its corresponding marker appears.
.
An environment is created for the footnote so that it is set at a
smaller typeface.
.
The footnote text is formatted in the diversion using that environment,
but it does not yet appear in the output.
.
The document author calls the footnote end macro,
which returns to the previous environment and ends the diversion.
.
Later,
after much more body text in the document,
a trap,
set a small distance above the page bottom,
is sprung.
.
The macro called by the trap draws a line across the page and emits the
stored diversion.
.
Thus,
the footnote is rendered.
.\" END Keep roughly parallel with first paragraphs of groff.texi node
.\" "Deferring Output".
.
.
.\" ====================================================================
.SH History
.\" ====================================================================
.
Computer-driven document formatting dates back to the 1960s.
.\" John Labovitz points out that Peter Samson's TJ-2 dates to 1963,
.\" but since this is a *roff man page, we do not begin our story there.
.\" https://johnlabovitz.com/publications/\
.\" The-electric-typesetter--The-origins-of-computing-in-typography.pdf
.
The
.I roff
system is intimately connected with Unix,
but its origins lie with the earlier operating systems CTSS,
GECOS,
and Multics.
.
.
.\" ====================================================================
.SS "The predecessor\[em]\f[I]RUNOFF\f[]"
.\" ====================================================================
.
.IR roff 's
ancestor
.I RUNOFF
was written in the MAD language by Jerry Saltzer
to prepare his Ph.D.\& thesis on the Compatible Time Sharing System
(CTSS),
a project of the Massachusetts Institute of Technology (MIT).
.
This program is referred to in full capitals,
both to distinguish it from its many descendants,
and because bits were expensive in those days;
five- and six-bit character encodings were still in widespread usage,
and mixed-case alphabetics in file names seen as a luxury.
.
.I RUNOFF
introduced a syntax of inlining formatting directives amid document
text,
by beginning a line with a period
(an unlikely occurrence in human-readable material)
followed by a \[lq]control word\[rq].
.
Control words with obvious meaning like \[lq].line length
.IR n \[rq]
were supported as well as an abbreviation system;
the latter came to overwhelm the former in popular usage and later
derivatives of the program.
.
A sample of control words from a
.UR http://\:web\:.mit\:.edu/\:Saltzer/\:www/\:publications/\:ctss/\:AH\
\:.9\:.01\:.html
.I RUNOFF
manual of December 1966
.UE
was documented as follows
(with the parameter notation slightly altered).
.
The abbreviations will be familiar to
.I roff
veterans.
.
.
.P
.ne 10v
.TS
center;
r l
rB l.
Abbreviation Control word
\&.ad .adjust
\&.bp .begin page
\&.br .break
\&.ce .center
\&.in .indent \f[I]n\f[]
\&.ll .line length \f[I]n\f[]
\&.nf .nofill
\&.pl .paper length \f[I]n\f[]
\&.sp .space [\f[I]n\f[]]
.TE
.
.
.P
In 1965,
MIT's Project MAC teamed with Bell Telephone Laboratories and General
Electric (GE) to inaugurate the
.UR http://\:www\:.multicians\:.org
Multics
.UE
project.
.
After a few years,
Bell Labs discontinued its participation in Multics,
famously prompting the development of Unix.
.
Meanwhile,
Saltzer's
.I RUNOFF
proved influential,
seeing many ports and derivations elsewhere.
.
.
.\" "Morris did one port and called it roff. I did the BCPL one, adding
.\" registers, but not macros. Molly Wagner contributed a hyphenation
.\" algorithm. Ken and/or Dennis redid roff in PDP-11 assembler. Joe
.\" started afresh for the grander nroff, including macros. Then Joe
.\" bought a phototypesetter ..."
.\" -- https://minnie.tuhs.org/pipermail/tuhs/2018-November/017052.html
.P
In 1969,
Doug McIlroy wrote one such reimplementation,
adding extensions,
in the BCPL language for a GE 645 running GECOS at the Bell Labs
location in Murray Hill,
New Jersey.
.
In its manual,
the control commands were termed \[lq]requests\[rq],
their two-letter names were canonical,
and the control character was configurable with a
.B .cc
request.
.
Other familiar requests emerged at this time;
no-adjust
.RB ( .na ),
need
.RB ( .ne ),
page offset
.RB ( .po ),
tab configuration
.RB ( .ta ,
though it worked differently),
temporary indent
.RB ( .ti ),
character translation
.RB ( .tr ),
and automatic underlining
.RB ( .ul ;
on
.I RUNOFF
you had to backspace and underscore in the input yourself).
.B .fi
to enable filling of output lines got the name it retains to this day.
.
McIlroy's program also featured a heuristic system for automatically
placing hyphenation points,
designed and implemented by Molly Wagner.
.
It furthermore introduced numeric variables,
termed registers.
.
By 1971,
this program had been ported to Multics and was known as
.IR roff ,
a name McIlroy attributes to Bob Morris,
to distinguish it from CTSS
.IR RUNOFF .
.
.\" GBR can't find a source for this claim (of Bernd's).
.\"Multics
.\".I runoff
.\"added features such as the ability to do two-pass formatting;
.\"it became the main system for Multics documentation and text
.\"processing.
.
.
.\" ====================================================================
.SS "Unix and \f[I]roff\f[]"
.\" ====================================================================
.
McIlroy's
.I roff
was one of the first Unix programs.
.
In Ritchie's term,
it was \[lq]transliterated\[rq] from BCPL to DEC PDP-7 assembly language
.\" see "The Evolution of the Unix Time-Sharing System", Ritchie, 1984
for the fledgling Unix operating system.
.
Automatic hyphenation was managed with
.B .hc
and
.B .hy
requests,
line spacing control was generalized with the
.B .ls
request,
and what later
.IR roff s
would call diversions were available via \[lq]footnote\[rq] requests.
.\" The foregoing features may have been in McIlroy's Multics roff, but
.\" he no longer has documentation for that--only the GECOS version.
.\" GBR's guess is that they were, if we take Ritchie's choice of the
.\" term "transliterated" seriously. GBR further speculates that there
.\" is no reason to suppose that McIlroy's roff was stagnant from
.\" 1969-1971, whereas we have no record of any significant
.\" post-transliteration development of Unix roff. Its request list did
.\" not appear until the 3rd edition manual, and did not change
.\" thereafter. In 7th edition, roff was characterized as "utterly
.\" frozen".
.
This
.I roff
indirectly funded operating systems research at Murray Hill;
AT&T prepared patent applications to the U.S.\& government with it.
.
This arrangement enabled the group to acquire a PDP-11;
.I roff
promptly proved equal to the task of formatting the manual for what
would become known as \[lq]First Edition Unix\[rq],
dated November 1971.
.
.
.P
Output from all of the foregoing programs was limited to line printers
and paper terminals such as the IBM 2471
(based on the Selectric line of typewriters)
and the Teletype Corporation Model 37.
.
Proportionally spaced type was unavailable.
.
.
.\" ====================================================================
.SS "New \f[I]roff\f[] and Typesetter \f[I]roff\f[]"
.\" ====================================================================
.
The first years of Unix were spent in rapid evolution.
.
The practicalities of preparing standardized documents like patent
applications
(and Unix manual pages),
combined with McIlroy's enthusiasm for macro languages,
perhaps created an irresistible pressure to make
.I roff
extensible.
.
Joe Ossanna's
.IR nroff ,
literally a \[lq]new roff\[rq],
was the outlet for this pressure.
.
.\" nroff is listed in the table of contents of the Version 2 manual,
.\" but no man page is present.
By the time of Unix Version\~3
(February 1973)\[em]and still in PDP-11 assembly language\[em]it sported
a swath of features now considered essential to
.I roff
systems:
.
definition of macros
.RB ( .de ),
diversion of text thither
.RB ( .di ),
and removal thereof
.RB ( .rm );
.
trap planting
.RB ( .wh ;
\[lq]when\[rq])
and relocation
.RB ( .ch ;
\[lq]change\[rq]);
.
conditional processing
.RB ( .if );
.
and environments
.RB ( .ev ).
.
Incremental improvements included
.
assignment of the next page number
.RB ( .pn );
.
no-space mode
.RB ( .ns )
and restoration of vertical spacing
.RB ( .rs );
.
the saving
.RB ( .sv )
and output
.RB ( .os )
of vertical space;
.
specification of replacement characters for tabs
.RB ( .tc )
and leaders
.RB ( .lc );
.
configuration of the no-break control character
.RB ( .c2 );
.
shorthand to disable automatic hyphenation
.RB ( .nh );
.
a condensation of what were formerly six different requests for
configuration of page \[lq]titles\[rq]
(headers and footers)
into one
.RB ( .tl )
with a length controlled separately from the line length
.RB ( .lt );
.
automatic line numbering
.RB ( .nm );
.
interactive input
.RB ( .rd ),
which necessitated buffer-flushing
.RB ( .fl ),
and was made convenient with early program cessation
.RB ( .ex );
.
source file inclusion in its modern form
.RB ( .so ;
though
.I RUNOFF
had an \[lq].append\[rq] control word for a similar purpose)
and early advance to the next file argument
.RB ( .nx );
.
ignorable content
.RB ( .ig );
.
and programmable abort
.RB ( .ab ).
.
.
.P
Third Edition Unix also brought the
.MR pipe 2
system call,
the explosive growth of a componentized system based around it,
and a \[lq]filter model\[rq] that remains perceptible today.
.
Equally importantly,
the Bell Labs site in Murray Hill acquired a Graphic Systems C/A/T
phototypesetter,
and with it came the necessity of expanding the capabilities of a
.I roff
system to cope with a variety of proportionally spaced typefaces at
multiple sizes.
.
Ossanna wrote a parallel implementation of
.I nroff
for the C/A/T,
dubbing it
.I troff
(for \[lq]typesetter roff\[rq]).
.
Unfortunately,
surviving documentation does not illustrate what requests were
implemented at this time for C/A/T support;
the
.MR troff 1 \" AT&T
man page in Fourth Edition Unix
(November 1973)
does not feature a request list, \" nor does Unix V6 troff(1) (1975)
unlike
.MR nroff 1 . \" AT&T
.
Apart from typesetter-driven features,
Unix Version\~4
.IR roff s
added string definitions
.RB ( .ds );
made the escape character configurable
.RB ( .ec );
and enabled the user to write diagnostics to the standard error stream
.RB ( .tm ).
.
Around 1974,
empowered with multiple type sizes,
italics,
and a symbol font specially commissioned by Bell Labs from
Graphic Systems,
Kernighan and Lorinda Cherry implemented
.I eqn \" AT&T
for typesetting mathematics.
.
.
In the same year,
for Fifth Edition Unix,
Ossanna combined and reimplemented the two
.IR roff s
in C,
using that language's preprocessor to generate both from a single source
tree.
.
.
.P
Ossanna documented the syntax of the input language to the
.I nroff
and
.I troff
programs in the \[lq]Troff User's Manual\[rq],
first published in 1976,
with further revisions as late as 1992 by Kernighan.
.
(The original version was entitled
\[lq]Nroff/Troff User's Manual\[rq],
which may partially explain why
.I roff
practitioners have tended to refer to it by its AT&T document
identifier,
\[lq]CSTR #54\[rq].)
.
Its final revision serves as the
.I de facto
specification of AT&T
.IR troff , \" AT&T
and all subsequent implementors of
.I roff
systems have done so in its shadow.
.
.
.P
A small and simple set of
.I roff
macros was first used for the manual pages of Unix Version\~4 and
persisted for two further releases,
but the first macro package to be formally described and installed was
.I ms
by Michael Lesk in Version\~6.
.
He also wrote a manual,
\[lq]Typing Documents on the Unix System\[rq],
describing
.I ms
and basic
.IR nroff / troff
usage,
updating it as the package accrued features.
.
Sixth Edition additionally saw the debut of the
.I tbl \" AT&T
preprocessor for formatting tables,
also by Lesk.
.
.
.P
For Unix Version\~7
(January 1979),
McIlroy designed,
implemented,
and documented the
.I man
macro package,
introducing most of the macros described in
.MR groff_man 7
today,
and edited volume 1 of the Version 7 manual using it.
.
Documents composed using
.I ms
featured in volume 2,
edited by Kernighan.
.
.
.\" Thanks to Clem Cole for the following account.
.\" https://minnie.tuhs.org/pipermail/tuhs/2022-January/025143.html
.P
Meanwhile,
.I troff
proved popular even at Unix sites that lacked a C/A/T device.
.
Tom Ferrin of the University of California at San Francisco combined it
with Allen Hershey's popular vector fonts to produce
.IR vtroff ,
which translated
.IR troff 's
output to the command language used by Versatec and Benson-Varian
plotters.
.
.
.P
Ossanna had passed away unexpectedly in 1977,
and after the release of Version 7,
with the C/A/T typesetter becoming supplanted by alternative devices
such as the Mergenthaler Linotron 202,
Kernighan undertook a revision and rewrite of
.I troff
to generalize its design.
.
To implement this revised architecture,
he developed the font and device description file formats and the
page description language that remain in use today.
.
He described these novelties in the article
\[lq]A Typesetter-independent TROFF\[rq],
last revised in 1982,
and like the
.I troff
manual itself,
it is widely known by a shorthand,
\[lq]CSTR #97\[rq].
.\" Further entertaining reading can be found at:
.\" <https://www.cs.princeton.edu/~bwk/202/summer.reconstructed.pdf>.
.
.
.P
Kernighan's innovations prepared
.I troff
well for the introduction of the Adobe PostScript language in 1982 and a
vibrant market in laser printers with built-in interpreters for it.
.
An output driver for PostScript,
.IR dpost ,
was swiftly developed.
.
However,
AT&T's software licensing practices kept
Ossanna's
.IR troff ,
with its tight coupling to the C/A/T's capabilities,
in parallel distribution with device-independent
.I troff
throughout the 1980s.
.
Today,
however,
all actively maintained
.IR troff s
follow Kernighan's device-independent design.
.
.
.\" ====================================================================
.SS "\f[I]groff\f[]\[em]a free \f[I]roff\f[] from GNU"
.\" ====================================================================
.
The most important free
.I roff
project historically has been
.IR groff ,
the GNU implementation of
.IR troff ,
developed by James Clark starting in 1989 and distributed under
.UR http://\:www\:.gnu\:.org/\:copyleft
copyleft
.UE
licenses,
ensuring to all the availability of source code and the freedom to
modify and redistribute it,
properties unprecedented in
.I roff
systems to that point.
.
.I groff
rapidly attracted contributors,
and has served as a replacement for almost all applications of AT&T
.I troff
(exceptions include
.IR mv ,
a macro package for preparation of viewgraphs and slides,
and the
.I ideal
preprocessor,
which produces diagrams from mathematical constraints).
.
Beyond that,
it has added numerous features;
see
.MR groff_diff @MAN7EXT@ .
.
Since its inception and for at least the following three decades,
it has been used by practically all GNU/Linux and BSD operating systems.
.
.
.P
.I groff
continues to be developed,
is available for almost all operating systems in common use
(along with several obscure ones),
and is free.
.
These factors make
.I groff
the
.I de facto
.I roff
standard today.
.
.
.\" ====================================================================
.SS "Other free \f[I]roff\f[]s"
.\" ====================================================================
.
In 2007, \" TODO: verify
Caldera/SCO and Sun Microsystems,
having acquired rights to AT&T Documenter's Workbench (DWB)
.I troff
(a descendant of the Bell Labs code),
released it under a free but GPL-incompatible license.
.
.UR https://\:github\:.com/\:n\-t\-roff/\:DWB3.3
This implementation
.UE
was made portable to modern POSIX systems,
and adopted and enhanced first by Gunnar Ritter and then Carsten Kunze
to produce
.UR https://github.com/n-t-roff/heirloom-doctools
Heirloom Doctools
.I troff
.UE .
.
.
.P
.\" https://lists.gnu.org/archive/html/groff/2013-07/msg00001.html
In July 2013,
Ali Gholami Rudi announced
.UR https://\:github\:.com/\:aligrudi/\:neatroff
.I neatroff
.UE ,
a permissively licensed new implementation.
.
.
.P
Another descendant of DWB
.I troff \" DWB
is part of
.UR https://\:9fans\:.github\:.io/\:plan9port/
Plan\~9 from User Space
.UE .
.
Since 2021,
this
.I troff \" Plan 9 from User Space
has been available under permissive terms.
.
.
.\" ====================================================================
.SH "Using \f[I]roff\f[]"
.\" ====================================================================
.
When you read a man page,
often a
.I roff
is the program rendering it.
.
Some
.I roff
implementations provide wrapper programs that make it easy to use the
.I roff
system from the shell's command line.
.
These can be specific to a macro package,
like
.MR mmroff @MAN1EXT@ ,
or more general.
.
.MR groff @MAN1EXT@
provides command-line options sparing the user from constructing the
long,
order-dependent pipelines familiar to AT&T
.I troff
users.
.
Further,
a heuristic program,
.MR grog @MAN1EXT@ ,
is available to infer from a document's contents which
.I groff
arguments should be used to process it.
.
.
.\" ====================================================================
.SS "The \f[I]roff\f[] pipeline"
.\" ====================================================================
.
A typical
.I roff
document is prepared by running one or more processors in series,
followed by a a formatter program and then an output driver
(or \[lq]device postprocessor\[rq]).
.
Commonly,
these programs are structured into a pipeline;
that is,
each is run in sequence such that the output of one is
taken as the input
to the next,
without passing through secondary storage.
.
(On non-Unix systems,
pipelines may have to be simulated with temporary files.)
.
.
.RS
.PP
.EX
.RI $\~ preproc1 \~\c
.BI <\~ input-file \~|\~ preproc2 \~|\~\c
.RB .\|.\|.\&\~ "| troff\~"\c
.RI [ option ]\~\c
.RB .\|.\|.\&\~ \[rs]
.BI " |\~" output-driver \" 4 leading spaces
.EE
.RE
.
.
.P
Once all preprocessors have run,
they deliver pure
.I roff
language input to the formatter,
which in turn generates a document in a page description language that
is then interpreted by a postprocessor for viewing,
printing,
or further processing.
.
.
.P
Each program interprets input in a language that is independent of the
others;
some are purely descriptive,
as with
.MR @g@tbl @MAN1EXT@
and
.I roff
output,
and some permit the definition of macros,
as with
.MR @g@eqn @MAN1EXT@
and
.I roff
input.
.
.
Most
.I roff
input files employ the macros of a document formatting package,
intermixed with instructions for one or more preprocessors,
and seasoned with escape sequences and requests from the
.I roff
language.
.
Some documents are simpler still,
since their formatting packages discourage direct use of
.I roff
requests;
man pages are a prominent example.
.
Many features of the
.I roff
language are seldom needed by users;
only authors of macro packages require a substantial command of them.
.
.
.\" ====================================================================
.SS Preprocessors
.\" ====================================================================
.
A
.I roff
preprocessor is a program that,
directly or ultimately,
generates output in the
.I roff
language.
.
Typically, \" preconv is an exception.
each preprocessor defines a language of its own that transforms its
input into that for
.I roff
or another preprocessor.
.
As an example of the latter,
.I chem \" generic
produces
.I pic \" generic
input.
.
Preprocessors must consequently be run in an appropriate order;
.MR groff @MAN1EXT@
handles this automatically for all preprocessors supplied by the GNU
.I roff
system.
.
.
.P
Portions of the document written in preprocessor languages are usually
.\" preconv is the exception again.
bracketed by tokens that look like
.I roff
macro calls.
.
.I roff
preprocessor programs transform only the regions of the document
intended for them.
.\" In preconv's case, that's the whole document.
.
When a preprocessor language is used by a document,
its corresponding program must process it before the input is seen by
the formatter,
or incorrect rendering is almost guaranteed.
.
.
.P
GNU
.I roff
provides several preprocessors,
including
.IR @g@eqn ,
.IR @g@grn ,
.IR @g@pic ,
.IR @g@tbl ,
.IR @g@refer ,
and
.IR @g@soelim .
.
See
.MR groff @MAN1EXT@
for a complete list.
.
Other preprocessors for
.I roff
systems are known.
.
.
.P
.RS
.TS
tab (@);
Li L.
dformat@depicts data structures;
grap@constructs statistical charts; and
ideal@draws diagrams using a constraint-based language.
.TE
.RE
.
.
.\" ====================================================================
.SS "Formatter programs"
.\" ====================================================================
.
A
.I roff
formatter transforms
.I roff
language input into a single file in a page description language,
described in
.MR groff_out @MAN5EXT@ ,
intended for processing by a selected device.
.
This page description language is specialized in its parameters,
but not its syntax,
for the selected device;
the format is
.RI device- independent ,
but not
.RI device- agnostic .
.
The parameters the formatter uses to arrange the document are stored in
.I device
and
.IR "font description files" ;
see
.MR groff_font @MAN5EXT@ .
.
.
.P
AT&T Unix
had two formatters\[em]\c
.I nroff
for terminals,
and
.I troff
for typesetters.
.
Often,
the name
.I troff
is used loosely to refer to both.
.
When generalizing thus,
.I groff
documentation prefers the term
.RI \[lq] roff \[rq].
.
In GNU
.IR roff ,
the formatter program is always
.MR @g@troff @MAN1EXT@ .
.
.
.\" ====================================================================
.SS "Devices and output drivers"
.\" ====================================================================
.
To a
.I roff
system,
a
.I device
is a hardware interface like a printer,
a text or graphical terminal,
or a standardized file format that unrelated software can interpret.
.
An
.I output driver
is a program that parses the output of
.I troff \" generic
and produces instructions specific to the device or file format it
supports.
.
An output driver might support multiple devices,
particularly if they are similar.
.
.
.P
The names of the devices and their driver programs are not standardized.
.
Technological fashions evolve;
the devices used for document preparation when AT&T
.I troff \" AT&T
was first written in the 1970s are no longer used in production
environments.
.
Device capabilities have tended to increase,
improving resolution and font repertoire,
and adding color output and hyperlinking.
.
Further,
to reduce file size and processing time,
AT&T
.IR troff 's \" AT&T
page description language placed low limits on the magnitudes of some
quantities it could represent.
.
Its PostScript output driver,
.MR dpost 1 ,
had a resolution of 720 units per inch;
.IR groff 's
.MR grops @MAN1EXT@
uses 72,000.
.
.
.\".P
.\"Today the operating systems provide device drivers for most
.\"printer-like hardware, so it isn't necessary to write a special
.\"hardware postprocessor for each printer.
.\" XXX? No they don't. Instead printers interpret PS or PDF directly.
.\" With a TCP/IP protocol stack and an HTTP server to accept POSTed
.\" documents for printing.
.
.
.\" ====================================================================
.SH "\f[I]roff\f[] programming"
.\" ====================================================================
.
Documents using
.I roff
are normal text files interleaved with
.I roff
formatting elements.
.
The
.I roff
language is powerful enough to support arbitrary computation and
it supplies facilities that encourage extension.
.
The primary such facility is macro definition;
with this feature,
macro packages have been developed that are tailored for particular
applications.
.
.
.\" ====================================================================
.SS "Macro packages"
.\" ====================================================================
.
Macro packages can have a much smaller vocabulary than
.I roff
itself;
this trait combined with their domain-specific nature can make them easy
to acquire and master.
.
The macro definitions of a package are typically kept in a file called
.IB name .tmac
(historically,
.BI tmac. name\/\c\" Italic correction comes before \c !
).
.
Find details on the naming and placement of macro packages in
.MR groff_tmac @MAN5EXT@ .
.
.
.P
A macro package anticipated for use in a document can be declared to
the formatter by the command-line option
.BR \-m ;
see
.MR @g@troff @MAN1EXT@ .
.
It can alternatively be specified within a document using the
.B mso
request of the
.I groff
language;
see
.MR groff @MAN7EXT@ .
.
.
.P
Well-known macro packages include
.I man
for traditional man pages and
.I mdoc
for BSD-style manual pages.
.
Macro packages for typesetting books,
articles,
and letters include
.I ms
(from \[lq]manuscript macros\[rq]),
.I me
(named by a system administrator from the first name of its creator,
Eric Allman),
.I mm
(from \[lq]memorandum macros\[rq]),
and
.IR mom ,
a punningly named package exercising many
.I groff
extensions.
.
See
.MR groff_tmac @MAN5EXT@
for more.
.
.
.\" ====================================================================
.SS "The \f[I]roff\f[] formatting language"
.\" ====================================================================
.
.\" TODO: Integrate this subsection with subsection "Other language
.\" elements".
The
.I roff
language provides requests,
escape sequences,
macro definition facilities,
string variables,
registers for storage of numbers or dimensions,
and control of execution flow.
.
The theoretically minded will observe that a
.I roff
is not a mere markup language,
but Turing-complete.
.
It has storage
(registers),
it can perform tests
(as in conditional expressions like
.RB \[lq] "(\[rs]n[i] >= 1)" \[rq]),
its
.\" Kerning between bold "i" and "f" and roman \[lq], \[rq] is tight.
.RB \[lq] \|if\| \[rq]
and related requests alter the flow of control,
and macro definition permits unbounded recursion.
.
.
.P
.I Requests
and
.I escape sequences
are instructions,
predefined parts of the language,
that perform formatting operations,
interpolate stored material,
or otherwise change the state of the parser.
.
The user can define their own request-like elements by composing
together text,
requests,
and escape sequences
.I "ad libitum."
.
.
A document writer will not (usually) note any difference in usage for
requests or macros;
both are found on control lines.
.
However,
there is a distinction;
requests take either a fixed number of arguments
(sometimes zero),
silently ignoring any excess,
or consume the rest of the input line,
whereas macros can take a variable number of arguments.
.
Since arguments are separated by spaces,
macros require a means of embedding a space in an argument;
in other words,
of quoting it.
.
This then demands a mechanism of embedding the quoting character itself,
in case
.I it
is needed literally in a macro argument.
.
AT&T
.I troff
had complex rules involving the placement and repetition of the double
quote to achieve both aims.
.
.I groff
cuts this knot by supporting a special character escape sequence for the
neutral double quote,
.\" The kerning between a roman \[lq] and a bold backslash is tight.
.RB \[lq] \|\[rs][dq] \[rq],
which never performs quoting in the typesetting language,
but is simply a glyph,
.RB \[oq] \[dq] \[cq].
.
.
.P
.I Escape sequences
start with a backslash,
.RB \[lq] \|\[rs] \[rq].
.
They can appear almost anywhere,
even in the midst of text on a line,
and implement various features,
including the insertion of special characters with
.RB \[lq] \|\[rs](\f[BI]xx\f[] \[rq]
or
.RB \[lq] \|\[rs][\f[BI]xxx\f[]] \[rq],
break suppression at input line endings with
.RB \[lq] \|\[rs]c \[rq],
font changes with
.RB \[lq] \|\[rs]f\| \[rq],
type size changes with
.RB \[lq] \|\[rs]s \[rq],
in-line comments with
.RB \[lq] \|\[rs]\[dq] \[rq],
and many others.
.
.
.P
.I Strings
store text.
.
They are populated with the
.B ds
request and interpolated using the
.B \[rs]*
escape sequence.
.
.
.P
.I Registers
store numbers and measurements.
.
A register can be set with the request
.B nr
and its value can be retrieved by the escape sequence
.BR "\[rs]n" .
.
.
.\" ====================================================================
.SH "File naming conventions"
.\" ====================================================================
.
The structure or content of a file name,
beyond its location in the file system,
is not significant to
.I roff
tools.
.
.I roff
documents employing \[lq]full-service\[rq] macro packages
(see
.MR groff_tmac @MAN5EXT@ )
tend to be named with a suffix identifying the package;
we thus see file names ending in
.IR .man ,
.IR .ms ,
.IR .me ,
.IR .mm ,
and
.IR .mom ,
for instance.
.
When installed,
man pages tend to be named with the manual's section number as the
suffix.
.
For example,
the file name for this document is
.IR roff.7 .
.
Practice for
\[lq]raw\[rq]
.I roff
documents is less consistent;
they
are sometimes seen with a
.I .t
suffix.
.
.
.\" BEGIN Keep parallel with groff.texi node "Input Conventions".
.\" ====================================================================
.SH "Input conventions"
.\" ====================================================================
.
Since
.I @g@troff
fills text automatically,
it is common practice in the
.I roff
language to avoid visual composition of text in input files:
the esthetic appeal of the formatted output is what matters.
.
Therefore,
.I roff
input should be arranged such that it is easy for authors and
maintainers to compose and develop the document,
understand the syntax of
.I roff
requests,
macro calls,
and preprocessor languages used,
and predict the behavior of the
formatter.
.
Several traditions have accrued in service of these goals.
.
.
.IP \[bu] 2n
Follow sentence endings in the input with newlines to ease their
recognition.
.\" Texinfo: (@pxref{Sentences}).
It is frequently convenient to end text lines after colons and
semicolons as well,
as these typically precede independent clauses.
.
Consider doing so after commas;
they often occur in lists that become easy to scan when itemized by
line,
or constitute supplements to the sentence that are added,
deleted,
or updated to clarify it.
.
Parenthetical and quoted phrases are also good candidates for placement
on text lines by themselves.
.
.
.IP \[bu]
Set your text editor's line length to 72 characters or fewer;
see the subsections below.
.\" Texinfo:
.\" @footnote{Emacs: @code{fill-column: 72}; Vim: @code{textwidth=72}}
.
This limit,
combined with the previous item of advice,
makes it less common that an input line will wrap in your text editor,
and thus will help you perceive excessively long constructions in your
text.
.
Recall that natural languages originate in speech,
not writing,
and that punctuation is correlated with pauses for breathing and changes
in prosody.
.
.
.IP \[bu]
Use
.B \[rs]&
after
.RB \[lq] !\& \[rq],
.RB \[lq] ?\& \[rq],
and
.RB \[lq] .\& \[rq]
if they are followed by space,
tab,
or newline characters and don't end a sentence.
.
.
.IP \[bu]
In filled text lines,
use
.B \[rs]&
before
.RB \[lq] .\& \[rq]
and
.RB \[lq] \[aq] \[rq]
if they are preceded by space,
so that reflowing the input doesn't turn them into control lines.
.
.
.IP \[bu]
Do not use spaces to perform indentation or align columns of a table.
Leading spaces are reliable when text is not being filled.
.
.
.IP \[bu]
Comment your document.
.
It is never too soon to apply comments to record information of use to
future document maintainers
(including your future self).
.\" Texinfo: We thus introduce another escape sequence, @code{\"}, which
The
.B \[rs]\[dq]
escape sequence
causes
.I @g@troff
to ignore the remainder of the input line.
.
.
.IP \[bu]
Use the empty request\[em]a control character followed immediately by a
newline\[em]to visually manage separation of material in input files.
.
Many of the
.I groff
project's own documents use an empty request between sentences,
after macro definitions,
and where a break is expected,
and two empty requests between paragraphs or other requests or macro
calls that will introduce vertical space into the document.
.
You can combine the empty request with the comment escape sequence to
include whole-line comments in your document,
and even \[lq]comment out\[rq] sections of it.
.
.
.P
.\" Texinfo: We conclude this section with an example
An example sufficiently long to illustrate most of the above suggestions
in practice follows.
.
.\" Texinfo: For the purpose of fitting the example between the margins
.\" of this manual with the font used for its typeset version,
.\" we have shortened the input line length to 56
.\" columns.
.\" Texinfo: As before,
.
An arrow \[->] indicates a tab character.
.
.
.P
.RS
.EX
\&.\[rs]" nroff this_file.roff | less
\&.\[rs]" groff \-T ps this_file.roff > this_file.ps
\[->]The theory of relativity is intimately connected with
the theory of space and time.
\&.
I shall therefore begin with a brief investigation of
the origin of our ideas of space and time,
although in doing so I know that I introduce a
controversial subject.\& \[rs]" remainder of paragraph elided
\&.
.ne 3v \" Don't let a page break hide the blank line from the reader.
\&.
\&
\[->]The experiences of an individual appear to us arranged
in a series of events;
in this series the single events which we remember
appear to be ordered according to the criterion of
\[rs][lq]earlier\[rs][rq] and \[rs][lq]later\[rs][rq], \[rs]" punct \
swapped
which cannot be analysed further.
\&.
There exists,
therefore,
for the individual,
an I\-time,
or subjective time.
\&.
This itself is not measurable.
\&.
I can,
indeed,
associate numbers with the events,
in such a way that the greater number is associated with
the later event than with an earlier one;
but the nature of this association may be quite
arbitrary.
\&.
This association I can define by means of a clock by
comparing the order of events furnished by the clock
with the order of a given series of events.
\&.
We understand by a clock something which provides a
series of events which can be counted,
and which has other properties of which we shall speak
later.
\&.\[rs]" Albert Einstein, _The Meaning of Relativity_, 1922
.EE
.RE
.\" END Keep parallel with groff.texi node "Input Conventions".
.
.
.\" ====================================================================
.SS "Editing with Emacs"
.\" ====================================================================
.
Official GNU doctrine holds that the best program for editing a
.I roff
document is Emacs; see
.MR emacs 1 .
.
It provides an
.I nroff
major mode that is suitable for all kinds of
.I roff
dialects.
.
This mode can be activated by the following methods.
.
.
.P
When editing a file within Emacs the mode can be changed by typing
.RI \[lq] M-x
.BR nroff\-mode \[rq],
where
.I M-x
means to hold down the meta key
(often labelled \[lq]Alt\[rq])
while pressing and releasing the \[lq]x\[rq] key.
.\" Why is this sort of thing not in intro(1)?
.
.
.P
It is also possible to have the mode automatically selected when a
.I roff
file is loaded into the editor.
.
.
.IP \(bu 2n
The most general method is to include file-local variables at the end of
the file;
we can also configure the fill column this way.
.
.
.RS
.IP
.EX
\&.\[rs]" Local Variables:
\&.\[rs]" fill\-column: 72
\&.\[rs]" mode: nroff
\&.\[rs]" End:
.EE
.RE
.
.IP \(bu
Certain file name extensions,
such as those commonly used by man pages,
trigger the automatic activation of the
.I nroff
mode.
.
.
.br
.ne 3v
.IP \(bu
Technically,
having the sequence
.
.
.RS
.IP
.EX
\&.\[rs]" \%\-*\- nroff \-*\-
.EE
.RE
.
.
.IP
in the first line of a file will cause Emacs to enter the
.I nroff
major mode when it is loaded into the buffer.
.
Unfortunately,
some implementations of the
.MR man 1
program are confused by this practice,
so we discourage it.
.
.
.\" ====================================================================
.SS "Editing with Vim"
.\" ====================================================================
.
.\" TODO: elvis, vile. Nvi does not support highlighting at all, and
.\" gedit does but has no rules for roff yet. Other editors TBD.
Other editors provide support for
.IR roff -style
files too,
such as
.MR vim 1 ,
an extension of the
.MR vi 1
program.
.
Vim's highlighting can be made to recognize
.I roff
files by setting the
.B filetype
option in a Vim
.IR modeline .
.
For this feature to work,
your copy of
.I vim
must be built with support for,
and configured to enable,
several features;
consult the editor's online help topics
\[lq]auto\-setting\[rq],
\[lq]filetype\[rq],
and \[lq]syntax\[rq].
.
Then put the following at the end of your
.I roff
files,
after any Emacs configuration:
.\" ...because Emacs pattern-matches against 3000 bytes from the end of
.\" the buffer [or until hitting a 0x0C (FF, form-feed control)] for
.\" "Local Variables:", but Vim only checks as many lines as its
.\" 'modelines' variable tells it to. A common default is "5", but
.\" Emacs settings can be longer than that.
.
.
.RS
.IP
.EX
\&.\[rs]" vim: set filetype=groff textwidth=72:
.EE
.RE
.
.
.P
Replace \[lq]groff\[rq] in the above with \[lq]nroff\[rq] if you want
highlighting that does
.I not
recognize many of the GNU extensions to
.IR roff ,
such as request,
register,
and string names longer than two characters.
.
.
.\" ====================================================================
.SH Authors
.\" ====================================================================
.
This document was written by
.MT groff\-bernd\:.warken\-72@\:web\:.de
Bernd Warken
.ME
and
.MT g.branden\:.robinson@\:gmail\:.com
G.\& Branden Robinson
.ME .
.
.
.\" ====================================================================
.SH "See also"
.\" ====================================================================
.
Much
.I roff
documentation is available.
.
The Bell Labs papers describing AT&T
.I troff
remain available,
and
.I groff
is documented comprehensively. \" ...one hopes.
.
.
.\" ====================================================================
.SS "Internet sites"
.\" ====================================================================
.
.P
.UR https://\:github\:.com/\:larrykollar/\:Unix\-Text\-Processing
.I Unix Text Processing
.UE ,
by Dale Dougherty and Tim O'Reilly,
1987,
Hayden Books.
.
This well-regarded text brings the reader from a state of no knowledge
of Unix or text editing
(if necessary)
to sophisticated computer-aided typesetting.
.
It has been placed under a free software license by its authors and
updated by a team of
.I groff
contributors and enthusiasts.
.
.
.P
.UR http://\:manpages\:.bsd\:.lv/\:history\:.html
\[lq]History of Unix Manpages\[rq]
.UE ,
an online article maintained by the mdocml project,
provides an overview of
.I roff
development from Saltzer's
.I RUNOFF
to 2008,
with links to original documentation and recollections of the authors
and their contemporaries.
.
.
.P
.UR http://\:www\:.troff\:.org/
troff.org
.UE ,
Ralph Corderoy's
.I troff
site,
provides an overview and pointers to much historical
.I roff
information.
.
.
.P
.UR http://\:www\:.multicians\:.org/
Multicians
.UE ,
a site by Multics enthusiasts,
contains a lot of information on the MIT projects CTSS and Multics,
including
.IR RUNOFF ;
it is especially useful for its glossary and the many links to
historical documents.
.
.
.P
.UR http://\:www\:.tuhs\:.org/\:Archive/
The Unix Archive
.UE ,
curated by the Unix Heritage Society,
provides the source code and some binaries of historical Unices
(including the source code of some versions of
.I troff
and its documentation)
contributed by their copyright holders.
.
.
.P
.UR http://\:web\:.mit\:.edu/\:Saltzer/\:www/\:publications/\
\:pubs\:.html
Jerry Saltzer's home page
.UE
stores some documents using the original
.I RUNOFF
formatting language.
.
.
.P
.UR http://\:www\:.gnu\:.org/\:software/\:groff
.I groff
.UE ,
GNU
.IR roff 's
web site,
provides convenient access to
.IR groff 's
source code repository,
bug tracker,
and mailing lists
(including archives and the subscription interface).
.
.
.\" ====================================================================
.SS "Historical \f[I]roff\f[] documentation"
.\" ====================================================================
.
Many AT&T
.I troff
documents are available online,
and can be found at Ralph Corderoy's site
(see above)
or via Internet search.
.
.
.P
Of foremost significance are two mentioned in section \[lq]History\[rq]
above,
describing the language and its device-independent implementation,
respectively.
.
.
.P
\[lq]Troff User's Manual\[rq]
by Joseph F.\& Ossanna,
1976
(revised by Brian W.\& Kernighan,
1992),
AT&T Bell Laboratories Computing Science Technical Report No.\& 54.
.
.
.P
\[lq]A Typesetter-independent TROFF\[rq]
by Brian W.\& Kernighan,
1982,
AT&T Bell Laboratories Computing Science Technical Report No.\& 97.
.
.
.P
You can obtain many relevant Bell Labs papers in PDF from
.UR https://\:github\:.com/\:bwarken/\:roff_classical\:.git
Bernd Warken's
\[lq]roff classical\[rq]
GitHub repository
.UE .
.
.
.\" ====================================================================
.SS "Manual pages"
.\" ====================================================================
.
As a system of multiple components,
a
.I roff
system potentially has many man pages,
each describing an aspect of it.
.
Unfortunately,
there is no consistent naming scheme for these pages among the different
.I roff
implementations.
.
.
.P
For GNU
.IR roff ,
the
.MR groff @MAN1EXT@
man page enumerates all man pages distributed with the system,
and individual pages frequently refer to external resources as well as
manuals distributed with
.I groff
on a variety of topics.
.
.
.P
With other
.IR roff s,
you are on your own,
but
.MR troff 1 \" foreign troff
might be a good starting point.
.
.
.\" Restore compatibility mode (for, e.g., Solaris 10/11).
.cp \n[*groff_roff_7_man_C]
.do rr *groff_roff_7_man_C
.
.
.\" Local Variables:
.\" fill-column: 72
.\" mode: nroff
.\" End:
.\" vim: set filetype=groff textwidth=72:
|