Suppose person A writes a short bit of TeX code, and sends it to person B for inclusion as part of a larger document. The snippet written by A doesn't use anything fancy: no cross-references, citations, sectioning, footnotes, etc. etc. But it has math, of course, and minimal text formatting commands like bold, italics, enumerated lists, maybe tables, etc.
The problem is that A and B use different flavors of TeX. I believe that A uses Plain TeX and B uses LaTeX, then usually B can just paste A's code in and it will work, since most of the text-formatting commands in Plain TeX (e.g. {\bf bold}
) are actually TeX primitives and hence also available in LaTeX even if not the "recommended" style.
If A uses LaTeX and B uses Plain TeX there is more of a problem, since for instance \textbf{bold}
doesn't exist in Plain TeX. But of course in this case, B can just define a simple version of it herself. My question is whether I can save B this work? Where can I find a short, quick and dirty collection of macro definitions that a Plain TeX user can paste at the top of her document that will enable her to paste in simple fragments of LaTeX, using no more than basic text formatting commands and (say) list and tabular environments, and have them come out looking at least vaguely reasonable? Obviously if the LaTeX code uses anything fairly complicated, then there is no answer to this (short of pasting in or reimplementing all of LaTeX), but it seems that for very simple code it should be possible, and maybe someone has done it before.
\rmfamily \sffamily \ttfamily \mdseries \bfseries \upshape \itshape \slshape \scshape \normalfont \textrm \textsf \texttt \textmd \textbf \textup \textit \textsl \textsc \rm \sf \tt \md \bf \up \it \sl \sc
What is missing?: - size commands:\large, \huge
etc. Use\fontsize{20pt}
instead. - scaling - math support is poor\bf
is not a tex primitive (and not defined by default in latex) so even using plain in latex is not always guaranteed. The other direction is just as hard as you want to make it,\mathbf
is easy to define, an ams alignment less so.amsmath
is derived from ams-tex there might be some hope there, but the thought of trying to implementtabular
in plain tex strikes terror in me. there are some list-like features in ams-tex (roster
), but no automatic numbering. i'm not familiar enough with eplain to know whether that holds promise.