Wednesday, May 12, 2010

BibTeX hacking

I've avoided editing bst files but I finally encountered something that I felt needed to change. When abbreviating the name Foo Bar Baz, the abbrv bibliography style produces
which has too much space between the F and the B for my tastes. After making a copy of abbrv.bst (and renaming it), we can change the argument to the$ function (see Section 18) from "{f.~}{vv~}{ll}{, jj}" to "{f{.\nobreak\,}.~}{vv~}{, jj}" to produce a nonbreaking thin space between the F. and the B. I hope I never again have to edit a a bst.

Sunday, May 9, 2010

Including overly large graphics

Sometimes a graphic (or table or what have you) is simply too large to fit on the page without extending into the margins. Here's a simple way to center the graphic in the page without getting any Overfull hbox warnings.
\hbox to\textwidth{\hss\includegraphics{foo}\hss}%
The two \par aren't really essential. They're just to ensure the graphic is in a paragraph by itself. Replace \includegraphics with any other centered material. Note that this actually causes the graphic to extend an equal amount into the margins. If the margins aren't the same size, this is not centering on the page, but it's probably what you want anyway.