4

I want to place a clipped math symbol in table caption. This MWE works until I uncomment the marked line

\documentclass{amsart}
\usepackage{trimclip}
\begin{document}
\begin{table}
\caption{Clipped symbol in table caption
%\clipbox{.7ex 0ex 0ex 0ex}{$k$}          % <--- Uncomment this line
}
Clipped symbol in table body \clipbox{.7ex 0ex 0ex 0ex}{$k$}
\end{table}
\end{document}

and gives this

No clipped symbol in caption

But when I do uncomment the above line, i get the error

! Undefined control sequence.
\@tempa ->\@nil

l.7 }

?

How do I go about it?

Martin Scharrer
  • 262,582
Anvita
  • 237

1 Answers1

6

You should put \protect before \clipbox.

For the explanation, see here: What is the purpose of \protect?

\documentclass{amsart}
\usepackage{trimclip}
\begin{document}
\begin{table}
\caption{Clipped symbol in table caption
\protect\clipbox{.7ex 0ex 0ex 0ex}{$k$}          % <--- Uncomment this line
}
Clipped symbol in table body \clipbox{.7ex 0ex 0ex 0ex}{$k$}
\end{table}
\end{document}

enter image description here

CarLaTeX
  • 62,716