Posts about latex (old posts, page 1)

2009-08-23 List Of Symbols

% Math-mode symbol & verbatim
\def\W#1#2{$#1{#2}$ &\tt\string#1\string{#2\string}}
\def\X#1{$#1$ &\tt\string#1}
\def\Y#1{$\big#1$ &\tt\string#1}

% A non-floating table environment.

% All the tables are \label'ed in case this document ever gets some
% explanatory text written, however there are no \refs as yet. To save
% LaTeX-ing the file twice we go:

\X\alpha        &\X\theta       &\X o           &\X\tau         \\
\X\beta         &\X\vartheta    &\X\pi          &\X\upsilon     \\
\X\gamma        &\X\gamma       &\X\varpi       &\X\phi         \\
\X\delta        &\X\kappa       &\X\rho         &\X\varphi      \\
\X\epsilon      &\X\lambda      &\X\varrho      &\X\chi         \\
\X\varepsilon   &\X\mu          &\X\sigma       &\X\psi         \\
\X\zeta         &\X\nu          &\X\varsigma    &\X\omega       \\
\X\eta          &\X\xi                                          \\
\X\Gamma        &\X\Lambda      &\X\Sigma       &\X\Psi         \\
\X\Delta        &\X\Xi          &\X\Upsilon     &\X\Omega       \\
\X\Theta        &\X\Pi          &\X\Phi

\caption{Greek Letters}\label{greek}

\X\pm           &\X\cap         &\X\diamond             &\X\oplus     \\
\X\mp           &\X\cup         &\X\bigtriangleup       &\X\ominus    \\
\X\times        &\X\uplus       &\X\bigtriangledown     &\X\otimes    \\
\X\div          &\X\sqcap       &\X\triangleleft        &\X\oslash    \\
\X\ast          &\X\sqcup       &\X\triangleright       &\X\odot      \\
\X\star         &\X\vee         &             &\X\bigcirc   \\
\X\circ         &\X\wedge       &              &\X\dagger    \\
\X\bullet       &\X\setminus    &            &\X\ddagger   \\
\X\cdot         &\X\wr          &          &\X\amalg     \\
\X+             &\X-

\caption{Binary Operation Symbols}\label{bin}

\X\leq          &\X\geq         &\X\equiv       &\X\models      \\
\X\prec         &\X\succ        &\X\sim         &\X\perp        \\
\X\preceq       &\X\succeq      &\X\simeq       &\X\mid         \\
\X\ll           &\X\gg          &\X\asymp       &\X\parallel    \\
\X\subset       &\X\supset      &\X\approx      &\X\bowtie      \\
\X\subseteq     &\X\supseteq    &\X\cong        &    \\
  & &\X\neq         &\X\smile       \\
\X\sqsubseteq   &\X\sqsupseteq  &\X\doteq       &\X\frown       \\
\X\in           &\X\ni          &\X\propto      &\X=            \\
\X\vdash        &\X\dashv       &\X<            &\X>            \\

\caption{Relation Symbols}\label{rel}


2009-08-21 setting graphics' path

  • instead of using

  • by including in the front matter (i.e. before \begin{document}):

  • you may simply use

  • one advantage is that you could use context dependent rules, for instance:

       \ifx\pdfoutput\undefined \pdffalse
    \else \pdfoutput=1 \pdftrue \fi
    % portability between LaTeX and pdfLaTeX
    \usepackage[pdftex, pdfusetitle ,colorlinks=false, pdfborder={0 0 0}]{hyperref}%
    \pdfoutput=1 % we are running pdflatex
    \pdfcompresslevel=9     % compression level for text and image;
    % we are using the traditional latex


2009-08-20 some LaTeX tips: drafts, links, margins, pdflatex

checking typographic style

