1

With the following code:

\documentclass{article}
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
\usepackage[plain,noend,noline,boxed]{algorithm2e} 
\begin{document}
\begin{algorithm}
\SetKwData{Property}{property}\SetKwData{Shape}{shape}\SetKwData{Game}{game}\SetKwData{Event}{event}

\KwData{A \Game, an \Event, a \Shape, and a \Property that changed}
\KwResult{The code modifications that can change the \Property to its new value according to the game state}

\caption{\Property.template.matches \label{templatematch}}
\end{algorithm}

\end{document}

I end up with the following unreadable error (compiling with Texlipse with a basic MikTex installation on Windows 7)

Argument of \@caption has an extra }. ...ty.template.matches \label{templatematch}} (followed by: ) document.tex    /TestLatex  line 10 Texlipse Build Error
Paragraph ended before \@caption was complete. ...ty.template.matches \label{templatematch}} (followed by: )    document.tex    /TestLatex  line 10 Texlipse Build Error

Why do I get this error? What does it mean? I was not able to correct it. It was working before, I don't know what changed. Cheers, Mikaël

1 Answer 1

2
\caption{\protect\Property.template.matches \label{templatematch}}

Fragile commands in moving arguments need \protect

2
  • What is a fragile command? Jun 25, 2013 at 12:29
  • @MikaëlMayer Basically, one that goes wrong if you don't use \protect. (Technically there are several reasons why a command may fail being written to the toc file) "fragile" is the documented terminology of the LaTeX book. Jun 25, 2013 at 14:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .