[TUHS] For all you troff hackers...

markus schnalke meillo at marmaro.de
Wed Feb 17 23:55:55 AEST 2016


Hoi,

thanks for pointing to that! I would have missed it but now I had a
good laugh. :-)

> part 1     image/tiff                 68K

Just for the record, it's that one: https://xkcd.com/1638/


Grepped* my troff sources and found no more than four backslashes
in a row, but at least I got 16 in one line:

	.ds _O '\f(SCChapter \\\\n(H1\ \ \\\\*(_C\fP''\\\\n(PN'  \" right

Seems I haven't gone deep enough into troff to need more than
four backslashes to manage my way back up into daylight. :-)


The Heirloom doctools' mm macros impress a lot more. They have
16 subsequent (!) backslashes:

$ fgrep  '\\\\\\\\\\\\\\\\' /usr/local/lib/doctools/tmac/*   
/usr/local/lib/doctools/tmac/mmn:\!\\!.if \\$2=\\\\\\\\\\\\\\\\$1 .)T 1 1 "\\*(}0" "\\$4" \\\\\\\\nP \\*(}3
/usr/local/lib/doctools/tmac/mmt:\!\\!.if \\$2=\\\\\\\\\\\\\\\\$1 .)T 1 1 "\\*(}0" "\\$4" \\\\\\\\nP \\*(}3


You see, this XKCD cartoon is definitely about troff!


meillo


*) Nice thread about grep, btw.



More information about the TUHS mailing list