Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

macro for abbreviation of paper

24 views
Skip to first unread message

Phillip Helbig (undress to reply)

unread,
Feb 22, 2017, 3:16:36 PM2/22/17
to
Using natbib, with something like

\citet[hereafter NC15]{MNorrisKCarlsson83a}

one could use "NC15" hardcoded in the text if the paper is referred to
many times, rather than the normal citation. However, recycling the
text where this is not desired would mean manual changes. Is there a
way to have the citation be the same as far as the LaTeX code all the
time, but optionally---perhaps by redefining the macro in the
header---have it either print the standard format every time or just the
first time and the abbreviation on subsequent occurrences?

jon

unread,
Feb 22, 2017, 9:06:47 PM2/22/17
to
you could create your own. this is somewhat inflexible, but it shows the
basic idea:

\documentclass{article}

\usepackage{etoolbox}
\newbool{firstuse}
\booltrue{firstuse}

\newcommand{\longshort}{% <-- need arguments?
\ifbool{firstuse}%
% true: do long citation, and set to false:
{\texttt{\string\citet[hereafter NC15]{MNorrisKCarlsson83a}}%
\boolfalse{firstuse}}%
% false: just use shortform
{NC15}%
}

\begin{document}

First use: \longshort.

Second use: \longshort.

Reset? \booltrue{firstuse}

`First' use: \longshort.

\end{document}

a better option, if your workflow can handle it, is to use biblatex
(and -- though not required -- biber), which has a 'shorthand' field.

cheers,
jon.

Arash Esbati

unread,
Feb 23, 2017, 4:56:35 AM2/23/17
to
You could use citation aliasing (section 2.6 in manual) which is
provided by natbib:

% in your premable
\defcitealias{MNorrisKCarlsson83a}{NC15}
%
% in your text
\citetalias{MNorrisKCarlsson83a}

Best, Arash
0 new messages