Patrick's Blog
Illustrations in LaTeX
March 9th, 2008I really like books with great illustrations (great here means that the font should be the same as in the text etc, probably the best example of such a book is the “The Art of Computer Programming” by D. Knuth). I thus hardly ever felt happy with drawing things in a vector graphics program and always chose to program/typeset the graphics in some sort of programming language. In the past years I’ve played around with different packages/programs for doing this; the list includes:
- Matlab. I like it a lot for prototyping, but the plots usually look crappy. Same is true for the open source alternative octave.
- Gnuplot. Very powerful but the standard outputs usually look really bad.
- PSTricks. Some very impressive examples, but sucks when used in combination with PDF.
- PyX. From the website: “PyX is a Python package for the creation of PostScript and PDF files.” While I liked the Python environment and the power it gives you, it lead to problems when I wanted to include the plots in presentations: the fonts don’t agree or it’s harder to draw edges to other elements on the slides. It just lacked the integration with LaTeX. Note: it’s possible to work around some of the issues like for example the font problem, but usually it feels quite hacky.
- PGF/TikZ. As it’s from the same author who wrote the excellent Beamer package for presentations it integrates nicely with LaTeX and Beamer. It’s supposed to work with both DVI/PS and PDF. They recently released version 2 and by looking and the documentation you can immediately realize the sheer power this package has, especially for drawing general illustrations. It became my tool of choice about a year ago for drawing graphical models and such like, I however didn’t like the plot environment so much (it’s hardly existing at all).
This weekend I then finally played around with the Gnuplot TikZ terminal which addresses my last issue with PGF/TikZ: plotting functions and data. With this tool you can use gnuplot to create the actual plotting scripts and also to create the illustrations. However, instead of producing for example a PDF, the terminal outputs a .tex file that can then be included in the LaTeX document. The actual drawing in the document is then done by PGF/TikZ. The results look truly awesome. The installation is still a little bit messy as it needs the yet unreleased gnuplot 4.3 CVS.
Posted in academics, latex | 3 Comments »
Convert all eps in current directory to pdf’s
July 4th, 2007I often have to convert graphics etc. in a certain directory to some other format. The loop below shows how to do this. This is trivial, but as I don’t use it often enough, I keep forgetting the exact syntax and thus have to google for it each time, which sucks balls.
for f in $( find . -name '*.eps' ); do
epstopdf $f
done
Another very useful one-liner:
for f in $( find . -name '*.pdf' ); do ps2pdf14 -dPDFSETTINGS=/prepress $f temp.pdf; mv temp.pdf $f; done;
this will embed all the fonts in the PDFs.
Posted in latex, linux | 1 Comment »
Some customization hints for beamer
July 20th, 2006You can find them here.
Posted in latex | Comments Off
An essential LaTeX package for computer scientists: algorithm2e
July 20th, 2006One LaTeX package I find particular useful is algorithm2e. As it is not included in tetex I installed it on my workstation:
pat@merkur:/~# mkdir ~/texmf/tex/latex/algorithm2e
pat@merkur:/~# cp algorithme2e.sty ~/texmf/tex/latex/algorithm2e
pat@merkur:/~# texhash
Now you (i.e. the user that just did the steps above) can use a simple \usepackage{algorithm2e} in your documents and LaTeX should find the package on its own.
Posted in latex | Comments Off
LaTeX Beamer Themes
July 17th, 2006Beamer ships with several different themes, however selecting one that suits your needs is a tedious task (change the theme, compile, open it with acrobat again and again). Maybe this will help you: Beamer Themes overview.
Posted in latex | Comments Off
Beamer tutorial
March 5th, 2006I just posted some information about the creation of slides with the excellent LaTeX beamer class. It is however not a real tutorial, but rather a description of my workflow. And it isn’t finished yet, so maybe of limited help at the moment… I hope I can add some more information soon.