# Biblatex: include bbl, problem with “verb” field

This is a follow up question to Biblatex: submitting to a journal.

As noted in the comments to Herbert's answer, some users have problems with his solution as compiling produces the error Use of \blx@bbl@verbadd@i doesn't match its definition \blx@bblfile@biber ...2004} \verb {eprint} \verb cond-mat/0407066 \endverb.

I have narrowed the problem down: the issue are \verb "fields" in the bbl. If those are present (for example for DOI or URL), then the error above is thrown unless the bbl is included via \input.

See the following MWE:

\documentclass[a4paper,10pt]{article}
\usepackage{biblatex}

%-------------- start insert modified commands ------------------
\makeatletter
\def\blx@bblfile@biber{%
\blx@secinit
\begingroup
\blx@bblstart

\refsection{0}
\sortlist{entry}{nty}
\entry{Agarwal2007}{article}{}
\verb{doi}
\verb 10.2139/ssrn.943524  %%--PROBLEM--%%
\endverb
\endentry
\endsortlist
\endrefsection

\blx@bblend
\endgroup
\csnumgdef{blx@labelnumber@\the\c@refsection}{0}}
\makeatother
%-------------- end insert modified commands --------------

\begin{document}

Some words \cite{Agarwal2007}.

\printbibliography

\end{document}


Compiling does not work unless commenting \verb 10.2139/ssrn.943524.

Edit: the code to generate the bbl is

@article{Agarwal2007,
author = {Agarwal, S.},
doi = {10.2139/ssrn.943524},
year = {2006}
}


The problematic part should be in some external file. So use the filecontents-environment to create it:

\documentclass[a4paper,10pt]{article}
\usepackage{biblatex}
\usepackage{filecontents}
\begin{filecontents}{testinput-bbl.bbl}
\refsection{0}
\sortlist{entry}{nty}
\entry{Agarwal2007}{article}{}
\verb{doi}
\verb 10.2139/ssrn.943524
\endverb
\endentry
\endsortlist
\endrefsection
\end{filecontents}
%-------------- start insert modified commands ------------------
\makeatletter
\def\blx@bblfile@biber{%
\blx@secinit
\begingroup
\blx@bblstart
\input{testinput-bbl.bbl}%<------------
\blx@bblend
\endgroup
\csnumgdef{blx@labelnumber@\the\c@refsection}{0}}
\makeatother
%-------------- end insert modified commands --------------

\begin{document}

Some words \cite{Agarwal2007}.

\printbibliography

\end{document}


## Edit April 2017

Due to changes in biblatex the redefinition of \blx@bblfile@biber no longer work as the command doesn't exist anymore. The following is a replacement. It should also work with older biblatex. It also will issue a warning if the content of the bbl doesn't fit the biblatex version.

\documentclass[a4paper,10pt]{article}
\usepackage{biblatex}
\usepackage{filecontents}
%Use the starred version of filecontents to avoid comments in the written file
%Insert the complete bbl in the environment including the starting comments!

\begin{filecontents*}{testinput-bbl.bbl}
% $biblatex auxiliary file$
% $biblatex bbl format version 2.8$
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber as required.
%
\begingroup
\makeatletter
\@ifundefined{ver@biblatex.sty}
{\@latex@error
{Missing 'biblatex' package}
{The bibliography requires the 'biblatex' package.}
\aftergroup\endinput}
{}
\endgroup

