Personal tools

Difference between revisions of "Latex"

From MohidWiki

Jump to: navigation, search
Line 72: Line 72:
In the text:
In the text:
  Let's talk about cheese \index{cheese}
  Let's talk about gouda \index{cheese!gouda}
  Let's talk about crackers to go with cheese \index{cheese|see{crackers}}
=== Nomenclature Table ===
=== Nomenclature Table ===

Revision as of 11:52, 16 September 2009

The (in)famous scientific text-processor. Good for producing high quality documents in scientific and literary areas. You can also use a subset of latex commands in this wiki editor for producing mathematical formulas.



  1. Download and install <goto>miktex</goto>, the latex processor for windows,
  2. Download and install <goto>ghostscript</goto>, the postscript processor,
  3. Download and install <goto>ghostview</goto>, the postscript viewer,
  4. Download and install <goto>acrobat reader</goto>, the pdf reader (only if it isn't already installed),
  5. Download and install <goto>winedt</goto>, the popular latex text-editor,
  6. Download <goto>winedt dictionaries</goto> for spelling auto-correction,
  7. Unzip the dictionaries somewhere in a folder,
  8. To configure winedt with the dictionaries do
Add new dictionary (black upside down triangle icon),
Give it a name,
Open the .dic file (farther right open folder icon); should appear in the definition text-area, 
Then load the dictionary (farther left open folder icon),
Tick load on start, save on exit, add new words,
Tick enabled,
Save configuration as a .dat file (farther left save disk icon) in some folder.

That's it!

Available documentation

I heartily recommend:

  • <goto>The Not So Short Introduction To Latex</goto>,
  • <goto>Uma Não Tão Pequena Introdução Ao Latex</goto> (same, but in portuguese),
  • wikibook on Latex.

Difference between latex and pdflatex

Advantages of pdflatex over simple latex:

  • allows for hyperlinked hyperlinked table of contents,
  • includes png graphics


  • doesn't include ps files. Have to be converted to pdf
  • From a original ps files, final pdf size of document is higher (This was tested with a 730.3 kB ps figure, which gave a 151 kB pdf document with latex/dvi2pdf and 153.5 kB with pdflatex)

Useful tips

Commandline syntax

Compile and create dvi file

> latex main.tex

Compile and create pdf file

> pdflatex main.tex

Create postscript file

> dvi2ps main.dvi

Create pdf file

> dvipdf main.dvi

Create a bibliography

> bibtex main
> latex main.tex
> latex main.tex

NOTE: Do it twice.


Here you'll find a full latex template.


Here you'll find a useful makefile.

Links in Table Of Contents



Add to preamble


Add to main (after bibliography):


In the text:

Let's talk about cheese \index{cheese}
Let's talk about gouda \index{cheese!gouda}
Let's talk about crackers to go with cheese \index{cheese|see{crackers}}

Nomenclature Table

Use nomencl package from CTAN.

Add to preamble:


Add to main (after \tableof contents):


In the text:

bla bla bla 
numerical weather prediction (NWP) \nomenclature{NWP}{Numeric Weather Prediction} models are very good.
bla bla bla

The make file must have 2 prior calls to pdflatex and then makeindex like below:

FILE = 00_main
TEXFILE = "$(FILE).tex"

       pdflatex $(TEXFILE)
       bibtex $(FILE)
       pdflatex $(TEXFILE)
       pdflatex $(TEXFILE)
       makeindex $(FILE).nlo -s -o $(FILE).nls
       pdflatex $(TEXFILE)

       @rm -f *.aux *.lof *.log *.lot *.nlo *.nls *.out *.pdf *.toc *.bbl *.blg *.bak *.sav


Side by side:

    \begin{figure}[htb] % Duas figuras lado a lado
       \begin{minipage}[b]{0.48 \linewidth}
      \begin{minipage}[b]{0.48 \linewidth}


        \includegraphics[width=0.5 \textwidth]{#1}\includegraphics[width=0.5 \textwidth]{#2}\\
        \includegraphics[width=0.5 \textwidth]{#3}\includegraphics[width=0.5 \textwidth]{#4}\\


Example with MOHID hierarchical structure (download eps_image/code). The image was made with latexdraw, which is a visual interface that produces the pspicture code. To compile: latex -> dvips.

Latex editors

  • Winedt, commercial, windows.
  • TexnicCenter, free, windows.
  • Texmaker, free, cross-platform.
  • vi, free, gnu distros.


P : When I convert my document to pdf I get deteriorated fonts and a poor readibility!

A: Check if you're using


If so, then that's your problem. Either erase it (not recommended) or simply add this extra package


Recompile your tex file and convert it to pdf, and that should do the trick.

External references

  • Wikipedia
  • <goto>Miktex</goto>
  • <goto>Winedt</goto>
  • <goto>The Not So Short Introduction To Latex</goto>
  • <goto>CiteULike</goto>
  • <goto>Comprehensive TeX Archive Network</goto>
  • wikibook on latex