0

According to Adding tikz figure in caption it suffices to add protect to make my program compile. Indeed, it compiles after adding the command, but TeX still throws an error message that the control sequence is undefined.

What portion of the command definition of \circled leads to the problem?

\documentclass[twoside,runningheads, oribibl, draft]{llncs}


\usepackage{graphicx}

\usepackage{tikz}

\newcommand*\circled[1]{%
    \protect\tikz[baseline=(char.base)]{%
        \node[shape=circle, draw, inner sep=1.5pt, font=\small] (char) {#1};
}}

\begin{document}

    \begin{figure}[h]
        Hello World
        \caption{Derivation of premise \circled{2}}
    \end{figure}
    
\end{document}
2
  • 4
    make the \circled command robust: \NewDocumentCommand\circled{m}{...} Jan 27, 2022 at 16:40
  • 1
    You need to put \caption{... \protect\circled{2}}. Putting \protect inside \circled is too late. Jan 27, 2022 at 20:32

0

You must log in to answer this question.

Browse other questions tagged .