Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

stdin and stdout

40 views
Skip to first unread message

Fei Chen

unread,
Apr 2, 1996, 3:00:00 AM4/2/96
to

hi all!

i was wondering if i can have latex read from stdin and output to
stdout? i want to do something like"

sed '/s/april/may/' bill.tex | latex (some options here?) | dvips -f | mpage

please email me if you have an answer.

thanks a lot you all!

fei chen

Robin Fairbairns

unread,
Apr 3, 1996, 3:00:00 AM4/3/96
to
In article <4jqbd1$k...@d2.tufts.edu>, Fei Chen <fc...@emerald.tufts.edu> wrote:
>i was wondering if i can have latex read from stdin and output to
>stdout? i want to do something like"
>
>sed '/s/april/may/' bill.tex | latex (some options here?) | dvips -f | mpage

TeX isn't set up to do this sort of thing, for hysterical raisins.

dvips couldn't in fact deal with a dvi file on stdin, because it needs
to do random access to the dvi to generate efficient postscript output
(it goes so far as to have a special diagnostic "dvips: ! DVI file
must not be a pipe").

So the best you can do is to write scripts that emulate the DOS way of
doing pipes, by writing stdout to disc and then faking up that file
name as an argument to the next command along the `pipe'

All in all, hardly worth the candle -- you might as well write a
script to do the job straightforwardly.
--
Robin (Campaign for Real Radio 3) Fairbairns r...@cl.cam.ac.uk
U of Cambridge Computer Lab, Pembroke St, Cambridge CB2 3QG, UK
Home page: http://www.cl.cam.ac.uk/users/rf/robin.html

Kyosti Huhtala

unread,
Apr 3, 1996, 3:00:00 AM4/3/96
to
Fei Chen (fc...@emerald.tufts.edu) wrote:

: hi all!

: i was wondering if i can have latex read from stdin and output to

: stdout? i want to do something like"

: sed '/s/april/may/' bill.tex | latex (some options here?) | dvips -f | mpage

XXXXXXXXXX

At least this won't work: dvips working as a filter (option -f) wants
to see the input (see man dvips).

I guess you have to use temporary files.

Ky\"osti
--
huh...@jyu.fi

0 new messages