# Error with percent sign in bib entry field when using biblatex/biber

I'm trying to use biblatex (v1.5a) with biber (v0.9.3) instead of BibTeX but I am having a problem with bib entries, where the abstract contains a percent sign. In that case, in the bbl file the corresponding entry will have a line with \field{abstract}{ ...% ...} with the percent sign causing the quotes not to be closed. And pdflatex complains with an error "Runaway argument" (see error message and minimal example below).

So here is my question: How can I either make biblatex ignore the abstract entries (as BibTeX does) since I do not need them in my LaTeX document or tell biblatex to add an escape character automatically?

Or am I missing something here? Any help is appreciated! Thanks.

The error message is:

Runaway argument?
{Limit Cycle Walkers are bipeds that exhibit a stable cyclic gait wit\ETC.
! File ended while scanning use of \field.
&lt;inserted text&gt;
\par
l.51 \begin{document}

! Undefined control sequence.
&lt;argument&gt; \blx@bbl@data


Here is a minimal working example:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage[citestyle=authoryear,%numeric-comp,
bibstyle=authoryear,%numeric
backend=biber,
natbib=true,
hyperref=false]{biblatex}
\bibliography{myref}
\listfiles
\begin{document}
adsf asdf asdf asdf asdf asdf  asdf
\citep{Hobbelen2008b}

\printbibliography
\end{document}


with the corresponding conflicting entry (abstract shortened) given as:

@ARTICLE{Hobbelen2008b,
author = {Hobbelen, D.G.E. and Wisse, M.},
title = {{Ankle Actuation for Limit Cycle Walkers}},
journal = {The International Journal of Robotics Research},
year = {2008},
volume = {27},
pages = {709-735},
number = {6},
abstract = {Limit Cycle Walkers are bipeds that exhibit a stable ... by at  least 60%, without increasing ...
of 5% of its leg length, while walking efficiently at a mechanical
cost of transport of 0.09.}
}


(some other package versions: etoolbox v2.1, logreq v1.0)

-
Can't you just change those percent signs into latex percent signs with \%? Or put the whole asbtract inside a \verb? –  henrique Jul 3 '11 at 2:58
@henrique: Reading your answer (Thanks for that) and locksteps answer below, I guess I will manually change them. One reason for my question is that in my bib file, I have many entries which I have automatically imported using jabref/journal websites. Since I assume that many other people do the same, I thought there might be a better/easier way than to manually correct entries. But apparently not. –  michaelS Jul 3 '11 at 15:12

As of biber 0.9.4/biblatex 1.6 you can define user-specified field and entrytype mappings. A special case of this is that you can map fields to null which essentially removes them from the input stream completely. So if for example, you want to just ignore all ABSTRACT fields in bibtex data sources (which are often the source of unwanted special chars when exported from automated systems), you can put this in your biber.conf:

<map>
<bibtex>
<globalfield>
ABSTRACT BMAP_NULL
</globalfield>
</bibtex>
</map>


The nice thing about this is that you don't have to change the data source itself which is good if it's auto-generated and you don't have control over it. You can also ignore/map fields only in certain entrytypes. See the 0.9.4 biber manual, section 2.1.1.

EDIT: The config file format will change in Biber 0.9.8 because the current format is too restrictive. Mapping will be less confusing. Here is the same solution in the new format:

<config>
<sourcemap>
<maps datatype="bibtex" map_overwrite="1">
<map>
<map_step map_field_set="ABSTRACT" map_null="1"/>
</map>
</maps>
</sourcemap>
</config>

-
That sounds like what I was initially looking for. Great! Thanks for the hint. –  michaelS Aug 8 '11 at 8:05
You might want to read this bugreport: [sourceforge.net/tracker/… –  matth Oct 25 '11 at 12:43

Your second request -- automatically adding an escape character to percent signs -- is not possible. Quoting from the biber manual:

[P]lease note that biber will not attempt to sanitise the content of bibtex data sources. That is, don’t expect it to auto-escape any TeX special characters like ‘&’ or ‘%’ which it finds in, for example, your TITLE fields. It used to do this in earlier versions in some cases but as of version 0.9, it doesn’t because it’s fraught with problems and leads to inconsistent expectations and behaviour between different data source types. In your bibtex data sources, please make sure your entries are legal TeX code.

-
Thanks for the hint. I must admit, I just looked into the biblatex documentation. One reason for me to switch to biber was the full UTF-8 support, so avoiding manually messing around with special characters such as äöüß in bibtex fields. But I understand that % and & are special special characters, therefore I am going to manually change. –  michaelS Jul 3 '11 at 15:06
When cleaning up my bibtex entries, I saw that some abstracts contained unicodes such as &#x201c; (html version for \textquotedblleft). Since I saw in the biber manual that latex constructs are replaced by the corresponding uft-8 characters, do you know whether biber can do the same with these unicode character codes? I mean replace #x201c by ? –  michaelS Jul 3 '11 at 15:32
To my foregoing comment: I tried on my minimal example, but it did not work. -> More things to correct :-( –  michaelS Jul 3 '11 at 15:33

You have to take this code within the biber.conf file. It works perfectly for me:

    <config>
<sourcemap>
<maps datatype="bibtex" map_overwrite="1">
<map>
<map_step map_field_source="decision" map_field_target="USERA"/>
<map_step map_field_source="sign" map_field_target="USERB"/>
<map_step map_field_source="officialvolume" map_field_target="USERC"/>
<map_step map_field_source="officialpages" map_field_target="USERD"/>
<map_step map_field_source="journalyear" map_field_target="USERE"/>
<map_step map_field_source="decisionname" map_field_target="USERF"/>
</map>
</maps>
</sourcemap>
</config>

-