Sunday, December 30, 2012

TeX capacity exceeded

The desktop at home has some old TeX components from 2007 installed on it.

Trying to build a 2674-page PDF caused TeX to crash with the message "TeX capacity exceeded!" and a notice that [save size = 5000].

Googling around showed that the necessary file to change is texmf.cnf which find then showed to be at /usr/local/textlive/2007/texmf/web2c/texmf.cnf on my machine.

The first line that needed to be changed was this:

save_size = 5000 % for saving values outside current group %%% OLD
save_size = 50000 % for saving values outside current group %%% NEW

Rebuilding then caused TeX to fail later in the process with the same "TeX capacity exceeded!" message but pointer to the pool size. So the next line that needed to be changed was this:

pool_size = 1250000 %%% OLD
pool_size = 3250000 %%% NEW

(In both cases the values were taken from the newer (2009) TeX install on the laptop at home.)

Making the two changes above enabled the 2674-page PDF to build perfectly.

Note that now commands were necessary to make the texmf.cnf changes take effect. Just save the file and rerun TeX.

Saturday, July 3, 2010

BibTeX author names

Articles with more than three or four authors present may present something of a bibliographic challenge. Consider "Association of polymorphisms in the CRP gene with circulating C-reactive protein levels and cardiovascular events" in JAMA 296(22). The article features 15 separate authors on the first page. But the coversheet JAMA provides at the front of the PDF provides only the first three authors plus 'et al.' for purposes of citation.

How to get BibTeX to play along?

The short answer:

@Article{ Lange:2006,
title = "Association of polymorphisms ...",
author = "Lange, Leslie A. and
Carlson, Christopher S. and
Hindorff, Lucia A.
and others",
journal = "Journal of the American Medical Association",
year = "2006",
volume = "296",
number = "22",
pages = "2703--2711"
}

APA-style BibTeX output looks like this:

[Lange et al., 2006] Lange, L. A., Carlson, C. S., Hindorff,
L. A., et al. (2006). Association of polymorphisms in the
CRP gene with circulating C-reactive protein levels and
cardiovascular events. Journal of the American Medical
Association, 296(22):2703–2711.

Two tricks here.

First, the BibTeX author field only ever comprises a single string enclosed in double quotes. But note that the BibTeX author field may comprise arbitrarily many authors delimited by 'and'.

Second, the BibTeX author field recognizes the special phrase 'and others' as a directive to append 'et al.' to the end of the list of named authors in the bibliography. This matters because this would appear to be the only way to get BibTeX to list the names of only 3 of 15 authors of an article, with the 12 unnamed authors given only as 'et al.'.

Tuesday, January 13, 2009

Turning off the first page number in LaTeX

The standard command to turn off page numbering in LaTeX is

\pagestyle{empty}

which fails to work for the first page.

The standard command to turn off page numbering for the first page is

\thispagestyle{empty}

which also fails to work for the first page unless you place the command immediately after \maketitle.

Taken from here.

Monday, May 12, 2008

LaTeX caption alignment

Captions usually center justify. The caption package customizes caption alignment with the justification and singlelinecheck parameters of \captionsetup.



\documentclass[10pt]{article}
\usepackage{caption}
\captionsetup{justification=raggedright, singlelinecheck=false}
\begin{document}
\begin{table}[h]
\begin{tabular}{|ccccc|}
\hline
\textit{decimal} && \textit{binary} && \textit{musical} \\
\hline
&&&& \\
$\frac{1}{2^{-1}}$ &=& $\frac{10}{1}$ &=& \lily{c\breve*1/8} \\ [6pt]
$\frac{1}{2^{0}} $ &=& $\frac{1}{1}$ &=& \lily{c1*1/4} \\ [6pt]
$\frac{1}{2^{1}} $ &=& $\frac{1}{10}$ &=& \lily{c2*1/2} \\ [6pt]
$\frac{1}{2^{2}} $ &=& $\frac{1}{100}$ &=& \lily{c4} \\ [6pt]
$\frac{1}{2^{3}} $ &=& $\frac{1}{1000}$ &=& \lily{c8} \\ [6pt]
$\frac{1}{2^{4}} $ &=& $\frac{1}{10000}$ &=& \lily{c16} \\ [6pt]
\hline
\end{tabular}
\caption{Binary equivalences.}
\end{table}
\end{document}

Input without \captionsetup and the caption package centers the caption at page middle, bad for narrow tables.

LaTeX guillemets

French guillemets are possible together with English open- and close-quotes. Use babel together with \og and \fg.



\documentclass[10pt]{article}
\usepackage[french]{babel}
\begin{document}
L\`a dans \textit{Le marteau sans ma\^itre,
\og Artisanat furieux \fg} o\`u se trouve \dots
\end{document}

Five lines above give a minimal example.

Tuesday, May 6, 2008

LaTeX landscape

Rendering LaTeX in landscape means mucking with dvips and ps2pdf on most systems. These four lines work under OSX.

`which latex` foo.tex
`which dvips` -Ppdf -t landscape foo.dvi
`which ps2pdf` foo.ps
open foo.pdf

Make sure the LaTeX source starts with something like \documentclass[landscape,letterpaper]{article} and make sure the which subshells return real applications.

LaTeX line "justification"

Start with \hyphenpenalty=10000 to forbid hyphenation (almost) completely and you'll get fully-justified lines (which is good) and -- sometimes -- words that extend beyond the right margin (which is unacceptable). Add \tolerance=10000 and LaTeX will "tolerate" interword spacing and flush both left and right margins again.