managing margins

  • to adjust margins, use


    then play around with the 2.5cm value until it fits.

  • tips for fitting your text in the required size : LaTeX Tips n Tricks for Conference Paper


  • If you give LaTeX \cite{fred,joe,harry,min}, its default commands could give something like "[2,6,4,3]"; this looks awful. One can of course get the things in order by rearranging the keys in the \cite command, but who wants to do that sort of thing for no more improvement than "[2,3,4,6]"

    • The cite package sorts the numbers and detects consecutive sequences, so creating "[2-4,6]". The natbib package, with the numbers and sort&compress options, will do the same when working with its own numeric bibliography styles (plainnat.bst and unsrtnat.bst).

    • If you might need to make hyperreferences to your citations, cite isn't adequate. If you add the hypernat package:


      See for example

Useful draft tips

using pdfLaTeX

  • X-( sites like arXiV use only plain LaTeX so that you should keep the 2 versions of your directives for better portability (see \ifpdf ...)

    • in particular arXiV rejects the microtype package
  • le package hyperref permet même de faire des références vers les différents chapitres.

  • PDfLaTeX ne permet pas d'inclure des eps pour cela il faut les convertir en pdf avec epstopdf ou le script suivant qui permet de convertir tous les .eps d'un dossier (à sauver et rendre executable):

    for f in $* ;do
        if echo "$f" | grep -i eps*   ; then
             epstopdf --nocompress $f
             echo "converting  $f to pdf ..."
        echo "$f is not a eps file, ignored"

    il suffit alors d'executer en console ./mon_scriptla-ou-ya-tout-mes-eps/*.eps


2009-08-19 Installation TeX

count number of words / compter le nombre de mots

  • Pour compter le nombre de mots et de caractères d'un document latex, il suffit d'installer deTeX et de lancer la simple ligne de commande

    detex MonFichier.tex | wc -w
  • alternatively, you may use

    pdftotext MonFichier.pdf - | wc -w
  • in TexShop there's a "Statistics..." interface to the same technique.

  • on MacOsX, to install appropriate tools, use MacPorts and

    sudo port install detex
    sudo port install xpdf +a4 +with_poppler

including source code in a document with pretty printing

  • use



  • see documentation:

    texdoc attachfile

referring to table or image

  • referring to table or image (and not to the bottom of it)


framed box

  • make a framed box around text (and configure space) :


convert a collection of JPGs to a pdf

  • or
for f in *.jpg ; do convert $f `basename $f .jpg`.pdf ; done
  • or slideshow.tex TeX file
\def\process#1 {\setbox0\hbox{\pdfximage width 20cm {#1}%
  \pdfpagewidth=\wd0 \pdfpageheight=\ht0 \shipout\box0\par}
\everypar{\setbox0\lastbox\process} \input dir \end
ls *.jpg > dir
pdftex slideshow

more fonts

  • on the mac, out of the box with i-installer

    The gwTeX part of this distribution contains all the setup files you need to use a couple of fonts from your Mac. The setup has been created by Thomas A. Schmitz (he did the main work) and Adam Lindsay, hence the naming: gtamacfonts.
    To use these fonts with LaTeX, put e.g. the following in your file:
    Such a style file will make Hoefler Text the serif (roman) text font and Gill Sans the sans serif font. The following basic styles are available:
    There are  more. See the manual for details. For the same effect using ConTeXt, enter e.g.:
    Example documents and a manual can be found in the texmf.gwtex/doc/fonts/gtamacfonts subdirectory. To get the manual you can type "texdoc gtamacfonts" in a Terminal window.
  • Latin Modern


Installation TeX

Tex on MacOsX

  • !TexLive is the most recent /easy distribution. You may add new packages easilly in $HOME/Library/texmf (see a reference) or using the TexLive tool: tlmgr

  • to install :

    sudo installer -pkg MacTeX-2009.mpkg -target /

    (check before on the correct name)

  • I had to set up a new source repository :

    sudo tlmgr option location
  • to upgrade

    sudo tlmgr update --self
    sudo tlmgr update --all