# Biblatex and listings incompatibility…

Does someone know why biblatex and listings are incompatible and if there is a way to fix it?

I have a Lyx document and whenever I insert program listings I get errors like:

 al trabajo de \citet{Fernandez2007}.
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., \hobx'), type I' and the correct
spelling (e.g., I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


or like

 \printbibliography\newpage
{}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., \hobx'), type I' and the correct
spelling (e.g., I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


This happens only when I add the use of package listings.

I am including biblatex like this:

\usepackage[natbib=true,style=alphabetic-verb,sorting=nty,hyperref,backend=bibtex8]{biblatex}


Any help will be very much appreciated.

Bests,

B.

Edit (more details): Since I've been asked an example, I actually don't have one. Because all I have to do is adding:

\usepackage{listings}


to my Latex preamble (I am using Lyx) to get these errors. I have not even inserted source code listings yet.

If I insert a source code listing using Lyx menu I will have the same problem since Lyx currently uses listings package and it will automatically insert listings package in the preamble.

This is really strange, because I don't see why when I insert listings that would undefine \citet or other commands. I just upgraded from Lyx 1.6.8 to Lyx 2.0.0 to see if this fixed something, but no. I also updated the MikTex packages but it does not fix anything.

-

## migrated from stackoverflow.comJul 19 '11 at 18:37

This question came from our site for professional and enthusiast programmers.

A minimal example would be helpful, especially since your code shows no relation to the listings package (except for your assertion that you have loaded it). – Konrad Rudolph Jul 19 '11 at 16:34
Welcome to TeX.sx! Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – N.N. Jul 19 '11 at 18:54

This minimal example, following your description, shows that it can be compiled without that error message complaining about \citet being undefined:

\documentclass{article}
\usepackage[natbib=true,style=alphabetic-verb,sorting=nty,hyperref,backend=bibtex8]{biblatex}
\begin{document}
al trabajo de \citet{Fernandez2007}.
\end{document}


However, I can confirm, that the error

! Undefined control sequence.
l.4 al trabajo de \citet
{Fernandez2007}.


would occur if no options to biblatex are used, i.e. if I just write \usepackage{biblatex}. This doesn't depend on the listings package.

-
The command \citet is for compatibility with natbib; the standard biblatex command is \textcite. – egreg Jul 20 '11 at 18:11

I already know that \citet is from natbib. Using natbib markup is mandatory on Lyx when one has included the biblatex module. That is why in biblatex package options I used natbib=true. That will in effect create aliases.

After trying a lot of things I solved my problem using biber backend instead of bibtex8 backend. Why this does solve the problem I don't know. Could be a character code problem?

Anyway, I am able now to use the listings package.