1

Could someone explain me why putting tabular/array environments in captions (figure or table) results in errors. Moreover, the error description does not exactly point to the issue, but just reads

Undefined control sequence 
\hyper@makecurrent ...

What I would like is: include a matrix in a figure caption.

I know: - that my caption compiles normally as text - that

\begin{figure}
\includegraphics{aaa.EPS}
\caption{$\begin{array}{l} r\\ s\\ t\end{array}$}
\end{figure}

fails to work.

A similar issue happens in tabu environment: I cannot include \footnote{$\begin{array}{l} r\\ s\\ t\end{array}$}, though I can use \footnote{Text} and can use \footnotemark with \footnotetext{$\begin{array}{l} r\\ s\\ t\end{array}$} after \end{tabu}. Still, \footnotemark / \footnotetext messes up footnote numbering and positioning when several of them exist in the same table, so I wish having regular footnotes.

Thanks for your suggestions

2

enter image description here

\documentclass{article}
\usepackage{array}
\usepackage{graphicx}

\newsavebox{\foo}
\savebox{\foo}{$\begin{array}{l} r\\ s\\ t\end{array}$}

\pagestyle{empty}

\begin{document}

\begin{figure}
\centering
\includegraphics[scale=.2]{Grenouille}
\caption{\usebox{\foo}}
\end{figure}



\end{document}
  • Thanks a lot. Works perfectly in both environments (figure, footnote inside tabu). \newsavebox{\foo} can occur both before and after \begin{document} (even just before where it is used). – Pavel Mostovykh Apr 4 '18 at 16:18
  • Before or after works fine for me. You should make a mystake somewhere. Post as an edit your problematic code. – Tarass Apr 4 '18 at 16:21

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.