Al-Yahya troff to TeX translator Stanford University

Abstract:

This file demonstrates the use of tr2tex which translates documents written in troff to a LaTeX style. Examples are given to show what the translator can do.

First let's test some equation written for the eqn preprocessor:

2$\displaystyle \left(\vphantom{ 1 \ +\ \sqrt{\omega_{i+1} + \zeta -{x+1 \over \Theta +1} y + 1} }\right.$1  +  $\displaystyle \sqrt{{\omega_{i+1} + \zeta -{x+1 \over \Theta +1} y + 1}}$$\displaystyle \left.\vphantom{ 1 \ +\ \sqrt{\omega_{i+1} + \zeta -{x+1 \over \Theta +1} y + 1} }\right)$    =    1$\displaystyle \eqno$(1)

$\displaystyle \left[\vphantom{
\matrix {
\matrix { e_1 \cr . \cr . \cr e_i \cr . \cr . \cr e_N }
}
}\right.$$\displaystyle \matrix {
\matrix { e_1 \cr . \cr . \cr e_i \cr . \cr . \cr e_N }
}
$$\displaystyle \left.\vphantom{
\matrix {
\matrix { e_1 \cr . \cr . \cr e_i \cr . \cr . \cr e_N }
}
}\right]_{{n+1}}^{}$  =   y + 1

$\displaystyle \bf X$ + a ≥ $\displaystyle \under$$\displaystyle \hat{a}$$\displaystyle \sum_{i}^{N}$$\displaystyle \lim_{{{x} \to k}}^{}$δC

$\displaystyle \left(\vphantom{ \ \it\hbox{speed} \times \ \it\hbox{time} = \ \it\hbox{distance travelled} }\right.$ $\displaystyle \it\hbox{speed} \times \ \it\hbox{time} = \ \it\hbox{distance travelled} $$\displaystyle \left.\vphantom{ \ \it\hbox{speed} \times \ \it\hbox{time} = \ \it\hbox{distance travelled} }\right)$

$\displaystyle \tilde{\beta}$iζδC

 In-line math like β + 1 which is surrounded by math delimiters, as defined by delim is also translated.
Only simple tables are translated. Translation of more complicated tables is painful and I won't do it now. Here is an example:

name type color value
α real red 2.3
x imaginary green -1.2
a + 2 real white 0.0

Now we start a figure.

Figure: This is the caption of the figure.
\begin{figure}\par
\vspace{3.0in}
\end{figure}

Try some floating objects. This text should be kept in one page. i.e. a page break is discouraged here. Now a floating text.

\begin{figure}This text should be kept in one page even if we had to move it around,
since it is a
{\it floating}
object. This is a boxed
\fbox{word.}
\end{figure}
These characters are special in TeX, so they need to be escaped in the translation % & # _, while these characters have to be printed in math mode < > |. 1

Thanks to all of those who contributed by reporting bugs and suggesting some improvements. Special thanks go to Nelson Beebe for all of his valuable contributions and suggestions. He is responsible for making the translator portable to other computers. He also made significant improvements to the translation of manuals. Knuth, D.E., 1984, The TeXBook, Addison-Wesley Publishing Company. Lamprt, L., 1986, LaTeX: user's guide & reference manual, Addison-Wesley Publishing Company. Lesk, M.E., 1978, Typing documents on the UNIX system: using the -ms macros with troff and nroff, UNIX programmer's manual, v. 2B, sec. 3. McGilton, H. and Morgan, R., 1983, Introducing the UNIX system, McGraw-Hill Book Company.