# Problem with biblatex-chem bundle when used with option pageranges=false

I'm using Joseph Wright's excellent biblatex-chem bundle for biblatex emulating the styles of certain chemistry journals. In particular I'm using

\usepackage[style=chem-angew,pageranges=false]{biblatex}


with biblatex version 1.5a. The problem is that this produces output where the page number of an article is preceded by "p.", i.e.

J. P. Perdew, K. Burke, M. Ernzerhof, Phys. Rev. Lett. 1996, 77, p. 3865.

But this behaviour does not match the journal's (Angewandte Chemie) standards as pages of articles should not include a prefix like "p." (and also my professor wants me to get rid of it). While I searched in the appropriate style file of biblatex-chem (chem-angew.bbx) to see which command is connected to the package option pageranges=false I found out that it is \mkpagefirst. The related line in chem-angew.bbx is

\DeclareFieldFormat[article]{pages}{%
\ifbool{bbx:pageranges}{#1}{\mkpagefirst{#1}}%
}


Next I tried to look up the original definition of this command in biblatex.sty in order to use it as a template for a redefinition via renewcommand that suits my needs. But as \mkpagefirst is defined via a cascade of commands I can't figure out how to do it. So any help would be very much appreciated.

(I'm not sure whether this can be regarded as a bug in the biblatex-chem bundle which I should report to Joseph Wright since he might have intended it to work that way.)

-
I'm aware of the issue with biblatex 1.6, but need to sort out some issues with the way I originally structured the code. The BitBucket site (bitbucket.org/josephwright/biblatex-chem) should get updated as I work on this: I probably need a week to address the 'big issues'. –  Joseph Wright Aug 12 '11 at 21:19
Your work is very much appreciated as I use your package for every document I have to produce in the course of my studies. Saved me a lot of work. –  Philipp Aug 13 '11 at 1:33
I've just submitted a new version of biblatex-chem to CTAN. This should fix both your issue and the wider problem with biblatex v1.6. Give it a day or so to make its way around the internet. –  Joseph Wright Aug 15 '11 at 20:05

Now that I have updated my biblatex to version 1.6 I see that the newly introduced command \mkfirstpage fixes the behaviour of biblatex-chem's package option pageranges=false if one substitutes \mkpagefirst to \mkfirstpage in the chem-angew.bbx file. But as pointed out in the comments to Marco's answer the current version (1.0e) of biblatex-chem is not compatible with biblatex 1.6. Until an official update to the bundle is released I fixed this incompatibility by applying the following changes to the chem-angew.bbx file:
I removed the lines

\renewcommand*{\thebibitem}{\item}
\renewcommand*{\thelositem}{\item}


Furthermore I changed

\renewenvironment*{thebibliography}
{\list
{\printfield[labelnumberwidth]{labelnumber}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}


to

\defbibenvironment{bibliography}
{\list
{\printtext[labelnumberwidth]{%
\printfield{prefixnumber}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}


and

\renewenvironment*{theshorthands}
{\list
{\printfield[shorthandwidth]{shorthand}}
{\setlength{\labelwidth}{\shorthandwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{\hss##1}}}
{\endlist}


to

\defbibenvironment{shorthands}
{\list
{\printfield[shorthandwidth]{shorthand}}
{\setlength{\labelwidth}{\shorthandwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{\hss##1}}}
{\endlist}
{\item}


This solved my problem so far. I guess similar changes to the respective style files might be necessary to use the other styles contained in the biblatex-chem bundle.

-

By using biblatex 1.6 the bundle biblatex-chem produces some errors. I build a minimal example:

\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\providecommand*\thebibitem{}
\providecommand*\thelositem{}
\providecommand*\theshorthands{}
\usepackage[style=chem-angew,pageranges=false]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{entry1,
author="J. P. Perdew and K. Burke and M. Ernzerhof",
journaltitle="Phys. Rev. Lett.",
volume="77",
year="1996",
pages="3865"
}
\end{filecontents}
\bibliography{\jobname}
\begin{document}
\cite{entry1}
\printbibliography
\end{document}


And I get no "p. 3865".

-
Thanks for looking at my problem. When I compile your minimal example I get "S. 3865", i.e. the german analog of "p. 3865", which I don't want as output as well. Have you used biblatex v. 1.6 for this example or was it only a side note that this version produces errors with biblatex-chem? –  Philipp Aug 6 '11 at 16:28
I forgot to mention that I had to uncomment the \providecommands before I could compile your minimal example because for some reasons I get error messages when they are included. –  Philipp Aug 6 '11 at 16:38
I am using version 1.6. I need the providecommand. I think Jospeh Wright will update his biblatex-chem to be compatible with biblatex version 1.6. –  Marco Daniel Aug 6 '11 at 16:59
I read in the biblatex documentation that the \mkpagefirst command is removed in version 1.6. Maybe the errors you get are due to this. But my problem remains that I need a proper redefinition of \mkpagefirst in order to use biblatex-chem. –  Philipp Aug 6 '11 at 17:09
You are right. With the version 1.6 Phillip Lehmann added the new command mkfirstpage and other nice gimmicks to handle pages. –  Marco Daniel Aug 6 '11 at 17:15