LaTeX: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
Line 39: Line 39:


* There is also a \begin{flushleft} environment, of course. To center a block, use the \begin{center} command.
* There is also a \begin{flushleft} environment, of course. To center a block, use the \begin{center} command.
* You can align a section title like this:
\section*{\begin{center}STATUTS\end{center}}


= Tools =
= Tools =

Revision as of 13:23, 11 August 2008

LaTeX is a fantastic typesetting package. Unfortunately it has a big problem: not a lot useful documentation. So this is a collection of useful tips I have learnt while spending a lot of time googling for LaTeX documentation.

Documentation

  • I found the following tutorials, books or cheatsheets useful:
    • The Not So Short Introduction to LaTeX 2e (general introduction).
    • TeX for the impatient (more complete book).
    • Latex cheat sheet (very useful list of commands).
  • They are free and available online.

Techniques

Choosing a document class

  • The letter class is not recommended, because it does not allow you to use sections, subsections, etc. The article class can be used as a general purpose class, it's not mandatory to have a title, abstract or bibliography.

Spacing and Page breaks

  • Use \pagebreak to make a page break.

Symbols

  • To use the Euro symbol, use \usepackage[official]{eurosym}. You can then write the symbol with the command \euro, or use \EUR{50} to directly write a monetary amount.

Font size and style

  • Use the commands \tiny, \large, \Large, \huge to change the font size.
  • Use {\bf } for boldface, {\it } for italics.

Alignment

  • By default LaTeX justifies a paragraph. Should you need to have it aligned use:
\begin{flushright}
This is some text.
\end{flushright}
  • There is also a \begin{flushleft} environment, of course. To center a block, use the \begin{center} command.
  • You can align a section title like this:
\section*{\begin{center}STATUTS\end{center}}

Tools

LaTeX Distribution

  • As of 2008, the best available distribution for Linux/UNIX seems to be TexLive (version 2007, 2008 is not released yet). It has a stable ebuild for Gentoo Linux (the old tetex distribution is now obsolete).

Eclipse Support (via Texlipse)

  • The support is good overall. It allows you to mix freely *.tex files within another project (with PHP files for example). It will configure a LaTeX builder for the project, which will build your document. However, it is intended that only one document is created (although you can combine multiple source TeX files to create it).
  • Check the project properties to define which is the main LaTeX source file and which document will be built. You can also define what program will be used for the build (pdflatex etc).