\refsection{0}
\sortlist[entry]{nty/global/}
\entry{doody}{article}{}
\name{author}{1}{}{%
{{hash=936cee5fdd47aac6238f650db8b23a07}{%
family={Doody},
familyi={D\bibinitperiod},
given={Terrence},
giveni={T\bibinitperiod}}}%
}
\strng{namehash}{936cee5fdd47aac6238f650db8b23a07}
\strng{fullhash}{936cee5fdd47aac6238f650db8b23a07}
\strng{authornamehash}{936cee5fdd47aac6238f650db8b23a07}
\strng{authorfullhash}{936cee5fdd47aac6238f650db8b23a07}
\field{sortinit}{D}
\field{sortinithash}{d10b5413de1f3d197b20897dd0d565bb}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{annotation}{An \texttt{article} entry cited as an excerpt from a \texttt{collection} entry. Note the format of the \texttt{related} and \texttt{relatedstring} fields}
\field{journaltitle}{The Journal of Narrative Technique}
\field{langid}{english}
\field{langidopts}{variant=american}
\field{number}{3}
\field{relatedstring}{\autocap{e}xcerpt in}
\field{title}{Hemingway's Style and {Jake's} Narration}
\field{volume}{4}
\field{year}{1974}
\field{related}{1e63d4bbc14872275675171be2dfa906}
\field{pages}{212\bibrangedash 225}
\range{pages}{14}
\endentry
\entry{1e63d4bbc14872275675171be2dfa906}{collection}{dataonly}
\name{editor}{1}{}{%
{{hash=cf369effe2b1de0066543cc38f7f8369}{%
family={Matuz},
familyi={M\bibinitperiod},
given={Roger},
giveni={R\bibinitperiod}}}%
}
\list{location}{1}{%
{Detroit}%
}
\list{publisher}{1}{%
{Gale}%
}
\strng{namehash}{cf369effe2b1de0066543cc38f7f8369}
\strng{fullhash}{cf369effe2b1de0066543cc38f7f8369}
\strng{editornamehash}{cf369effe2b1de0066543cc38f7f8369}
\strng{editorfullhash}{cf369effe2b1de0066543cc38f7f8369}
\field{sortinit}{M}
\field{sortinithash}{c26a05ef03e4429073ed5c825140fac3}
\field{labelnamesource}{editor}
\field{labeltitlesource}{title}
\field{clonesourcekey}{matuz:doody}
\field{annotation}{A \texttt{collection} entry providing the excerpt information for the \texttt{doody} entry. Note the format of the \texttt{pages} field}
\field{langid}{english}
\field{langidopts}{variant=american}
\field{title}{Contemporary Literary Criticism}
\field{volume}{61}
\field{year}{1990}
\field{pages}{204\bibrangedash 208}
\range{pages}{5}
\endentry
\endsortlist
\endrefsection
\endinput
\end{filecontents*}

\usepackage{xpatch}

%Patch the biblatex input command.
%replace "testinput-bbl" if you change the name above.
%disable if you want to run biblatex/biber normally
\makeatletter
\patchcmd\blx@bblinput{\blx@blxinit}
{\blx@blxinit
\def\jobname{testinput-bbl}%new jobname
}{}{\fail}
\makeatother

\addbibresource{biblatex-examples.bib} %not needed but doesn't harm either

\begin{document}

Some words \cite{doody}.

\printbibliography

\end{document}

• That's already in my question above. But it defeats the purpose of including the bbl in the file, which is what I need. – Jörg Mar 19 '14 at 19:25
• Sorry I hadn't seen that you wrote about input. Well then use filecontents to write everything during the compilation to an external file. \verb needs to do catcode changes. – Ulrike Fischer Mar 19 '14 at 19:30
• Can you include the filecontents part into your answer? I will then accept it. – Jörg Mar 23 '14 at 16:01

use for the two verb lines::

...
\field{doi}{10.2139/ssrn.943524}
...


It worked for me:

• That prints the verb fields above the bibliography (completely outside the references). – Jörg Mar 19 '14 at 18:38
• That has nothing to do with my setting. It is a problem with your generated code. The main problem is \verb{doi}. Replace it with \texttt and everything and there is no error, but also not a valid bibliography output. – user2478 Mar 19 '14 at 18:46
• But I'm not generating the code of the bbl, Biber v1.8 does and creates \verb fields for DOIs and URLs. – Jörg Mar 19 '14 at 18:50
• I know that, but then you have to use the definitions of \verb and \endverb. – user2478 Mar 19 '14 at 18:53
• Unfortunately that does not really work: (i) it's not automatic, (ii) it does not work with URLs as they require escaping of special characteris. – Jörg Mar 19 '14 at 19:29