Posts Tagged ‘ tex ’

Precompile pgfplots using tikzexternalize

Using pgfplots allows you to quickly create very beautiful plots, that look like they belong to your paper, by automatically using the correct fonts and styles. It does this by using the latex compiler to make the figures. This approach is very powerful but has a major drawback: the latex compiler was not made to do this. As a result, latex tends to run out of memory very fast, and projects with a lot of pgfplots tend to take a long time to compile.

We’ve previously shown how to increase the amount of memory latex has available, but this only solves half the problem.

A proper way to fix this is using the tikzexternalize command. It causes latex to compile the figures in a separate run, generating pdfs. These pdfs are then included in the main document, reducing both the memory requirements and the compilation time.

Using tikzexternalize is very simple, two step process

  1. Call latex with the “shell-escape” option.
    This looks like this on linux:

    pdflatex -shell-escape mydocument.tex

    The easiest way to do this is to modify the build command of your latex-editor of choice.

  2. Add the following lines of code to your latex preamble

    \usepgfplotslibrary{external} 
    \tikzexternalize[prefix=TikzPictures/]
    

    The first line loads the tikzexternalize library, the second line activates it. The second line also contains an option that specifies the folder where the resulting pdfs and intermediary files should be stored.

Latex will now externalize any tikzpicture you make. You can optionally use

\tikzsetnextfilename{name_of_resulting_pdf}

to specify a name for the resulting pdf file. This is strongly recommended, because latex will only recompile a figure if you remove the resulting pdf.

Advertisements

Latex formula as a native powerpoint object

It’s always a dilemma: latex is great for formulas but well, not so much at making slideshows or posters. Powerpoint on the other hand is great at the latter, but sucks balls at the first. No matter which tool you use to create your powerpoint, a lot of frustration, broken coffee mugs and hairloss ensues. Wouldn’t it be great if you could just typeset formulas in powerpoint using latex?

Enter: Tex 4 PPT
It renders your latex formula in the native ppt vector format. This means that it’ll look good at any resolution.

It requires a working Miktex install and microsoft’s .net framework.