0

I want to make journal names nonitalic using biblatex. Is there a way to do this using DeclareFieldFormat?

I could change article names to italics using DeclareFieldFormat and I want to make journal names nonitalic in a similar way. I use

\documentclass[11pt]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{graphicx}
\usepackage[style=alphabetic, backend=biber, giveninits=true]{biblatex}
\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=2, strside=left, ifnames=1]{labelname}
\field[strwidth=1, strside=left]{labelname}
}
    }
\DeclareFieldFormat{extraalpha}{#1}
\DeclareNameAlias{author}{first-last}
\renewbibmacro{in:}{}
\DefineBibliographyExtras{english}{%
\renewcommand*{\finalnamedelim}{\addcomma\addspace}%
}
\DeclareFieldFormat[article]{title}{\textit{#1}}
\DeclareFieldFormat{citetitle}{\textit{#1}}
\DeclareFieldFormat*[article]{title}{\textit{#1}}
\DeclareFieldFormat[article,book]{title}{\textit{#1}}
\DeclareFieldFormat*[article]{citetitle}{\textit{#1}}
\DeclareFieldFormat[article,book, thesis]{citetitle}{\textit{#1}}
\bibliography{sample}


\begin{document}
\printbibliography
\end{document}

When I run this all of the journal names (of articles) in sample.bib are shown in italics.

  • 1
    Welcome to TeX SX! Could you post a small compilable code? – Bernard Oct 10 '18 at 19:33
  • 1
    \DeclareFieldFormat{journaltitle}{#1\isdot} so pretty much using the same strategy as for titles, but keeping in mind that the journal field is internally called journaltitle. – moewe Oct 10 '18 at 19:41
  • Thanks @moewe. It worked. If you answer below I will accept as answer. – 512122 Oct 10 '18 at 19:47
  • 1
    I'd also suggest \mkbibitalic (or \mkbibemph) instead of \textit in bibliography-related stuff like \DeclareFieldFormat – moewe Oct 10 '18 at 19:47
  • I have another quick question [url=false] for biblatex is not working to remove URL tag on online references. Is there a way to getting rig of URL tag? – 512122 Oct 10 '18 at 19:56
3

Internally the journal field is called journaltitle (to be precise, the field is called journaltitle and journal is only an alias that gets automatically remapped to journal). So you need to redefine the field format for journaltitle

\DeclareFieldFormat{journaltitle}{#1\isdot}

I also suggest you use

\mkbibitalic

instead of \textit in \DeclareFieldFormat directives. You could also use \mkbibemph if you want to allow toggling between italics and upright font.


In the MWE you seem to misuse the starred version of \DeclareFieldFormat. The starred version clears all type-specific formatting, so directly using the optional type argument seem superfluous. The entire block with redefinitions for title and citetitle can probably be compressed down to

\DeclareFieldFormat*{title}{\mkbibitalic{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibitalic{#1}}

\DeclareNameAlias{author}{first-last} should be replaced by

\DeclareNameAlias{author}{given-family}

but that should be the default setting, so should not be necessary at all.


Finally, finalnamedelim need usually not be redefined in \DefineBibliographyExtras and should nowadays be redefined using the context sensitive delimiter interface. In your case I guess the cleanest approach would be

\DeclareDelimAlias{finalnamedelim}{multinamedelim}

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.