Installation TeX

Some useful bits of \LaTeX code accumulated over the years...

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