Conversion Tools ⇒ LaTeX to PDF
LaTeX to PDF
I have figured out some way to convert .tex files to pdf using a batch file but it has some issues. like depositing .dvi files to the miktex root folder. I need help to do this better. Remember am using a batch file, I will post the cmds.
NEW: TikZ book now 40% off at Amazon.com for a short time.
LaTeX to PDF
Hi,
We're waiting for the announced code. I surely won't be able to help you with this particular issue, but perhaps some other member will.simo wrote:I have figured out some way to convert .tex files to pdf using a batch file but it has some issues. like depositing .dvi files to the miktex root folder. I need help to do this better. Remember am using a batch file, I will post the cmds.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
LaTeX to PDF
*****This is the first batch file for the first step which compiles .tex *****to .dvi*****
*****Note:***
*****1. the cmds 1st directs to the folder containing your .tex file*****
*****2. the file is compiled twice for clarity*****
***** I have named it compiler1.bat***
**** In the same order, the 2nd compiler converts .dvi to .ps(compiler2.bat)***
**** The last one now compiles .ps to .pdf***(compiler3.bat)
You may decide to have the cmds in a single batch file or separately and a main batch to call the three in sequence, which I find also working fine(maincompiler.bat).
Remember it costs you this much
Miktex 2.8/2.7 0$(both should be updated)
TEXnicCenter 0$
Acrobat Reader 0$
......................
TOTAL 0$
....................
*****Note:***
*****1. the cmds 1st directs to the folder containing your .tex file*****
*****2. the file is compiled twice for clarity*****
***** I have named it compiler1.bat***
Code: Select all
cd\
J:
cd Simo Project
cd coding5th
cmd /C latex "J:\Simo Project\coding5th\testfile.tex"
cmd /C latex "J:\Simo Project\coding5th\testfile.tex"
Code: Select all
cd\
J:
cd Simo Project
cd coding5th
cmd /C dvips -o "J:\Simo Project\coding5th\testfile.ps" "J:\Simo Project\coding5th\testfile.dvi"
cmd /C dvips -Ppdf -t letter -o "J:\Simo Project\coding5th\testfile.ps" "J:\Simo Project\coding5th\testfile.dvi"
Code: Select all
cd\
J:
cd Simo Project
cd coding5th
cmd /C ps2pdf14.bat "J:\Simo Project\coding5th\testfile.ps"
Code: Select all
@echo off
cmd /C "J:\Simo Project\coding5th\compiler1.bat"
cmd /C "J:\Simo Project\coding5th\compiler2.bat"
cmd /C "J:\Simo Project\coding5th\compiler3.bat"
Miktex 2.8/2.7 0$(both should be updated)
TEXnicCenter 0$
Acrobat Reader 0$
......................
TOTAL 0$
....................
LaTeX to PDF
What is with all the cmd lines? Why launch a new shell for each process? Why isn't "Simo Project" in quotation marks after "cd"? Why hard-code the paths, rather than simply allowing the path to be passed as an argument? What is in ps2pdf14.bat? Does that come with ghostscript for windows, or is that something you wrote? Why not include bibtex?
If you're using TexNicCenter, why not just run its LaTeX => PS => PDF routine? Why create your own?
Assuming latex, dvips and ps2pdf are all in your path, I'd just use something like:
(Stick @echo off at the beginning if you want, though I'd prefer to see what happens myself.)
This will allow you to pass the batch file a parameter, so that if it's called compile.bat, you could type in:
compile.bat "J:\Simo Project\coding5th\testfile.tex"
It'll compile and convert that file, but you could pass it anything else instead, including a relative path, I think.
I think that'll work anyway. Been a long time since I wrote a batch file for Windows, and I never ran ghostscript from a shell. I don't have any of these programs installed for Windows to check. (Windows sucks.)
What's wrong with that?
(Or just use pdflatex and be done with it?)
If you're using TexNicCenter, why not just run its LaTeX => PS => PDF routine? Why create your own?
Assuming latex, dvips and ps2pdf are all in your path, I'd just use something like:
Code: Select all
cd "%~dp1"
latex --interaction=nonstopmode "%~n1.tex"
bibtex "%~n1.tex"
latex --interaction=nonstopmode "%~n1.tex"
latex --interaction=nonstopmode "%~n1.tex"
dvips "%~n1.dvi"
ps2pdf "%~n1.ps"
This will allow you to pass the batch file a parameter, so that if it's called compile.bat, you could type in:
compile.bat "J:\Simo Project\coding5th\testfile.tex"
It'll compile and convert that file, but you could pass it anything else instead, including a relative path, I think.
I think that'll work anyway. Been a long time since I wrote a batch file for Windows, and I never ran ghostscript from a shell. I don't have any of these programs installed for Windows to check. (Windows sucks.)
What's wrong with that?
(Or just use pdflatex and be done with it?)
Re: LaTeX to PDF
Thaaaaaaaaaannnnnnnnnkkkkk you so much!!!!!!!!
I only needed the "interaction=nonstopmode" cmd to complete my space shuttle and am off to space.Get on board frabjous. My batch file is running perfectly well.
Good day
I only needed the "interaction=nonstopmode" cmd to complete my space shuttle and am off to space.Get on board frabjous. My batch file is running perfectly well.
Good day
Re: LaTeX to PDF
should this code be in linux or something I tried it in windows but it wont work.
And at least I was able to solve my problem.
Confirm pliz
And at least I was able to solve my problem.
Confirm pliz
Re: LaTeX to PDF
Are you asking me?
The commands I gave were meant for a Windows/DOS batch file, but I didn't actually test it since I don't have LaTeX installed on my Windows partition.
(Of course, writing a bash script that does the same thing for linux is even easier, but would be different.)
If it doesn't work for you, it's a little hard to diagnose without telling me what went wrong.
Run the batch file from the command line, and don't include @echo off, so it shows the actual commands, and copy all the output here, and maybe I can figure out why it isn't working.
"pliz" is not a word.
The commands I gave were meant for a Windows/DOS batch file, but I didn't actually test it since I don't have LaTeX installed on my Windows partition.
(Of course, writing a bash script that does the same thing for linux is even easier, but would be different.)
If it doesn't work for you, it's a little hard to diagnose without telling me what went wrong.
Run the batch file from the command line, and don't include @echo off, so it shows the actual commands, and copy all the output here, and maybe I can figure out why it isn't working.
"pliz" is not a word.
Re: LaTeX to PDF
very confused, why do you need to bother to write a batch to do this.
they are available in the edit software
they are available in the edit software