Wednesday, June 30, 2010

Automatic Positioning of Superscript References in Latex

Some publications require superscript references and some numeric, inline references. The first should appear like

blah blah.^{1}

and the second like

blah blah [1].

For AIAA publications, this is obnoxious because conference papers are like the first, but journal pubs are like the second. Instead of manually changing the position of the \cite{} command follow the convention in the .tex file

blah blah \cite{somedude2001}. (sentence+space+\cite{}+punctuation)

then invoke the natbib and natmove command like the first two lines suggest

\usepackage[numbers,sort&compress]{natbib}
\usepackage{natmove} % This command moves superscript references after the punctuation mark regardless of where the \cite command appears
\usepackage{hypernat}
\bibpunct{}{}{,}{s}{}{} % superscript citation

This functionality can also be achieved with the \usepackage[super]{cite} command but this overwrites the sort&compress and hypernat commands.

\bibpunct specifies all the delimiters and styles to be used with the reference numbers. Change the 's' to 'n' for inline numbers. Google it!

1 comment:

Unknown said...

This is cool, thanks.