4

I need a very, very condensed works cited section, so I'm using this code by @moewe. However, for some reason all of a sudden it ignores the doi=false flag.

MEW:

\documentclass[]{article}
\usepackage[utf8]{inputenc} %Allows UTF8 input. 

\begin{filecontents}{MWE.bib}
@article{VESTA,
author = "Momma, Koichi and Izumi, Fujio",
title = "{{\it VESTA3} for three-dimensional visualization of crystal, volumetric and morphology data}",
journal = "J. App. Cryst.",
year = "2011",
volume = "44",
number = "6",
pages = "1272--1276",
doi = {10.1107/S0021889811038970}
}
\end{filecontents}

\usepackage[backend=biber,style=chem-acs,doi=false,articletitle=false,pageranges=true,biblabel=parens,autocite=superscript,url=false,isbn=false]{biblatex}
\AtEveryBibitem{%
  \clearfield{pages}%
}
\addbibresource{MWE.bib}

\defbibenvironment{bibliography}
  {\noindent}
  {\unspace}
  {\printtext[bold]{\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}}}
    \addspace}
\renewbibmacro*{finentry}{\finentry\quad}

\begin{document}

This is a test text.\cite{VESTA}

\printbibliography

\end{document}
Canageek
  • 17,935

1 Answers1

3

That is because biblatex-acs normally suppresses DOIs, but prints them regardless of what the doi option says if the pages field is missing. Since in the MWE you remove the pages field via \AtEveryBibitem{\clearfield{pages}} you always get the DOI.

The best way is probably to get rid of the

\AtEveryBibitem{%
  \clearfield{pages}%
}

in your code. Alternatively, we can force biblatex-acs to always respect the doi option with

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
} 
moewe
  • 175,683
  • The \AtEveryBibitem{\clearfield{pages}} was only in my answer to Removing Line Breaks in Bibliography compiled with Biblatex because it was in the original MWE by the OP, it does not as such make the bibliography (much) more compact. The important code is the \defbibenvironment{bibliography} bit and the \renewbibmacro*{finentry}{\finentry\quad}. – moewe Oct 10 '15 at 20:16
  • This was also helpful as I just noticed that the pages were missing (I was writing in a huge rush to get someone a draft.) This fixed both problems, thank you. – Canageek Oct 14 '15 at 18:29