On Thu, Jul 26, 2001 at 05:21:18PM +0200, Andre Poenitz wrote:
> > adding some math code in a figure caption breaks LyX' latex output if your
> > documents includes a table of figures (see tiny example file). Note: This
> > worked about three weeks ago - AFAIK it's not a limitation of Latex.
> 
> I guess this has something to do with \protect and the 'fragile' option to
> MathInset::write().
> 
> But I never understood this \protect stuff, so maybe someone could direct
> me to some explanation...

I don't know of a 'good' explanation anywhere (and I've asked for one
myself, on comp.text.tex, but I now can't find my posting).

Basically:

Sometime LaTeX moves text to auxiliary files and back again. Most
notably, things which are going to end up in the table of
contents. When it does this, it "fully-expands" the text in a \edef
first.

Certain commands unavoidably (sadly), fully-expand into something
stupid, which can't be read back it in.  Or, they can go through the
cycle once but not twice, or something like that. These commands are
called 'fragile' commands.

Most fragile commands can be made robust (the opposite!) by preceding
them with \protect.  This isn't 100% though, I don't think.  \protect
\( does work, I believe, but $ is the preferred solution for a 'robust 
\('.

Jules

Reply via email to