1

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}.
                                           Más adelante se describe la
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.

2
  • 3
    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). Jul 19, 2011 at 16:34
  • 1
    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, 2011 at 18:54

2 Answers 2

2

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.

1
  • 2
    The command \citet is for compatibility with natbib; the standard biblatex command is \textcite.
    – egreg
    Jul 20, 2011 at 18:11
0

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.

¡Thanks for your comments and help!

1
  • 2
    Could you please register your original stackoverflow.com account as well and associate it with the local account. Otherwise you will not be able to control the question. Jul 21, 2011 at 19:56

You must log in to answer this question.