Skip to content

Instantly share code, notes, and snippets.

@Chubek
Last active May 30, 2024 16:01
Show Gist options
  • Save Chubek/887b851ebf48499597434a72dfb28674 to your computer and use it in GitHub Desktop.
Save Chubek/887b851ebf48499597434a72dfb28674 to your computer and use it in GitHub Desktop.
TSV datasets of ROFF (Requests, Escapes, NRs, SRs, Characters)

This Gist contains a total of 5 tab-separated values files (TSV), and they list:

  • ROFF-Requests.tsv -> ROFF requests, this file is the only one where the structure is taken from the manual downloaded from TROFF's website authored by the late Joe Ossanna and the legendary BWK, refer to the listing in the manual to get a sense of what each column means (name;args;default;default arg values;flags;description).
  • ROFF-Escapes.tsv -> The escape sequences --- those accepting arguments and those variable have been marked;
  • ROFF-NRs.tsv -> The built-in numeric registers (which GROFF just calls registers);
  • ROFF-SRs.tsv -> The built-in string registers (which GROFF just calls strings);
  • ROFF-Chars.tsv -> The pre-defined character list;

Important thing to note is, these are the listings as defined by Ossanna and Kernighan. GNU additions have not been accounted for. Whatever Heirloom DocTools adds neither. This is pure ROFF!

ROFF Implementations

  • Original AT&T ROFF -> You may find it in Plan 9 toolset;
  • Heirloom DocTools -> Find it on SourceForge;
  • GNU TROFF -> Comes pre-installed on most Linices;
  • NeatROFF -> This is a program by Iranian computer scientist Ali Gholami Rudi;
  • ManDoc -> BSD's replacement for ROFF (figures, ROFF has no use outside man these days);

Edit: I just noticed, somewhere during processing, the tabs have been space-ized. expand/unexpand should take care of that.

