# Algorithm2e error reserved keyword

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

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

Fragile commands in moving arguments need \protect
• @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. – David Carlisle Jun 25 '13 at 14:01