A Minimal LaTeX Demonstration
This is a minimal example of using LaTeX to typeset a small document.
Install LaTeX from
tug.
Download these two files:
-
latexdemo.tex: example LaTeX input file.
-
latexdemo.bib: example bibliography file.
To run the demo type these commands on the command line:
latex latexdemo
bibtex latexdemo
latex latexdemo
latex latexdemo
dvips latexdemo
ps2pdf latexdemo.ps
open latexdemo.pdf
That's all gathered together in:
-
mk: A Unix script that runs LaTeX and other programs
to create a PDF.
These files are generated:
-
latexdemo.log:
This is the log file from LaTeX that gives information, including
error reports.
-
latexdemo.aux:
This file contains information used by LaTeX, normally you don't look at it.
-
latexdemo.bbl:
This file contains information used by LaTeX, normally you don't look at it.
-
latexdemo.blg:
This file contains information used by LaTeX, normally you don't look at it.
-
latexdemo.dvi:
This is the
device
independent
format used by LaTeX.
It can be viewed with the xdvi program.
To make it into postscript one types:
dvips latexdemo
-
latexdemo.ps:
This is the PostScript result. You can look at it using
ghostscript,
or Previewer on the Mac OS X.
To convert to PDF:
ps2pdf latexdemo.ps
-
latexdemo.pdf:
This is the PDF (Portable Document Format).
You can view it using
Adobe Reader.
I usually use
Skim
(on Mac OS X)
since one can set it to
automatically update when the PDF changes.
-
latexdemo.html: This web page
- It's a little simpler to use pdflatex
which produces PDFs directly
(script:
mkpdflatex).
pdflatex latexdemo
bibtex latexdemo
pdflatex latexdemo
pdflatex latexdemo
open latexdemo.pdf
However,
pdflatex uses pdfs instead of EPS for figures
and cannot use the powerful pstricks.
(See
the wikipedia entry on PdfTex.)
- Under Linux you may be able to use 'xdg-open' instead of 'open'.
Schneider Lab
origin: 2011 Feb 01
updated: 2011 Dec 20