Re: Strange message for \nobreakdash inside a \caption



On Feb 29, 6:30 pm, "Mariano Suárez-Alvarez"
<mariano.suarezalva...@xxxxxxxxx> wrote:
Hi all,

the following little piece of code results in an unintelligible error:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{figure}
A figure goes here.
\caption{The caption\nobreakdash-goes here}
\end{figure}
\end{document}

This is using amsmath's \nobreakdash.
If one changes that to plain latex's \nobreakdashes
the error goes away.

Is there any actual difference between the two macros?
They are similarly scary...

-- m


\nobreakdashes is robust whereas \nobreakdash is fragile, so you need
to protect it:

\caption{The caption\protect\nobreakdash-goes here}

Regards
Nicola Talbot
.