Hello,
At present
tex ('(not a)) => $$\not a$$
tex ('(a and b)) => $$a(\and)b$$
tex ('(a or b)) => $$a(\or)b$$
tex ("Hello, World!") => $$&Hello, World!$$
tex ('(foo(x) := x^2)) => |foo(x):=x^2;|
tex ('foo_bar) => $$foo\_bar$$
These are problematic: \not is recognized by tex and
latex but it is rendered as a forward slash.
\and and \or are not recognized by tex or latex
(and the parentheses are spurious).
"Hello, World!" is printed with a leading & which
confuses tex and latex, and the words are typeset
as sequences of single-letter variables.
Tex and latex both complain about |foo(x) := x^2|
because the ^ isn't in a math environment.
Also, function definitions commonly take up multiple lines.
Tex and latex typeset foo_bar as single-letter variables.
I propose these outputs instead.
tex ('(not a)) => $$\neg a$$
tex ('(a and b)) => $$a \wedge b$$
tex ('(a or b)) => $$a \vee b$$
tex ("Hello, World!") => $$\mathrm{Hello, World!}$$
tex ('(foo(x) := x)) =>
\begin{verbatim}
foo(x):=x^2;
\end{verbatim}
tex ('foo_bar) => $$\mathit{foo\_bar}$$
tex and latex both seem happy with \neg, \wedge,
and \vee.
verbatim, \mathrm, and \mathit are latex-specific,
if I'm not mistaken, so we probably will have to
find plain tex equivalents.
Can we have yet another global variable to tell
the tex flavor? ('tex, 'latex, or 'amslatex, perhaps?)
Since latex and amslatex are widely used, perhaps
more so than plain tex, I think we really should have
built-in support for those kinds of tex.
For the record, my tex command claims it
is TeX, Version 3.14159 (Web2C 7.4.5).
Latex is LaTeX 2e. tex and latex belong to
a package tetex-2.0.2.
Robert Dodier