.TH TR2TEX 9 "1 January 1987" .UC 4 .SH NAME tr2tex \- convert a document from troff to LaTeX .SH SYNOPSIS .B tr2tex [ .B -m ] .I file ... .SH DESCRIPTION .I Tr2tex converts .IR troff (1) typesetter commands within a document to .IR LaTeX (1) formatting commands. It is intended to do a rough first-pass of the conversion; the user should then finish up the rest of the conversion and customize the converted manuscript to his/her liking. It can also serve as a tutor for those who want to convert from .I troff to .I LaTeX. .PP By default, .I tr2tex reads from standard input and writes to standard output and can participate in pipes. A file name may be specified on the command line to read from that file instead of standard input. If multiple input files are specified, they will be concatenated and converted into a single output .I LaTeX file. The input .I troff file(s) is preserved. If called without any command line arguments, and not as part of a pipe, .I tr2tex self-documents with a brief syntax summary and quits. .PP Most of the converted document will be in .I LaTeX but some of it may be in plain .I TeX. The converted .I LaTeX document will specify \\documentstyle[\fIoptions\fR]{article}, where .I option is either .B troffms or .B troffman, depending upon whether .B -ms macros (default) or .B -man macros (\fB-m\fR option) are used. These options read .sty files which are included in the package and should be available in the system's macro directory. These files define special .I LaTeX macros to handle some .I troff macros that have no direct .I LaTeX equivalents. .PP .I Tr2tex understands most of the .B -ms and .B -man macros and .I eqn(1) preprocessor symbols. It also understands several plain .I troff commands. Only few .I tbl(1) preprocessor commands are understood to help convert very simple tables. If a .I troff command cannot be converted, the line that contains that command will be copied to the output with the .I LaTeX comment character (%) added at the beginning of that line. .PP If the document uses .I eqn symbols, it must have the in-line equation delimiter defined by the .B delim command. If it is defined in another setup file, that setup file has to be concatenated with the file to be converted, otherwise .I tr2tex will treat the in-line equation as ordinary text. .SH BUGS Many of these bugs are harmless. Most of them cause local errors that can be fixed in the converted manuscript. .TP TROFF RELATED .TP 1) Some macros and macro arguments are not recognized. .TP 2) Commands that are not separated from their argument by a space are not properly parsed (e.g .sp3i). .TP 3) Some .I troff commands are translated to commands that require delimiters that have to be explicitly put. If they are omitted, problems will occur. Example: .nf not closed by .fi. .TP 4) When local motions are converted to \\raise or \\lower, an \\hbox is needed, which has to be inserted manually after the conversion. .TP 5) Line spacing is not changed within a paragraph in .I TeX (which is a bad practice anyway). .I TeX uses the last line spacing in effect in that paragraph. .TP 6) Access to the contents of registers via .B .nr command is not supported. .TP EQN RELATED .TP 1) When some operators (notably \fBover\fR, \fBsub\fR, and \fBsup\fR) are renamed (via \fBdefine\fR), \fItr2tex\fP will fail to apply the redefined version of the operator. .TP 2) \fBrpile\fR, \fBlpile\fR and \fBcpile\fR are treated the same as \fBcpile\fR. .TP 3) \fBrcol\fR, \fBlcol\fR are treated the same as \fBccol\fR. .TP 4) \fBlineup\fR, \fBmark\fR, \fBsize\fR, \fBgsize\fR, \fBfat\fR, and \fBgfont\fR are ignored. .TP 5) A command of the form 'a sub i sub j' is converted to 'a_i_j' which .I TeX parses as 'a_i{}_j}' with a complaint that it is vague. A command of the form 'a sub {i sub j}' is parsed correctly and converted to 'a_{i_j}'. .SH FILES /usr/src/tex/macros/troffms.sty \- LaTeX macros for converting troff -ms macros. .br /usr/src/tex/macros/troffman.sty \- LaTeX macros for converting troff -man macros. .SH SEE ALSO tex(1), texmatch(9), trmatch(9). .SH AUTHOR Kamal Al-Yahya, Stanford University