We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
\(bu • Bullet E {Bullet character}
\(em — Em dash E {Em dash}
\(en – En dash E {En dash}
\(hy - Hyphen E {Hyphen}
\(ru ─ Rule E {Rule (horizontal line)}
\(lq “ Left quote E {Left double quotation mark}
\(rq ” Right quote E {Right double quotation mark}
\(oq ‘ Opening quote E {Left single quotation mark}
\(cq ’ Closing quote E {Right single quotation mark}
\(aq ' Acute accent E {Acute accent}
\(ga ` Grave accent E {Grave accent}
\(ul _ Underscore E {Underscore}
\(ci ○ Circle E {Circle}
\(sq ▪ Square E {Square}
\(sh § Section E {Section symbol}
\(eq = Equals E {Equals sign}
\(pl + Plus E {Plus sign}
\(mi − Minus E {Minus sign}
\(mu × Multiplication E {Multiplication sign}
\(di ÷ Division E {Division sign}
\(is ∫ Integral E {Integral sign}
\(mo ∈ Element E {Element of set}
\(or ∨ Logical OR E {Logical OR}
\(aa ∧ Logical AND E {Logical AND}
\(te ∃ Existential quantifier E {Existential quantifier}
\(fa ∀ Universal quantifier E {Universal quantifier}
\(pt ∂ Partial derivative E {Partial derivative}
\(pd ∂ Partial differential E {Partial differential}
\(if ∞ Infinity E {Infinity symbol}
\(na ¬ Negation E {Negation symbol}
\(de ≠ Not equal E {Not equal to}
\(le ≤ Less than or equal E {Less than or equal to}
\(ge ≥ Greater than or equal E {Greater than or equal to}
\(ap ≈ Approximately equal E {Approximately equal to}
\(pd ∂ Partial derivative E {Partial derivative}
\(rg ® Registered E {Registered trademark}
\(co © Copyright E {Copyright symbol}
\(tm ™ Trademark E {Trademark symbol}
\(dg † Dagger E {Dagger (obelisk)}
\(dd ‡ Double dagger E {Double dagger (double obelisk)}
\(ps ¶ Paragraph E {Paragraph symbol}
\(ba | Vertical bar E {Vertical bar}
\(rb ] Right bracket E {Right square bracket}
\(lb [ Left bracket E {Left square bracket}
\(rs \ Backslash E {Backslash}
\(lc { Left curly brace E {Left curly brace}
\(rc } Right curly brace E {Right curly brace}
\(ti ~ Tilde E {Tilde}
\(sh § Section E {Section sign}
\(bn ¦ Broken vertical bar E {Broken vertical bar}
\(ci ° Degree E {Degree sign}
\(ft ° Degree E {Degree sign}
\(ct ¢ Cent E {Cent sign}
\(eu € Euro E {Euro sign}
\(ye ¥ Yen E {Yen sign}
\(po £ Pound E {Pound sterling}
\(do $ Dollar E {Dollar sign}
\(eu € Euro E {Euro sign}
\(ct ¢ Cent E {Cent sign}
\(ct ℅ Care of E {Care of}
\(tm ™ Trademark E {Trademark}
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
\\ double backslash \[rs] E,T {Escape character}
\[char] special character \(char) E {Insert special character}
\& non-printing zero-width space - E {Non-printing zero-width space}
\~ non-breaking space - E {Non-breaking space}
\^ non-printing zero-width space - E {Non-printing zero-width space}
\" comment line - E {Comment}
\' acute accent - E {Acute accent}
\` grave accent - E {Grave accent}
\- minus sign - E {Minus sign}
\e escape character - E {Escape character}
\0 digit-space - E {Digit-space}
\| narrow space - E {Narrow space}
\^ half-narrow space - E {Half-narrow space}
\(em em dash - E {Em dash}
\(en en dash - E {En dash}
\(hy hyphen - E {Hyphen}
\h'N' horizontal motion - E {Horizontal motion of n units}
\v'N' vertical motion - E {Vertical motion of n units}
\s'N' point size change - E {Change point size by n}
\fF font change - E {Change to font F}
\*(xx string expansion - E {Expand string xx}
\$n argument number n - E {Macro argument number n}
\$* all arguments - E {All macro arguments}
\$@ argument count - E {Number of arguments}
\$0 macro name - E {Macro name in a macro}
\*[xx] string - E {Interpolate string xx}
\[xxx] special character - E {Interpolate special character xxx}
\{ begin conditional block - E {Begin conditional block}
\} end conditional block - E {End conditional block}
\A'N' ASCII value n - E {Character with ASCII code n}
\D'xy' draw command - E {Draw object, e.g., line, circle}
\k(xx mark horizontal position - E {Mark horizontal position for later use}
\L'N' vertical line - E {Draw vertical line of length n}
\M'N' margin - E {Change margin}
\N'N' change device control - E {Change device control setting}
\P reset horizontal position - E {Reset horizontal position to the beginning of the line}
\R'xx N' define register - E {Define a new register xx with value n}
\S'N' slant - E {Set slant to n degrees}
\w'str' width - E {Get the width of str}
\X'str' device command - E {Send device-specific command str}
\Z'str' zero-width - E {Embed str with zero width}
\Y'str' move to vertical position - E {Move to vertical position indicated by str}
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
a 0 horizontal E {Horizontal line length in inches}
ct current count E {Count of text lines output on current page}
dn current downward E {Current downward motion in lines}
dy 0 year E {Current year}
m 0 machine E {Machine number or name}
n 1 input E {Current input line number}
n. current vertical E {Current vertical position in basic units}
nC current page E {Current page number}
nM 0 month E {Current month}
nS 1 section E {Current section number}
nT 0 title E {Current title number}
nl 1 lower E {Lowest-level section number}
nP current paragraph E {Current paragraph number}
ol current line E {Current line number}
op current output E {Current output line number}
s 12p size E {Current point size in points}
f 0 first E {First column position}
l 0 left E {Left margin position}
r. 0 register E {General-purpose register}
s. current scale E {Current scale factor}
sb 0 spacing E {Base-line spacing (leading)}
sp 1v previous E {Previous vertical line spacing}
sv 0 saved E {Saved vertical position}
t 0 tab E {Tab position}
u 0 underline E {Underline thickness}
x 0 extra E {Extra space}
F 0 current E {Current font number}
H 0 horizontal E {Horizontal size}
v. 0 vertical E {Vertical size}
w. 0 width E {Character width}
.d current diversion E {Current vertical position in diversion}
n 0 line E {Current line length}
h 0 horizontal E {Horizontal motion size}
l. 0 line E {Current line spacing}
L 0 left E {Left margin}
R 0 reference E {Reference point}
Y 0 year E {Current year in diversion}
mS 0 section E {Current section in manual}
.$ 0 argument E {Current macro argument}
b 0 baseline E {Baseline spacing}
a 0 aspect E {Aspect ratio}
o 0 output E {Output line number}
C 0 chapter E {Current chapter number}
P 0 page E {Current page number}
m 0 month E {Current month in diversion}
s 0 section E {Current section number}
d. 0 diversion E {Current diversion number}
z 0 zero E {Zero-width}
We can make this file beautiful and searchable if this error is corrected: It looks like row 50 should actually have 2 columns, instead of 5. in line 49.
ps n 10pt previous E,T {Set point size}
ss N 32m ignored E,T {Set space size}
cs F,N,M off - P,T {Constant character space mode}
bd F,N off - P,T {Embolden F by N - 1}
bd S,F,N off - P,T {Embolden special font when current font is F}
ft F Roman previous P,T {Change font to F}
fp N,F,L R,I,B,S ignored P,T {Mount fount F on physical position N <= 1, Long name L}
pl n 11i 11i v {Page length}
bp n 1 - B,v {Eject current page}
pn n 1 ignored - {Next page N}
po n 1i|0 previous v {Page offset}
ne N - N=1v D,v {Need N vertical space}
mk R none internal D {Mark current vertical space in register R}
rt n none internal D,v {Return to marked vertical space}
br - - - B {Break}
fi - fill - B,E {Fill output lines}
nf - nofill - B,E {No filling or adjustment of output lines}
ad c adj,both adjust E {Adjust output lines with mode c where c=l,r,c,b,none}
na - adjust - E {No output line adjusting}
ce N off 1 B,E {Center next N input text lines}
vs N 12p previous E,v {Vertical baseline spacing}
ls N 1 previous E {Output N -1 v's after each output line}
sp N - 1v B,v {Space vertical distance N in either direction}
sv N - 1v v {Save vertical distance N}
os - - - - {Output saved vertical distance}
ns - space - D {Turn on no-space}
rs - - - D {Restore spacing}
ll n 6.5i previous E,m {Line length}
in n 0 previous B,E,m {Indent}
ti n - ignored B,E,m {Temporary indent}
de xx,yy - yy=.. - {Define macro}
am xx,yy - yy=.. - {Append to a macro}
ds xx,string - ignored - {Define `string` named xx}
as xx,string - ignored - {Append `string` to xx}
rm xx - ignored - {Removed request, macro, or string}
rn xx,yy - ignored - {Renamed request, macro, or string}
di xx - end D {Divert output to macro}
da xx - end D {Divert and append to xx}
wh N,xx - - v {Change trap location}
dt xx,N - off D,v {Set diversion trap}
it N,xx - off E {Set an input-line trap}
em xx none none - {End macro is xx}
nr R,n,M - - u {Define and set number register, auto increment by M}
af R,c arabic - - {Assign format to register R (c=l,i,I,a,A)}
rr R - - - {Remove register R}
ta N,t 0.5i none E,m {Tab settings, left default, unless t is R or C}
tc c none none E {Tab repetition character}
lc c . none E {Leader repetition character}
fc a,b off off - {Set field delimiter a and pad character b}
ec c \ \ - {Set escape character}
eo - on - - {Turn off escape character mechanism}
lg N on,- on T {Ligature mode on if N > 0}
ul N off 1 E {Underline N input lines}
cu N off 1 E {Continuous underlining}
uf F italic italic - {Underline font set to F, switch by ul}
cc c . . E {Set control character to C}
c2 c ' ' E {Set no-break character to C}
tr alt... none - O {Translate alternatively}
nh - hyphenate - E {No hyphenation}
hy N hyphenate hyphenate E {Hyphenate, N is mode}
hc c \% \% E {Hyphenate indicator}
hw word...- ignored - {Add word to hyphenation dictionary}
tl 'l'c'r - - - {Three-part title, delimiter maybe anything}
pc c % off - {Page number character}
lt n 6.5i previous E,m {Length of title}
nm nMSI - off E {Number mode on or off}
nn N - 1 E {Do not number next N lines}
if C,any - - - {If condition C is truthy, accept 'any' as input}
ie C,any - - - {If-else truthy...}
el any - - - {Else portion of ie or if}
ev N 0 previous - {Environment switch}
rd prompt - &bell - {Read from STDIN}
ex - - - - {Exit}
so filename - - - {Add file to include stack}
nx filename - - - {Next file}
sy string - - - {Execute shell}
pi string - - - {Pipe}
cf filename - - - {Copy file contents}
mc c,N - off E,m {Set marching character c and separation N}
tm string - newline - {Print string on STDERR}
ig yy - yy=.. - {Ignore until yy}
lf N,f - - - {Set input line number to N and filename to f}
pm t - all - {Print macro names, sizes, if present, print total}
fl - - - B {Flush output buffer}
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
* - current E {Current font name}
f - current E {Current font family}
F - - E {Current input file name}
T - - E {Output device name}
$ - - E {Number of arguments to a macro}
d - - E {Current day of the month}
m - - E {Current month}
y - - E {Current year}
H - - E {Current hour}
M - - E {Current minute}
S - - E {Current second}
a - - E {Current date in YYYY-MM-DD format}
w - - E {Current day of the week}
u - - E {Current day of the year}
v - - E {GNU roff version number}
o - - E {Operating system type}
k - - E {Conditionally indicates a C, K, or M environment}
p - - E {Current page number as a string}
s - - E {Current point size}
b - - E {Current emboldening amount}
x - - E {Current device resolution in horizontal units per inch}
y - - E {Current device resolution in vertical units per inch}
z - - E {Current glyph scaling factor}
D - - E {Current date and time in YYYY-MM-DDTHH:MM:SS format}
A - - E {Current ANSI date and time format}
U - - E {Current UTC date and time in YYYY-MM-DDTHH:MM:SSZ format}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment