# biblatex-apa error with silence package, is it innocuous?

I am getting the following compilation errors when using biblatex, APA and silence. I hope it is not harmful? I just updated my MiKTeX distribution and reinstalled biblatex-apa.

[ ERROR ][ C:\Program Files (x86)\MiKTeX
2.9\tex\latex\biblatex-apa\apa.bbx | Line 972 ] Argument of \blx@noline has an extra }:    \renewbibmacro*{reviewauthor}

[ WARNING ][ C:\Program Files (x86)\MiKTeX
2.9\tex\latex\biblatex-apa\apa.bbx | Line  ] Runaway argument?   ! Paragraph ended before \blx@noline was complete.

[ ERROR ][ C:\Program Files (x86)\MiKTeX
2.9\tex\latex\biblatex-apa\apa.bbx | Line 972 ] Paragraph ended before \blx@noline was complete:    \renewbibmacro*{reviewauthor}

[ WARNING ][ C:\Program Files (x86)\MiKTeX
2.9\tex\latex\biblatex-apa\apa.bbx | Line  ] Package biblatex Warning: Macro 'reviewauthor' undefined.(biblatex)                Using \newbibmacro.


Here a MWE

\documentclass[11pt,twoside]{standalone}
\usepackage{silence}
\usepackage[log-declarations=false]{xparse}
\usepackage[quiet]{fontspec}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{british}{british-apa}
\begin{document}
Testing
\end{document}

-
A Runaway argument? error means TeX got confused and some arbitrary portion of your document might have been dropped before TeX managed to recover its idea of your {} matching. It may be that it wasn't as confused as it thought it was but I would not consider using the generated output of such a run for anything other than debugging where the problem is. Does your MWE really show the problem? I get no errors with xelatex xelatex biber xelatex on that file. –  David Carlisle Oct 22 '12 at 10:23
Yes I got the error with MWE with xelatex? I tried deleting the aux file and compiled again. –  Mobius Pizza Oct 22 '12 at 10:39
don't just delete the aux file delete all the .bbx .bbl etc (everything except the tex) –  David Carlisle Oct 22 '12 at 10:50
still the same errors? –  Mobius Pizza Oct 22 '12 at 11:05

Quite probably it isn't innocuous. And, of course, the choice between not having warnings and not having errors is easy to make. ;-)

The problem is due to the fact that "NoLine" warnings usually are obtained by adding \@gobble at the end of a \PackageWarning argument:

% latex.ltx, line 972:
\def\PackageWarningNoLine#1#2{%
\PackageWarning{#1}{#2\@gobble}%
}


However, biblatex uses its own way:

% biblatex2.sty, line 728:
\protected\def\blx@warning#1{%
\begingroup
\blx@safe@actives
\PackageWarning{biblatex}{#1\blx@noline}%
\endgroup}


where \blx@noline is defined to be the same as \@gobble (but it's made equivalent to \@empty later on):

% biblatex2.sty, line 754:
\let\blx@noline\@gobble


So the methods silence uses for neutralizing \@gobble don't work with biblatex.

You can patch the silence macros to recognize also \blx@noline:

\documentclass[11pt,twoside]{article}
\usepackage{silence}
\WarningsOff[biblatex]

\makeatletter
% New macro
\def\sl@RemoveBlxNoline#1\blx@noline\sl@Terminator#2\sl@Terminator{%
\def\sl@Tempb{#2}%
\ifx\sl@Tempb\@empty
\else
\def\sl@Tempa{#1}%
\expandafter\@gobble
\fi
}
\def\sl@StoreMessage#1{%
\ifsl@SafeMode
\sl@UnexpandedMessage{#1}%
\else
\sl@UnexpandedMessage{#1}%
\begingroup
\let\protect\string
\let\noexpand\string
\def\sl@Tempa{#1}%
\sl@RemoveGobble#1\sl@Terminator\@gobble\sl@Terminator\sl@Terminator
\sl@RemoveGobbletwo#1\sl@Terminator\@gobbletwo\sl@Terminator\sl@Terminator
\sl@RemoveBlxNoline#1\sl@Terminator\blx@noline\sl@Terminator\sl@Terminator
%%%
\edef\sl@Tempa{\sl@Tempa}%
\global\expandafter\sl@Message\expandafter{\sl@Tempa}%
\endgroup
\fi}
\makeatother

\usepackage[log-declarations=false]{xparse}
\usepackage[quiet]{fontspec}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{british}{british-apa}
\begin{document}
Testing
\end{document}


In this way the warning

Package biblatex Warning: Macro 'reviewauthor' undefined.
(biblatex)                Using \newbibmacro.


that you get without the silence package disappears.

You should make a feature request to the maintainer of silence.

-
@MobiusPizza You could make a feature request to the maintainer of silence: the patch is along the lines that are used in the package, so integrating it should be easy. –  egreg Oct 22 '12 at 11:12
That's very helpful, I have also sent an email to the maintainer of silence package. Thanks. –  Mobius Pizza Oct 22 '12 at 11:13
Off topic but I tried and failed to find why the warning above regarding reviewauthor is given by biblatex-apa, reviewauthor is not in the biblatex manual. I guess that is another topic of its own unless anyone has a short answer. –  Mobius Pizza Oct 22 '12 at 11:15
Odd. I got no error with the MWE, I suppose I have an older or newer version? (I'm using TL2012) –  David Carlisle Oct 22 '12 at 11:17
This reviewauthor problem will be fixed in the next biblatex-apa release. –  PLK Oct 23 '12 at 7:16