1

I have a script that generates a figure

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}

\begin{figure}
\subfloat[]{\includegraphics[width=1\textwidth]{example-image-a}}
\caption{}
\end{figure}

\end{document}

enter image description here

However, I would like to have

(a) text <manual spacing> (b) text <manual spacing> (c) text

How can I achieve this? For example, something like \subfloat[][][]{\includegraphics[width=1\textwidth]{example-image-a}}

2 Answers 2

2
\begin{figure}
     \centering
     \begin{subfigure}[b]{0.3\textwidth}
         \centering
         \includegraphics[width=\textwidth]{graph1}
         \caption{$y=x$}
         \label{fig:y equals x}
     \end{subfigure}
     \hfill
     \begin{subfigure}[b]{0.3\textwidth}
         \centering
         \includegraphics[width=\textwidth]{graph2}
         \caption{$y=3sinx$}
         \label{fig:three sin x}
     \end{subfigure}
     \hfill
     \begin{subfigure}[b]{0.3\textwidth}
         \centering
         \includegraphics[width=\textwidth]{graph3}
         \caption{$y=5/x$}
         \label{fig:five over x}
     \end{subfigure}
        \caption{Three simple graphs}
        \label{fig:three graphs}
\end{figure}

Result

Result

Taken from Overleaf

2
  • that is 3 captions for 3 figures not 1
    – Kong
    Commented Aug 15, 2022 at 15:26
  • but you said you wanted something like (a) text <manual spacing> (b) text <manual spacing> (c) text.
    – Elyo
    Commented Aug 15, 2022 at 15:40
0

I solved it by adding (a) text <manual spacing> (b) text <manual spacing> (c) text into the figure itself so now I can have 1 figure with 3 captions.

1
  • Your answer can't be helpful to anyone. Please extend it to MWE, which produce what you after. To my opinion @Elyo answer (+1) is far better and consistent.
    – Zarko
    Commented Sep 5, 2022 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .