TransWikia.com

Extra }, or forgotten $. ... z@ $relax $ seqstrict}}{39}{figure.4.7} and so on

TeX - LaTeX Asked by user2379123 on April 10, 2021

This time I have a strange problem. Following code is from the *.lof file:

babel@toc {german}{}
addvspace {10p@ }
contentsline {figure}{numberline {1.1}{ignorespaces Architektur des $mathbb {K}$-Frameworks}}{3}{figure.1.1}
addvspace {10p@ }
addvspace {10p@ }
contentsline {figure}{numberline {3.1}{ignorespaces IMP-Modul}}{26}{figure.3.1}
contentsline {figure}{numberline {3.2}{ignorespaces Syntaxdefinitionen}}{26}{figure.3.2}
contentsline {figure}{numberline {3.3}{ignorespaces Endmodul}}{26}{figure.3.3}
addvspace {10p@ }
contentsline {figure}{numberline {4.1}{ignorespaces IMP-Konfiguration}}{31}{figure.4.1}
contentsline {figure}{numberline {4.2}{ignorespaces K-Regeln}}{33}{figure.4.2}
contentsline {figure}{numberline {4.3}{ignorespaces Beispielhafte Betrachtung eines Terms}}{34}{figure.4.3}
contentsline {figure}{numberline {4.4}{ignorespaces K-Konfigurationen in Backus-Naur-Form}}{35}{figure.4.4}
contentsline {figure}{numberline {4.5}{ignorespaces Regeln f"ur $relax $@@underline {hbox {tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}}}mathsurround z@ $relax +relax $@@underline {hbox {tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}}}mathsurround z@ $relax $ strict}}{37}{figure.4.5}
contentsline {figure}{numberline {4.6}{ignorespaces Rechenklasse f"ur en Ausdruck $xtmspace +thinmuskip {.1667em}*tmspace +thinmuskip {.1667em}(ytmspace +thinmuskip {.1667em}+tmspace +thinmuskip {.1667em}2)$}}{38}{figure.4.6}
contentsline {figure}{numberline {4.7}{ignorespaces Regeln f"ur $relax $@@underline {hbox {tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}}}mathsurround z@ $relax <=relax $@@underline {hbox {tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}tmspace +thinmuskip {.1667em}}}mathsurround z@ $relax $ seqstrict}}{39}{figure.4.7}
contentsline {figure}{numberline {4.8}{ignorespaces KResult und KResultLabel}}{39}{figure.4.8}
addvspace {10p@ }
addvspace {10p@ }

The lines with figure 4.5 and 4.7 are causing the errors:

Extra }, or forgotten $. ... z@ $relax $ seqstrict}}{39}{figure.4.7}
Extra }, or forgotten $. ...und z@ $relax $ strict}}{37}{figure.4.5}

I give you the problematic parts from my original tex file:

begin{align}
&a_{1}<=a_{2}rightleftharpoons a_{1}curvearrowright Box<=a_{2}
&r_{1}<=a_{2}rightleftharpoons a_{2}curvearrowright r_{1}<=Box
end{align}
begingroupvspace*{-baselineskip}
captionof{figure}{Regeln für $underline{,,,}<=underline{,,,}$ seqstrict}
vspace*{baselineskip}endgroup

begin{align}
a_{1},+,a_{2},rightleftharpoons,a_{1},curvearrowright,Box,+,a_{2}
a_{1},+,a_{2},rightleftharpoons,a_{2},curvearrowright,a_{1},+,Box
end{align}
begingroupvspace*{-baselineskip}
captionof{figure}{Regeln für $underline{,,,}+underline{,,,}$ strict}
vspace*{baselineskip}endgroup

I don’t see any mistakes there. Compiling works fine, i.e. PDF file is being generated and everything seems fine. But these errors are disturbing me. I don’t know what I am doing wrong. Maybe the align environment is incompatible with the capt-of package, this might cause the problem. But the others sections are working fine. All other figures excluding 4.5 and 4.7 have the same structure, but no errors.

Help me guys!

Thanks

2 Answers

Thanks, the solution works fine. Before using the protect command, I had to remove the $'s from the underline command and put only the operators (+ and <=) into the math mode.

Answered by user2379123 on April 10, 2021

The code works without problems on a recent LaTeX kernel (after May 2019), because several commands have been made robust.

I suggest defining blank to stand for underline{,,,} and to use a proper figure environment.

documentclass{book}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}

usepackage{amsmath,amssymb}

newcommand{blank}{underline{mspace{9mu}}}

begin{document}

frontmatter

listoffigures

mainmatter

begin{figure}[htp]
setlength{abovecaptionskip}{0pt}

begin{align}
&a_{1}<=a_{2}rightleftharpoons a_{1}curvearrowright Box<=a_{2}
&r_{1}<=a_{2}rightleftharpoons a_{2}curvearrowright r_{1}<=Box
end{align}
caption{Regeln für $blank <= blank$ seqstrict}

begin{align}
a_{1},+,a_{2},rightleftharpoons,a_{1},curvearrowright,Box,+,a_{2}
a_{1},+,a_{2},rightleftharpoons,a_{2},curvearrowright,a_{1},+,Box
end{align}
caption{Regeln für $blank + blank$ strict}
end{figure}

end{document}

enter image description here

enter image description here

For older LaTeX kernels, one can do

newcommand{blank}{protectunderline{mspace{9mu}}}

Answered by egreg on April 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP