5

My bibliographic database contains pre-set shorthands for some items. However, sometimes I have to use the numeric citation style and the pre-set shorthands end up overriding the numeric labels. Is there a way to avoid this without modifying the bibliographic database?

  • Do you happen to use Biber? – moewe May 13 '15 at 15:21
  • Yes, I am using Biber. – Zhen Lin May 13 '15 at 15:28
  • I'll be back with a solution shortly. But just to be sure I understood you correctly, do you have a label or a shorthand field in the relevant .bib entries? (A MWE would really help me to come up with an adequate solution quicker.) – moewe May 13 '15 at 15:33
  • I am using the shorthand field, not the label field. – Zhen Lin May 13 '15 at 16:01
  • OK, I can get rid off all shorthands. Is that fine with you? – moewe May 13 '15 at 16:10
2

If one does not want to use a sourcemap definition, it is possible to nullify the values of the shorthand (or other fields) using \DeclareFieldInputHandler

Here the value of the field is read from the .bbl file (so after it has been generated by biber)

\DeclareFieldInputHandler{shorthand}{\def\NewValue{}}
  • This seems like the more flexible approach. Thanks! – Zhen Lin May 14 '15 at 8:54
6

If you just want to get rid of the shorthand to make sure the label is just a normal numeric one, we can go with

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=shorthand, null]
    }
  }
}

Thus we can make sure the shorthand is ignored by Biber before it comes to label generation. (An \AtEveryCitekey approach cannot work here.)

MWE

\documentclass{article}

\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=shorthand, null]
    }
  }
}

\begin{document}
\cite{kant:kpv}
\printbibliography
\end{document}

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.