l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2001 Dec 30 17:08

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] latex and dvipdf question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] latex and dvipdf question



I'm generating a PDF based on a Latex document.
The Latex is actually a template being processed by Perl, and
I want the PDF to be output from a CGI (as an "application/pdf" mime-type).

My problem is I can't simply do this:

  ./parser.pl | latex | dvipdf

Because "latex" doesn't read from STDIN or write to STDOUT.
Neither does "dvipdf".

So what I'm doing for the time being is this:

  ./parser.pl | ./tex2pdf.sh

Where "tex2pdf.sh" is a shell script which reads from STDIN and generates
a temporary file:

  cat > out.tex


It then runs "latex" on that file:

  latex out.tex 2> /dev/null    # Don't output "I'm TeX version BLAH"! >:^(


Then it runs "dvipdf" on _that_ file:

  dvipdf out.dvi


And finally, spits the resulting PDF to STDOUT:

  cat out.pdf



This requires that I have a number of temporary files ready to
be written to by these (via the CGI's system or pipe call to
"./parser.pl | ./tex2pdf.sh"):

Of course, I need:

  out.tex      - to capture the parsed TeX template
  out.dvi      - what "latex" makes when you run it on "out.tex"
  out.pdf      - the end result, which "dvipdf" makes based on "out.dvi"

_AND_, I need these:

  out.aux
  out.log


Two files which "latex" and/or "dvipdf" make for heaven-knows-what reason.



Is there a simpler way?  This whole temp. file this is complete crap, and
will NOT be suitable for production!  (The files will get clobbered by
multiple simultaneous calls to the CGI, unless I do some kind of stupid
file locking, in which case the speed of the system will drop dramatically)


HELP!

-bill!


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!