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:
January 6: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
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)
Re: [vox-tech] latex and dvipdf question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] latex and dvipdf question



bill, a quick glance at google yielded some helpful replies:

http://groups.google.com/groups?as_q=read%20from%20stdin&as_ugroup=comp.text.tex

why this is a problem (btw, robin is one of the world's experts on latex):

http://groups.google.com/groups?q=read+from+stdin+group:comp.text.tex&safe=off&rnum=1&selm=4jqbd1%24k18%40d2.tufts.edu

this might be helpful:

http://groups.google.com/groups?q=read+from+stdin+group:comp.text.tex&safe=off&rnum=2&selm=xn9wviksp0z.fsf%40pixel13.doc.ic.ac.uk

david is one of the world experts on latex, vim and procmail:

http://groups.google.com/groups?q=read+from+stdin+group:comp.text.tex&safe=off&rnum=4&selm=m2emacmclx.fsf%40mailhost.neuroinformatik.ruhr-uni-bochum.de

from the quick reading i did, you'll need to find an alternative to dvips.
but perhaps perl/expect or tcl/expect might be useful here?

peter




begin: William Kendrick <nbs@sonic.net> quote
> 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!

-- 
"The following addresses had permanent fatal errors..."      p@dirac.org
                               -- Mailer Daemon              www.dirac.org/p


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:
EDGE Tech Corp.
For donating some give-aways for our meetings.