3

I have many Bibtex database files which I am updating to biblatex format. In BibTeX I created a custom library field which appeared at the end of my bibliographic entry in small capitals. I did this by creating a new bibliographystyle.

All I want to do is get the library field to appear at the end of every reference where it occurs. I know that it is probably somewhere in the 262 page manual, but to be frank, even for someone who has been using LaTeX and BibTeX for almost 30 years, the manual is pretty indigestible (oh for a good "quick start" guide!). Any pointers to how I can do this quickly and easily would be welcome.

I am using the authoryear style.

  • You mean style=authoryear? The easiest way would be to put the information in the addendum field or use a Sourcemap (requires Biber, not BibTeX) to map your library field to the addendum field. – jon Jan 9 '17 at 21:55
  • Thanks Jon. As this file is quite small the "quick fix" is just to copy everything into the addendum field. I will check out Sourcemap when I have a bit more time. – Kris Lockyear Jan 9 '17 at 22:19
  • 1
    OT here, but the problem with a 'quick start' guide is always that different people have different ideas of what should be in it. Here, I don't think manipulating custom fields really would feature: it's an 'advanced' effect. – Joseph Wright Jan 10 '17 at 9:14
3

With the standard styles you can just add a call to print the library field directly into the macro addendum+pubstate

\DeclareFieldFormat{library}{\textsc{call number}\addcolon\space#1}
\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \newunit\newblock
  \printfield{pubstate}%
  \newunit\newblock
  \printfield{library}}

MWE

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{pennington1981,
  editor =       {Pennington, Kenneth},
  title =        {Johannis {Teutonici} apparatus glossarum in
                  {Compilationem} tertiam},
  date =         1981,
  volume =       1,
  number =       3,
  series =       {Monumenta iuris canonici, Series A: Corpus glossatorum},
  location =     {Rome},
  publisher =    {Biblioteca apostolica vaticana},
  library =      {BV 104 .M81 ser.A v.3 t.1},
}
\end{filecontents*}

\documentclass{article}
\usepackage[backend=biber, style=authoryear]{biblatex}
\addbibresource{\jobname.bib}

\DeclareFieldFormat{library}{\textsc{call number}\addcolon\space#1}
\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \newunit\newblock
  \printfield{pubstate}%
  \newunit\newblock
  \printfield{library}}

\begin{document}
\nocite{*}
\printbibliography
\end{document}
2

For (future) reference, this sort of sourcemapping is fairly straightforward. Biber is required, however.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{pennington1981,
  editor =       {Pennington, Kenneth},
  title =        {Johannis {Teutonici} apparatus glossarum in
                  {Compilationem} tertiam},
  date =         1981,
  volume =       1,
  number =       3,
  series =       {Monumenta iuris canonici, Series A: Corpus glossatorum},
  location =     {Rome},
  publisher =    {Biblioteca apostolica vaticana},
  library =      {BV 104 .M81 ser.A v.3 t.1},
}


\end{filecontents*}

\documentclass{article}

\usepackage[backend=biber, style=authoryear]{biblatex}

\addbibresource{\jobname.bib}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{
       \step[fieldsource=library,]
       \step[fieldset=addendum, fieldvalue={\textsc{call number:}~}]
       \step[fieldset=addendum, origfieldval, append]
    }
  }
}

\begin{document}

\section{Publications}
\nocite{*}
\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.