Disabling captions in LaTeX subfigures and dividing figures between multiple pages | Karol Działowski

Disabling captions in LaTeX subfigures and dividing figures between multiple pages

Motivation

While writing my thesis paper I have encountered problem with subfigure captions. I wanted to get rid off subfigure numbers, i.e. "(a)" or "(b)". I didn't want to disable subcaptions in entire document but do this locally.

That is my LaTeX code that renders following figure:

\begin{figure}[H]
\centering
\begin{subfigure}{1\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_maps/maps_02.pdf}
  \caption{}
\end{subfigure}
\begin{subfigure}{1\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_maps/maps_03.pdf}
  \caption{}
\end{subfigure}
\caption{Mapy błędów odległości wyrażonych w metrach.}
\source{Opracowanie własne}
\label{fig:distance_maps}
\end{figure}

Notice "(a)" and "(b)" subcaptions.

Notice "(a)" and "(b)" subcaptions.

Disabling captions using \captionsetup

One way of disabling subcaptions is adding \captionsetup[subfigure]{labelformat=empty} in figure environment [stack overflow]. However, this doesn't remove white space between subfigures.

\begin{figure}[H]
\captionsetup[subfigure]{labelformat=empty}
\centering
\begin{subfigure}{1\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_maps/maps_02.pdf}
  \caption{}
\end{subfigure}
\begin{subfigure}{1\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_maps/maps_03.pdf}
  \caption{}
\end{subfigure}
\caption{Mapy błędów odległości wyrażonych w metrach.}
\source{Opracowanie własne}
\label{fig:distance_maps}
\end{figure}

Notice white spaces between subfigures.

Notice white spaces between subfigures.

Removing \caption{} or using \caption*{}

The best way to remove subcaptions is simply removing \caption{} from each subfigure. If you want to have some subcaption but without numbering then you can use \caption*{}.

Good comment from Paul Gavrikov: \caption*{} does not remove the captions but creates invisible ones. However, they still occupy space. Use \phantomsubcaption from the subcaption package to actually create fake labels.

No white space and no numbering. Perfection!

No white space and no numbering. Perfection!

Dividing long figures between multiple pages

If you have many subfigures then probably they take to much space and often are not entirely visible. If you want to split subfigures between pages then you can split them into multiple figure environments. Use \ContinuedFloat for mantaining captions numbering [stack overflow].

\begin{figure}[H]
\centering
\begin{subfigure}{0.75\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_plots/baltyk_koszalin_02.mp4.pdf}
  \caption{Materiał baltyk\_koszalin\_02.mp4}
  \label{}
\end{subfigure}
\caption{Porównanie błędów odległości dla różnych metod kalibracji wraz z informacją o przebiegu wychylenia kamery.}
\source{Opracowanie własne}
\label{fig:mean_distance_plots}
\end{figure}

\begin{figure}[H]\ContinuedFloat
\centering
\begin{subfigure}{0.75\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_plots/baltyk_koszalin_03_03.mp4.pdf}
  \caption{Materiał baltyk\_koszalin\_03\_03.mp4}
  \label{}
\end{subfigure}
\begin{subfigure}{0.75\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{graphic/evaluation/distance_plots/baltyk_koszalin_06_07.mp4.pdf}
  \caption{Materiał baltyk\_koszalin\_06\_07.mp4}
  \label{}
\end{subfigure}
\caption{Porównanie błędów odległości dla różnych metod kalibracji wraz z informacją o przebiegu wychylenia kamery.}
\source{Opracowanie własne}
\label{fig:mean_distance_plots}
\end{figure}

Spliting subfigures. Notice that the subcaptions numbering is continued.

Spliting subfigures. Notice that the subcaptions numbering is continued.

© karlosos 2020 Open sourced on