Random Wisdom


The Comprehensive LaTeX Symbol List

by on Aug.22, 2006, under LaTeX

A handy document listing all the symbols possible with latex:


A copy is also available here.

Leave a Comment :, more...

Cropping a PDF Document

by on Jul.31, 2006, under How To ..., LaTeX, Software

Easily accomplished using pdftops:

$ pdftops -paperw WIDTH \
             -paperh HEIGHT \
             -noshrink -expand document.pdf && ps2pdf document.ps

WIDTH and HEIGHT are in points — they basically specify the dimensions of the image to be cropped.

Content is extracted from the center of the page. This technique is specially useful as a bypass for using psfrag with pdfLatex:

  • Save EPS figure with TAGS
  • Create a very simple tex document that simply includes the figure (centered) with psfrag replacements and run latex -> dvips -> ps2pdf
  • Follow the step above to crop out the figure.

The cropped out figure will have the TAGS replaced and be in PDF format — ready to be used with pdfLatex!

UPDATE [16 July 2009] It looks like pdfcrop might actually be a better option:

$ pdfcrop --help
PDFCROP 1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek.
Syntax:   pdfcrop [options] <input[.pdf]> [output file]
Function: Margins are calculated and removed for each page in the file.
Options:                                                    (defaults:)
  --help              print usage
  --(no)verbose       verbose printing                      (false)
  --(no)debug         debug informations                    (false)
  --gscmd <name>      call of ghostscript                   (gs)
  --pdftexcmd <name>  call of pdfTeX                        (pdftex)
  --margins "<left> <top> <right> <bottom>"                 (0 0 0 0)
                      add extra margins, unit is bp. If only one number is
                      given, then it is used for all margins, in the case
                      of two numbers they are also used for right and bottom.
  --(no)clip          clipping support, if margins are set  (false)
  --(no)hires         using `%%HiResBoundingBox'            (false)
                      instead of `%%BoundingBox'
  --papersize <foo>   parameter for gs's -sPAPERSIZE=<foo>,
                      use only with older gs versions <7.32 ()
  pdfcrop --margins 10 input.pdf output.pdf
  pdfcrop --margins '5 10 5 20' --clip input.pdf output.pdf

The tool comes as a part of the ‘tetex’ package.

Leave a Comment :, , , , more...

Working with LaTeX & KPDF

by on Jul.11, 2006, under LaTeX, Linux, Software

KPDF is particularly handy in “watch file” mode. To activate, go to:

Settings -> Configure KPDF…

and check “Watch file” in the General section.

This causes KPDF to watch the file for changes and reload it automatically. Really handy when you don’t want to keep navigating to the old page after an edit and reload ..

2 Comments :, more...

Prosper & PDF Output

by on Feb.24, 2006, under How To ..., LaTeX, Software

Prosper cannot be used with PDFTeX and hence PDF files must be obtained via the DVI -> PS -> PDF route. The default ps2pdf conversion, however, generates a PDF with pages that are a bit too narrow. This is easily remedied by specifying the size of the output desired to the ps2pdf program:


Where ‘x’ is the width in and ‘y’ is the height in 1/72″ units. So, for an approximately A4 size output, ‘x’=595 & ‘y’=842.

Leave a Comment :, , , more...

PSfrag for EPS Graphichs Text Manipulation

by on Jan.17, 2006, under How To ..., LaTeX, Software

There’s a nice package called psfrag that allows you to insert LaTeX constructs into EPS figures. This is specially useful with EPS files saved from MATLAB plots. The way it works is by replacing a given tag in the text of the EPS file with the LaTeX construct.

E.g. label the x-axis of of the plot as XLABEL and save the plot as an EPS file. Then, when you include that file, just put in the \psfrag{}{} tag:


The most obvious disadvantage is that it only works with EPS figures — so no PdfLaTeX. So, to compile a document to PDF, you’ll need to go the old latex -> dvi2ps -> ps2pdf way.

More details can be found on CTAN.

Leave a Comment :, , , , , more...

Prosper (TeX) Tutorials

by on Aug.21, 2005, under LaTeX, Software

Found a couple of prosper tutorials that were particularly helpful:

Leave a Comment :, more...

Changing/Suppressing the “References” title from Bibliographies

by on Aug.20, 2005, under How To ..., LaTeX

The command needed is:

\renewcommand\refname{New title}

This is particularly useful for slides. Found this little trick here.

Leave a Comment : more...