Discussion:
macro for abbreviation of paper
2017-02-22 20:16:30 UTC
Raw Message
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
2017-02-23 02:06:44 UTC
Raw Message
Post by Phillip Helbig (undress to reply)
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?
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
2017-02-23 09:55:43 UTC
Raw Message
Post by Phillip Helbig (undress to reply)
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?
You could use citation aliasing (section 2.6 in manual) which is
provided by natbib: