0

I want to cite a page within a subfigure. The parsing process breaks because tex assumes the page brackets for the page ref ] are closing the subfloat command. How can I prevent this or how can I correctly cite a page in a subfigure?

\begin{figure}[H]
  \centering
  \subfloat[Confusion matrix for multi-class classification. The confusion matrix of a classification with n classes. When considering the class $k$ $(0 \leq k \leq n)$, the four different classification results can be obtained: true positive (green), true negative (orange), false positive (brown), and false negative (red) \citep[p.73]{kruger2016activity}.]{\includegraphics[width=0.4\textwidth]{multiclass-conf-matrix-alt.png}
  \label{fig:mult-mat}}
  \hfill
  \subfloat[Example for a multiclass confusion matrix \citep{baeld:f1}.]
  {\includegraphics[width=0.55\textwidth]{binary_classes-multi-class-1.png}
  \label{fig:mult-ex}}
  \caption{Multiclass confusion matrices.}
  \label{fig:multi-conf-mat}
\end{figure}

enter image description here

3

If you want to use a ] inside an optional argument, you can enclose it in curly braces, e.g.,

\subfloat[Example for a multiclass confusion matrix {\citep[47]{baeld:f1}}.]
  {\includegraphics[width=0.55\textwidth]{binary_classes-multi-class-1.png}
1
  • I didn't know that. Fantastic answer. Thank you. However, the system tells me that I need 3 more minutes to wait until I can accept it. – Smittie Jan 12 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.