Archive for March, 2010

Extending latex memory

Latex is a very powerful typesetting application. A powerful package to be used with this is pgfplots, which allows you to render your plots using the latex engine. Unfortunately the default latex settings assume you’re running latex on an ancient 20 MHz 486 with less ram than your average mobile phone. This is ok if you’re just asking it to process text, but if you’re using pgfplots it will run out of memory trying to draw your images.

The solution is to increase the amount of memory latex uses.

Windows – Miktex
We’re doing this in the windows command line. You can get to this by opening the start menu and do run .... Type cmd to start the terminal. On vista and up, you can just type cmd in the search field.

  1. Go the folder where Miktex is installed. Most likely this is C:\Program Files\Miktex 2.7\
  2. Go to the subfolder Miktex
  3. Go to the subfolder bin
  4. run
    initexmf --edit-config-file=pdflatex
    

    Replace pdflatex with latex or xetex if you’re using that.

  5. You’ll get a notepad screen with a file called pdflatex.ini. Add the line
    main_memory=2000000
    

    Don’t worry about the exact number, just make it big.

  6. Save the file
  7. run
    initexmf --dump=pdflatex
    
  8. That’s it. Enjoy your nice pgfplots figures

Linux – Texlive
Do the following things in a terminal as root.

  1. Find out where your texmf.cnf is located
    kpsewhich texmf.cnf
    

    This will most likely be /usr/share/texmf/web2c/texmf.cnf

  2. Open it and search for main_memory line and modify it to
    main_memory=2000000
    
  3. Save the file
  4. run
    fmtutil-sys --all
    

    to load the new settings

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.