We are still actively working on the spam issue.
Difference between revisions of "Troff"
(Created page with "{{stub}} '''<tt>troff</tt>''' is a typesetting language that can be used for creating all sorts of documents, such as letters and even your homework, if you happen to be an un...") |
m |
||
Line 5: | Line 5: | ||
== Distributions of troff == | == Distributions of troff == | ||
You should probably consider these two versions of <tt>troff</tt>: | You should probably consider these two versions of <tt>troff</tt>: | ||
− | + | === Plan 9 troff === | |
− | + | [[Plan 9]] troff is descended from J. Ossanna's original <tt>troff</tt> for Unix on the PDP-11/70 at Bell Labs. It is also included in plan9port. | |
+ | |||
+ | Plan 9 troff relies more on pipes than groff. Here's how a document using the ms macro package gets turned into a PDF on 9front: | ||
+ | % troff -ms doc.ms | dpost -f | ps2pdf > doc.pdf | ||
+ | Alternatively, it can be done with <tt>lp(1)</tt> like so: | ||
+ | % troff -ms doc.ms | lp -lstdout | ps2pdf > doc.pdf | ||
+ | On Unix-like systems using plan9port, <tt>dpost</tt> is missing, but <tt>tr2post</tt> does mostly the same thing. No ps2pdf is provided with plan9port, so the Ghostscript ps2pdf script will suffice: | ||
+ | $ 9 troff -ms doc.ms | 9 tr2post | ps2pdf - > doc.pdf | ||
+ | Ghostscript is (at least on [[OpenBSD]]) a dependency of plan9port. | ||
+ | === groff === | ||
+ | Groff is the [[GNU|GNU Project]]'s version of <tt>troff</tt>, originally written by James Clark in C++, and that might tell you quite a lot about the design of groff. |
Latest revision as of 20:31, 19 December 2015
troff is a typesetting language that can be used for creating all sorts of documents, such as letters and even your homework, if you happen to be an underage b8r. troff differs from monolithic word processors by being a barebones language with decent macros provided for common tasks that describes what you want your document to look like. It differs from TeX and LaTeX in that troff tends to be more terse with commands such as .LP
and .SH
.
Perhaps the most widespread use of troff is the use of the mdoc and man macros, used to write manual pages for Unix-like operating systems such as GNU/Linux and the BSDs.
Distributions of troff
You should probably consider these two versions of troff:
Plan 9 troff
Plan 9 troff is descended from J. Ossanna's original troff for Unix on the PDP-11/70 at Bell Labs. It is also included in plan9port.
Plan 9 troff relies more on pipes than groff. Here's how a document using the ms macro package gets turned into a PDF on 9front:
% troff -ms doc.ms | dpost -f | ps2pdf > doc.pdf
Alternatively, it can be done with lp(1) like so:
% troff -ms doc.ms | lp -lstdout | ps2pdf > doc.pdf
On Unix-like systems using plan9port, dpost is missing, but tr2post does mostly the same thing. No ps2pdf is provided with plan9port, so the Ghostscript ps2pdf script will suffice:
$ 9 troff -ms doc.ms | 9 tr2post | ps2pdf - > doc.pdf
Ghostscript is (at least on OpenBSD) a dependency of plan9port.
groff
Groff is the GNU Project's version of troff, originally written by James Clark in C++, and that might tell you quite a lot about the design of groff.