Showing posts with label dvi. Show all posts
Showing posts with label dvi. Show all posts

Sunday, March 22, 2009

How to compile LaTeX file

Here are the typical steps to produce DVI, PostScript or PDF file from a LaTeX source file:

  1. Create the LaTeX source file. It must be in the plain ASCII format. Simple text editor like Notepad, VIM or Emacs would be fine. Please do not use word processor like Microsoft Office.

  2. Run LaTeX on the LaTeX source. Any warning or error will be reported, if exists. If the source file contains table of contents, or references, you may need to run the above command several times. If you are lucky, you will get a DVI file, called yourfile.dvi. To view it, use dvi viewer like xdvi or Yap.
    latex yourfile.tex

  3. To convert the DVI file to PostScript format, run
    dvips -Pcmz yourfile.dvi -o yourfile.ps

  4. To produce a PDF file, you don't need to do step 1. Just run
    pdflatex yourfile.tex

  5. To produce a PostScript file from a PDF file,
    pdf2ps yourfile.pdf newfile.ps

  6. To produce a PDF file from a PostScript file,
    pdf2ps yourfile.ps newfile.pdf

Wednesday, April 16, 2008

Compiling LaTeX on Windows: An alternative method

The usual method to compile latex is by using "latex" command, and if the latex file contains bibliography, it will be a very tedious and repetitive job.

To produce a dvi file:
latex yourfile.tex
bibtex yourfile.tex
latex yourfile.tex
latex yourfile.tex

To produce a pdf file:
pdflatex yourfile.tex
bibtex yourfile.tex
pdflatex yourfile.tex
pdflatex yourfile.tex

However, for the windows user, with Miktex, there is an alternative that could simplify all those tasks - the texify.

To produce a dvi file"
texify yourfile.tex

To produce a dvi file and clean all the auxilary files:
texify -c yourfile.tex

To produce a pdf file (to clean all the auxilary files, just add -c as above):
texify -p yourfile.tex

To produce a dvi file and run the default viewer (add -p for pdf)
texify yourfile.tex --run-viewer