TeXtudio gives me the error Misplaced alignment tab character &.
in the line where I insert my bibliography. This line is \include{\dir/bibliography}
which links to
\manualmark%
\markboth{\spacedlowsmallcaps{\bibname}}{\spacedlowsmallcaps{\bibname}}
\refstepcounter{dummy}
\addtocontents{toc}{\protect\vspace{\beforebibskip}}
\addcontentsline{toc}{chapter}{\tocEntry{\bibname}}
\label{app:bibliography}
\emergencystretch=1em%
\printbibliography
I think the problem might be caused by &
symbols within the references, of which there are very many. I could replace them with \&
or "and", but maybe there's an easier solution.
I'm using MiKTeX and Biber.
Best Answer
The character
&
has a special meaning for LaTeX: It marks new table columns or new alignment columns in general (thinkalign
).As such you can't generally use
&
in its meaning as ampersand character in standard LaTeX and must escape it to\&
, see Escape character in LaTeX. There are some exceptions to this rule: In\verb|...|
and other verbatim commands as well as\url
and some related commands you can often use&
without escaping it, but there are some subtle points with those commands (see for example How to use a link as footnote that has special characters inside?).It's pretty much the same for the bibliography. You should escape
&
to\&
in.bib
files except in special verbatim fields likedoi
,eprint
andurl
.The best solution™ is to make sure to escape
&
to\&
in the.bib
file unless it is in adoi
,eprint
,url
or otherwise verbatim field. E.g. instead ofyou should write
If for some reason you absolutely cannot bring yourself to fix your
.bib
file once for good, you can have Biber do that on the fly for you (but this is at most the second best solution™). (biblatex
uses an XML format to communicate with Biber, where&
is also a special character, so we better escape it as\x{26}
.)Related Ampersand in Sourcemap for BibTex.