Archive for the ‘LaTeX’ Category

LaTeX – Customize page numbering

October 4, 2006

For changing the default, centered page numbering, use the fancyhdr package:

\fancyhf{} % clear all header and footer fields
\fancyfoot[R]{\footnotesize Page \thepage\ of 2}

This will print the page number on the right side of the footer, smaller font and in the format “Page % of 2”.

Emacs – LaTeX – smart .dvi view

July 26, 2006

Add this line to .emacs:

(setq TeX-source-specials-view-emacsclient-flags “-c –no-wait +%%l %%f”)

Press C-c C-c view while editing a LaTeX file and it lunches the .dvi viewer. If you click in the viewer the editor is positioned where the text you clicked is.

Double spacing in LaTeX

July 26, 2006

Add at the beginning:


Then switch between different spacing options with:


For other sizes use the \setstretch command like this:


LaTeX – a nice “remainder” command

July 25, 2006

Define this command:

{ [[[ {\bf\marginpar{\mbox{$<==$}} #1 } ]]] }

Now use it like this:

\reminder{Add a figure, blah, blah}

The text “Add a figure, blah, blah” will appear in bold, between “[[[” and “]]]” and will have an arrow (“<==”) pointing to in on the border.

Emacs – edit LaTeX

July 20, 2006

C-c = table of contents (F long version)
C-c [ insert a citation
C-c ) insert a reference
(setq TeX-source-specials-view-emacsclient-flags “-c –no-wait +%%l %%f”)

safe local variable warning:
(put ‘Tex-master ‘safe-local-variable t)

Font problems in pdfs

July 20, 2006

for embedded font problems in pdf files (under Linux)
see *Download* options /var/lib/texmf/web2c/updmap.cfg
and /etc/texmf/updmap.d/00updmap.cfg
or the -Pdownload35 option to dvips
use dvipdfm instead of dvips

Paper size in xdvi, dvips

July 20, 2006

xdvi and dvips use the European A4 size as default papersize. How
do I change this to make letterpaper the default?

Simple answer: use texconfig:

texconfig dvips paper letter
texconfig xdvi us

Flowing Text Around Figures in LaTeX

July 20, 2006

There are several LaTeX packages that purport to do this, but they all
have their limitations because the TeX machine isn’t really designed
to solve this sort of problem. Piet van Oostrum has conducted a survey
of the available packages; he recommends:


floatflt is an improved version (for LaTeX2e) of floatfig.sty,
and its syntax is:

\begin{floatingfigure}[options]{width of figure}
figure contents

There is a (more or less similar) floatingtable environment.

The tables or figures can be set left or right, or alternating
on even/odd pages in a double-sided document.

The package works with the multicol package, but doesn’t work
well in the neighbourhood of list environments (unless you
change your LaTeX document).


wrapfig has syntax:

\begin{wrapfigure}[height of figure in lines]{l|r}[overhang]{width}
figure, caption, etc.

The syntax of the wraptable environment is similar.

Height can be omitted, in which case it will be calculated by
the package; the package will use the greater of the specified
and the actual width. The {l,r,etc.} parameter can also be
specified as i(nside) or o(utside) for two-sided documents, and
uppercase can be used to indicate that the picture should
float. The overhang allows the figure to be moved into the
margin. The figure or table will entered into the list of
figures or tables if you use the \caption command.

The environments do not work within list environments that end
before the figure or table has finished, but can be used in a
parbox or minipage, and in twocolumn format.


pdf readable fonts

July 20, 2006

To create fonts readable in pdf from Latex:
dvips -Pcmz file.dvi -o