[texhax] illegal parameter

Barbara Beeton bnb at ams.org
Fri Jul 1 19:03:03 CEST 2011

    I am confused about the error I am getting in the following.
(I have commented out the file calls and the code which seems irrelevant to the problem.
I defined the macro \ve to replace \vec, since the latter puts a tiny arrow above even a long expression.
I presume this is the source of the problem, but I have used \ve millions of times with no such problem.)
The error points to the caption line (near the end of the figure->center environment, six lines before the end of the code.

i haven't tested this, but i suspect the
problem may be the use of non-robust
commands in the caption.  try putting
\protect before each of them:

\caption{$\protect\vu+(\protect\vv+\protect\vw)$(dashed)
$=(\protect\vu+\protect\vv)+\protect\vw$ (dotted)}

you also might want to consider using
\centering rather than
\begin{center} ... \end{center} in the
figure, to avoid the extra vertical space
that the center environment adds.

good luck.
-- bb
--------------------

%!TEX TS-program =  latex
\documentclass[11pt]{article}
[...]

\newcommand{\ve}[1]{\ensuremath{\overrightarrow{#1}}}

\newcommand{\vu}{\ve{u}}
\newcommand{\vv}{\ve{v}}
\newcommand{\vw}{\ve{w}}

\begin{document}
%a line before
\thispagestyle{empty}
\begin{figure}[htbp]
\begin{center}
[...]
\caption{$\vu+(\vv+\vw)$(dashed) $=(\vu+\vv)+\vw$ (dotted)}
\end{center}
\end{figure}

%a line after

\end{document}

The error I get is

./Briefpicturetest.tex:35: Illegal parameter number in definition of \reserved@
a.
<to be read again>
\crcr
l.35 ...v+\vw)$(dashed)$=(\vu+\vv)+\vw\$ (dotted)}

? ?

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/


More information about the texhax mailing list