[texhax] Callable TeX?

Michael Doob mdoob at ccu.umanitoba.ca
Thu Oct 28 20:06:13 CEST 2010

On Thursday 28 October 2010 1:56 am, Donald Arseneau wrote:
> Thomas Schneider <schneidt at mail.nih.gov> writes:
> > > Is this the sort of thing you had in mind?
> > > echo '\documentclass{article}\\begin{document}Hello, World!\\end{document}' | latex 
> > 
> No doubling of backslashes.  (Double all backslashes if the
> command line uses weak "" quoting)

Well, this is actually shell dependent (it shouldn't be, I suppose,
but it is). But really guys, all I wanted to indicate is that its
easy to pipe stuff into latex. This does not seem to be widely known.

Even less widely known, you can easily read input off the command line.
For example, if the contents of test.tex is

\read16 to\myinputline
Here is the input: \myinputline

then the line
echo '\TeX{} is great!' | latex test.tex
will insert the echoed material into the printed page.


Michael Doob                    Telephone: (204) 474-9796
Department of Mathematics       Fax: (204) 474-7606
University of Manitoba          email: Michael_Doob at umanitoba.ca
Winnipeg, MB, Canada R3T 2N2

More information about the texhax mailing list