2

How can I format (e.g., italic) the field address for an @report in a biblatex bibliography?

\DeclareFieldFormat[report]{institution+location+date}{\mkbibemph{#1}}

or

\DeclareFieldFormat[report]{address}{\mkbibemph{#1}}

do not work. Update: and neither

\DeclareFieldFormat[report]{location}{\mkbibemph{#1}}

It works for e.g. title instead of location though, so it must be something specific to location.

NB: I know I can include formatting of fields in the .bib file, but I very much prefer a solution along the lines of \DeclareFieldFormat.

Thanks for any hint!

Update2: MWEB

\documentclass{article}
\usepackage[style=authoryear-comp]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}    
\begin{filecontents}{\jobname.bib}
@report{key,
  author = {Author, A.},
  year = {2001},
  title = {Title},
  location = {My location}
}
\end{filecontents}    
\DeclareFieldFormat[report]{location}{\mkbibemph{#1}}    
\begin{document} 
\nocite{*}    
\printbibliography    
\end{document}

Result: "My location" is not formatted in italic font.

  • Welcome to TeX.SX! Since the answer will heavily depend on the style you use, you can increase your chance of getting a good answer by including an MWE/MWEB. In this case I ventured a guess, but I can't be sure if it really solves your problem without testing. And often a guess along those lines is near-impossible. – moewe May 13 '17 at 14:34
2

address is a legacy name kept for backwards compatibility. Internally address is remapped to the location field. Furthermore, location is a list, so you need

\DeclareListFormat[report]{location}{%
  \mkbibemph{%
    \usebibmacro{list:delim}{#1}%
    #1\isdot
    \usebibmacro{list:andothers}}}
  • I should have mentioned that I tried location as well, it didn't work. I edited my question. – monade May 13 '17 at 14:54
  • I included the MWE(B) in my question. – monade May 13 '17 at 15:06
  • Great thanks! I learned something. In my case \DeclareListFormat[report]{location}{\mkbibemph{#1}} was enough, but please use moewe's suggestion which is certainly more general. – monade May 13 '17 at 15:10
  • 1
    @monade Note that your redefinition will cripple the ability to deal with more than one location as in location = {Oxford and Cambridge} or location = {Oxford and Cambridge and Warwick} – moewe May 13 '17 at 15:12

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.