cgnieder wrote:Hi Aardbei,
Welcome to the LaTeX community!
biblatex does not define
\x
. The following tells you that it is undefined:
Code: Select all
\documentclass{article}
\usepackage{biblatex}
\begin{document}
\meaning\x
\end{document}
Thank you for your reply!
It took me a while but now I know what was happening. Indeed it's undefined in Biblatex, but when using it with Biber as backend (instead of Bibtex) then somewhere in the code the command
\x{some hexadecimal? code}
is used in the .bbl file as a way to represent characters from the .bib file that somehow do not have a regular representation (in ASCII I guess) and have some different encoding (Unicode?). There was one reference my .bib file that had one such obscure character. Bibtex apparently just skips these characters. Biber on the other hand apparently tries to map it to ASCII, but fails in this particular case, and also gives an error:
"\x{fffd}" does not map to ascii at Biber/Output/bbl.pm line 509.
Somewhat sloppy, Biber does not remove these commands from the .bbl file when they fail, causing errors when left for Latex to interpret them further. Whether
\x
is defined or not this of course produces errors. For example when I define
\newcommand*{\x}{\mathit{x}}
I get the expected error on the line number where I put
\printbibliography
:
\mathit allowed only in math mode.
(Because the reference list is not in math mode.)
So that's why it's hard to detect what's going on. I guess Biber somehow interprets
\x
on the fly while writing the bibliography, but if the command fails because it does not contain ASCII, it just skips the command and leaves it for (pdf)latex to process further. It doesn't redefine it though:
\meaning\x
returns 'undefined' when called before and also after the bibliography.
I use biblalex a lot and never had any such problems with it and I also haven't heard of others so I'd say the problem is a rather small one (and in your case must be another one anyway). biblatex actually is very carefully programmed and is maintained by very capable people who know what they're doing.
Okay , that's reassuring! Sorry to discredit them
That is just the way TeX-programming works: everyone and everybody can define and redefine whatever they like at any time. With more than 1500 packages available conflicts are bound to happen. Good package programmers do take care though, to use internal commands that are very unlikely to be used by others. biblatex for example precedes its internal commands with \blx@
and similar prefixes. There is no way, however, this can prevent anyone from overwriting them again...
I would recommend this way: make you custom definitions in the preamble after you've loaded all packages and use \newcommand
for defining new macros. This will give an error if the command is already defined. If it doesn't and the command is still not working something else must be going on.
Regards
Thanks for the explanations, it is perfectly clear now how this all is intended to be used. Aside from that, the Biber issue above still seems to me could be implemented a little better to avoid confusion like I had...