TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Lyx and MikTeX 2.9 to write my thesis based on book KOMA-script. Right at the finish I have an error at pdflatex run:

Extra }, or forgotten \ endgroup.

<argument> ... \IeC {\c s}i dreapta D=2.9\relax }}
l.25 ...apta D=2.9\relax }}{32}{figure.caption.25}

I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

Here is my code:

  breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.



\caption{Suprafete fractale Brown-iene obinute cu funcia \emph{r.surf.fractal}
\cite{Wood1996} din GRASS GIS: stanga - D=2.1, centru D=2.5 si dreapta



The bib entry is:

author = {Wood, Jo},
booktitle = {Advances in cancer research},
file = {:D$\backslash$:/JURNALE/Bettuzzi\_2009.pdf:pdf},
issn = {0065-230X},
month = jan,
pmid = {19878769},
school = {University of Leicester},
title = {{The geomorphological characterisation of digital elevation models}},
volume = {104},
year = {1996}

and the a.bib file.

I use a modification of chicago bibtex style.

While the code contains a lot of optimisation, the error was in when i added the code


This is required for me to obtain coma and colon separated citations.

The error is localized in relation to some citations included in float figure captions. I read it on the web that some times natbib and hyperref does not like each other, and indeed when I comment the code above the document compile.

Any clue regarding this issue would help! Thanks in advance!


share|improve this question
Please use a minimal working example (MWE)/ – Guido Sep 14 '12 at 10:01
Well, I tried that, but my knowledge of LaTeX beside trowing in Lyx code, is limited. What should i include? – mihai niculita Sep 14 '12 at 10:14
I edited for MWE. Thanks! – mihai niculita Sep 14 '12 at 10:32
up vote 2 down vote accepted

Your example is missing two pieces:


The first is to get the commands \citet and similar ones; the second provides \pretocmd. However, patching those commands in that way is wrong, as they are "robust commands".

Do this, instead:


so that the patches will be to the correct internal macro. You still need natbib, of course. Loading etoolbox is not necessary.

In case xpatch is not available in your TeX distribution, you can still do the correct patch:

\expandafter\pretocmd\csname citet \endcsname{\citestyle{comma}}{}{}

(similarly for the other three commands).

share|improve this answer
Your indication with xpatch works! Natbib is missing cause I added using LyX menu, not as TeX code. Thank you! – mihai niculita Sep 14 '12 at 12:01
@mihainiculita Please, have a read to the FAQ, particularly How to ask – egreg Sep 14 '12 at 15:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.