Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

pdflatex and system

by josera (Beadle)
on Aug 23, 2005 at 08:38 UTC ( #485851=perlquestion: print w/replies, xml ) Need Help??

josera has asked for the wisdom of the Perl Monks concerning the following question:

Hello:
I've made a program in Perl with the output in latex. Now i want to generate the pdf file with pdflatex. I'm using windows, so i've installed miktex in the folder of my project.
When i call system with

system ("./lib/texmf/miktex/bin/pdflatex $outputfile.tex")

all is ok, and i obtain my file $outputfile.pdf, but i think that itsn't elegant to show in the standard output, so i change the call, changing the standard output (or the standard error), to

system ("./lib/texmf/miktex/bin/pdflatex $outputfile.tex > $outputfile +.2.log")

or

system ("./lib/texmf/miktex/bin/pdflatex $outputfile.tex >? $outputfil +e.2.log")

but then my program says:

"'.' is not recognized as an internal or external command, operable program or batch file."

What's the problem? Why doesn't it work?
I've got a paar question more about system, when the program invoked finish, my program takes the control again. Doesn't it? Can the program invoked not to finish good and be a "zombi" in the system and not finish?
Can someone help me? Thank you.
Yours, sincerely
José Ramón Martínez

Edit g0n - added code tags

Replies are listed 'Best First'.
Re: pdflatex and system
by holli (Abbot) on Aug 23, 2005 at 09:21 UTC
    try
    system ("./lib/texmf/miktex/bin/pdflatex $outputfile.tex>$outputfile.2 +.log")
    (note: no spaces around ">").

    For asynchronous execution of an external command, check out exec() fork() or Win32::Process.

    Update: bart corrected my error about exec().


    holli, /regexed monk/
Re: pdflatex and system
by jeteve (Pilgrim) on Aug 23, 2005 at 09:35 UTC
    See also IPC::Run on CPAN, it can simplify what you trying to do :) Hope it helps !

    -- Nice photos of naked perl sources here !

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://485851]
Approved by holli
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-08-16 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?