Notas de rodapé entre subfiguras em uma classe de documento independente

Notas de rodapé entre subfiguras em uma classe de documento independente

No MCE seguinte, a nota de rodapé está entre a primeira e a segunda subfiguras. Ok, a classe do documento está standalonee o log me avisa:

Aviso LaTeX: Minipágina aninhada: as notas de rodapé podem estar mal colocadas na linha de entrada 11.

Mas como contornar um comportamento tão estranho?

\documentclass[varwidth=18cm]{standalone}

\usepackage{subcaption}

\begin{document}

Some dummy text with a footnote\footnote{This is the footnote's content.}.

\begin{figure}[ht]
  \centering
  \begin{subfigure}[b]{.3\linewidth}
    \centering
    First subfigure
    \caption{Caption of the first subfigure}
  \end{subfigure}
  \begin{subfigure}[b]{.3\linewidth}
    \centering
    Second subfigure
    \caption{Caption of the second subfigure}
  \end{subfigure}
  \begin{subfigure}[b]{.3\linewidth}
    \centering
    Third subfigure
    \caption{Caption of the third subfigure}
  \end{subfigure}
  \caption{Caption of the (global) figure}
\end{figure}

Some dummy text.
\end{document}

insira a descrição da imagem aqui

Responder1

Isso usa uma caixa de salvamento para expandir as minipáginasantesa nota de rodapé. Observe que \centeringnão faz nada dentro de um varwidth.

\documentclass[varwidth=18cm]{standalone}

\usepackage{subcaption}

\begin{document}

\sbox0{\begin{varwidth}{18cm}
\begin{figure}[ht]
  \centering
  \begin{subfigure}[b]{.3\linewidth}
    \centering
    First subfigure
    \caption{Caption of the first subfigure}
  \end{subfigure}
  \begin{subfigure}[b]{.3\linewidth}
    \centering
    Second subfigure
    \caption{Caption of the second subfigure}
  \end{subfigure}
  \begin{subfigure}[b]{.3\linewidth}
    \centering
    Third subfigure
    \caption{Caption of the third subfigure}
  \end{subfigure}
  \caption{Caption of the (global) figure}
\end{figure}%
\end{varwidth}}

Some dummy text with a footnote\footnote{This is the footnote's content.}.

\noindent\usebox0

Some dummy text.
\end{document}

informação relacionada