10

When writing, I like to introduce an abbreviation for the whole citation. On the first instance, I would write "This is true as shown in (nbren12, et. al. 2012) (hereafter NB12)". In the subsequent usages, I would just say "This fact is true (NB12)". How can I implement this automatically using bibtex (or biblatex)?

This is similar but not identical to this question.

4
  • That should be doable with biblatex? Do you use biblatex? If so what style do you use? If not, what style would you like to use (just a simple author-year style by the looks of it)?
    – moewe
    Sep 30 '14 at 17:34
  • I am using the springer svjour3 latex template which has natbib style commands. Not sure if I can use biblatex, but I would be interested in a biblatex solution either way.
    – nbren12
    Sep 30 '14 at 17:41
  • I think you could just achieve it with biblatex and alphabetic style. Just check page 83-88 in the manual to see the various citation commands provided. Sep 30 '14 at 19:02
  • I'm pretty sure that then biblatex is out of the question, but I'll add a solution anyway. (Just an aside though: If you use the svjour3 template, you probably ought to adhere to the bib/citation style of that template.)
    – moewe
    Oct 1 '14 at 5:29
12

It is described clearly in the manual of natbib on page 3.

Use command:

\defcitealias{nbren12}{NB12}

After that, in addition to classic citing \citet{} or \citep{}, you can also use:

\citetalias{nbren12}
% or
\citepalias{nbren12}

Example

In example.tex I have:

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike}

\begin{document}

\defcitealias{jd14}{JD14}

In text \citet{jd14}. Or in brackets \citep[][hereafter JD14]{jd14}.

Now I cite it in text as \citetalias{jd14} and in brackets \citepalias{jd14}.

\bibliography{mybib}

\end{document}

and in mybib.bib I have:

@article{jd14,
  author={Doe, J. and Smith, J. and Bar, F.},
  title={Some title},
  journal={Some journal},
  year={2014},
}

and the output is:

enter image description here

And if you want the alias to appear in e.g. italics, but not page numbers etc. you can write e.g. \defcitealias{jd14}{{\itshape JD14}}.

3
  • @egreg Can you, please, be more specific? I am used to do it, because I am looking for 99% of references at ADS. From there I can directly export the BibTeX entries and last names are always inside {}. Thanks. Sep 30 '14 at 21:54
  • 1
    I simply don't know what's the rationale for this choice; there's no reason for it and it just makes BibTeX work more.
    – egreg
    Sep 30 '14 at 22:04
  • This is a great answer to the question as I wrote it. I was also thinking about mixing aliased and non aliased citations like (NB12; nbren12, et al 2014) using some \cite????{NB12,NB14} type command. (\citetalias{NB12};\citealp{NB14}) is too verbose for my tastes.
    – nbren12
    Oct 1 '14 at 21:16
8

biblatex has the built-in standard macro shorthandintro that can do this. In the .bib file one will then add the shorthand field and give the short citation name there, like this

@article{jd14,
  author  = {Doe, J. and Smith, J. and Bar, F.},
  title   = {Some title},
  journal = {Some journal},
  year    = {2014},
  shorthand = {JD14},
}

The only thing that remains to be done is to make sure this macro is only called when it is appropriate. While there are some styles that already use shorthandintro, the plain authoryear and authortitle styles do not.

We well see how one can modify the authoryear so it uses the shorthand intro. The default cite macro for authoryear can be found in authoryear.cbx.

The main citation part that is used if no shorthand is present can be out-sourced into a new macro longcite

\newbibmacro*{longcite}{%
  \ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
    {\usebibmacro{cite:label}%
     \setunit{\addspace}}
    {\printnames{labelname}%
     \setunit{\nameyeardelim}}%
  \usebibmacro{cite:labelyear+extrayear}}

Then the actual cite macro is changed to print a long citation and shorthand introduction at first cite (obviously the introduction is only printed if a shorthand is actually present) and the shorthand or long (normal) citation on subsequent citations.

\renewbibmacro*{cite}{%
  \ifciteseen
    {\iffieldundef{shorthand}
      {\usebibmacro{longcite}}
      {\usebibmacro{cite:shorthand}}}
    {\usebibmacro{longcite}
     \usebibmacro{shorthandintro}}}

In order to be able to use the \ifciteseen test, we will have to enable the citetracker (for example via citetracker=true).

Other citation styles use different cite macros and the modifications will have to be different then, also this modification does not currently work with \textcite.

MWE

\documentclass[british,a4paper]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber,style=authoryear,citetracker=true]{biblatex}

\begin{filecontents*}{\jobname.bib}
@article{jd14,
  author  = {Doe, J. and Smith, J. and Bar, F.},
  title   = {Some Title},
  journal = {Some Journal},
  year    = {2014},
  shorthand = {JD14},
}
@article{jd13,
  author  = {Doe, J. and Smith, J. and Bar, F.},
  title   = {No shorthand here},
  journal = {Some Other Journal},
  year    = {2013},
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\newbibmacro*{longcite}{%
  \ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
    {\usebibmacro{cite:label}%
     \setunit{\addspace}}
    {\printnames{labelname}%
     \setunit{\nameyeardelim}}%
  \usebibmacro{cite:labelyear+extrayear}}

\renewbibmacro*{cite}{%
  \ifciteseen
    {\iffieldundef{shorthand}
      {\usebibmacro{longcite}}
      {\usebibmacro{cite:shorthand}}}
    {\usebibmacro{longcite}
     \usebibmacro{shorthandintro}}}

\begin{document}
  \cite{jd14} again \cite{jd14} and one more time \cite{jd14}.

  Just for comparison \cite{jd13}.

  \printbibliography
\end{document}

enter image description here

If you prefer "hereafter <key>" to "henceforth cited as <key>", just add

\DefineBibliographyStrings{english}{citedas = {hereafter}}

to the preamble.


If you like Václav Pavlík's solution with natbib's cite-alias function, you'll be delighted to hear that biblatex's natbibcompatibility mode (just pass natbib=true to the load-time options) also offers these features with (as far as I know) exactly the same syntax.

1
  • This is very slick! It even works for \cite{jd13,jd14}. Thanks
    – nbren12
    Oct 1 '14 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.