Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

8/22/2011

Latex Typesetting in One Click

I have been writing my Master Thesis using TexWorks. TexWOrks is a decent software for simple documents but as for complicated ones, such as those require bibtex or makeindex, it is not quite convenient because it can only evacuate one command at a time and it does not support customized keyboard shortcut for typesetting. I also tried Latexmk, but seems that it is too complicated and cumbersome to use. So a simpleminded solution would be use batch file (.bat under windows, .sh under linux or Mac).

In windows, if you want to fully typesetting a document, you can put the following code.


latex -interaction=nonstopmode -quiet "%1.tex"
bibtex "%1.tex"
makeindex "%1.nlo" -s nomencl.ist -o "%1.nls"
latex -interaction=nonstopmode -quiet "%1.tex"
latex -interaction=nonstopmode -quiet "%1.tex"
texify --pdf --tex-option=-synctex=1 "%1.tex"

in a ".bat" file to somewhere texworks can find.

It is pretty straight forward. I use latex.exe and suppress any errors because I just want to index the bibliography and my index files (nomencl here for nomenclature). If you use pdf as figure, normally latex will throw some errors unless Finally, after all the indexes are done, I use texify to output pdf.
You can replace latex with pdflatex as follow "pdflatex -synctex=1 -undump=pdflatex -quiet "%1.tex""
But I always feel that latex.exe is faster than pdflatex.