Yet another LaTeX guide

You can found tons of usefull LaTeX tips with google so I decided to gather them in a single page.

Stuff to install

Here the packages you need to install :

emerge tetex latex-unicode latex2html

How the beast works

Commands to know

Compiling a .tex document is basicly done with :

stan@hermes ~ $ latex myDocument.tex

You have to repeat this command three time to generate the bibliography, the references and the table of contents.

The output is myDocument.dvi that you can open in xdvi. You can convert it in the postcript format :

stan@hermes ~ $ dvips myDocument.dvi

And then in pdf :

stan@hermes ~ $ ps2pdf myDocument.ps

But personally, I prefer the .tex to .pdf process :

stan@hermes ~ $ pdflatex myDocument.tex

which allows us to use jpeg, png etc directly in the .tex.

Document organization

Play with the fonts

Create some tabs

Including pictures

I personally use pdflatex to produce my pdf from the .tex. The big advantage is that allows me to include png files which is a big advantage rather than handling postscript or pdf pictures files which are complicated to generate and give a crappy result.

Adding reference in your text to a figure

 
Take a look at the incredible figure~\ref{network_asynchronous_step1} !!
 
\begin{sidewaysfigure}[!hbp]
  \center
  \includegraphics[scale=0.2]{pictures/theory/network_asynchronous_step1.png}
  \caption{a legend}
  \label{network_asynchronous_step1}
  \end{sidewaysfigure}
 
\clearpage
 

Placement

The LaTeX compilation place (sometimes) the figures everywhere except the place you want. And the [!h] does not do the trick. Play with the \clearpage command to force LaTeX to place the figure in the queue.

\begin{sidewaysfigure}[!hbp]
  \center
  \includegraphics[scale=0.2]{pictures/theory/network_asynchronous_step1.png}
  \caption{a legend}
  \label{network_asynchronous_step1}
  \end{sidewaysfigure}
 
\clearpage
 

Landscape orientation

Including a figure in a landscape flag give some weird results so my advice is the rotating package and insert a figure like that :

\begin{sidewaysfigure}[!hbp]
  \center
  \includegraphics[scale=0.2]{pictures/theory/network_asynchronous_step1.png}
  \caption{...}
  \label{network_asynchronous_step1}
  \end{sidewaysfigure}
 

Template

\documentclass[a4paper,11pt]{article}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{lscape}
\usepackage{listings}
\usepackage{rotating}
 
\begin{document}
\usefont{T1}{phv}{m}{n}
\setlength{\parindent}{0pt}
\setcounter{tocdepth}{2}
 
\author{Stanislas GUERRA}
\title{Pyskl : User's guide}
 
\maketitle
\thispagestyle{empty}
\vfill
\pagebreak
\setcounter{page}{1}
 
 
\tableofcontents
\vfill
\pagebreak
 
\listoffigures
\pagebreak
 
\lstlistoflistings
\pagebreak
 
\part*{Introduction}
\addcontentsline{toc}{part}{Introduction}
  \section*{ ?}
 
 
 

Links

 
gnu/latex/guide_en.txt · Dernière modification: 2007/02/12 23:43
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki