3

I have a figure as follows, and it captions the two figures with (a) and (b) but I would like to have them labelled as Figure 1 and Figure 2. The figure numbering should be consistent with the rest of the document (ie not a separate numbering).

    \begin{figure}[h!]
    \centering
    \begin{subfigure}[t]{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{rolling_sml}
        \caption{Hot rolling to produce a rod of the required diameter.}\label{fig:rolling}
    \end{subfigure}
    ~
    \begin{subfigure}[t]{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{thread400x}
        \caption{A microstructure sketch of the grains near the thread of one of the screws.}\label{fig:screwthread}
    \end{subfigure}
\end{figure}

Actual appearance

This actual appearance is not what I want. Is there any way of making the captions just follow the main numbering?

4
  • 3
    If I understand correctly, if you use minipages instead of subfigures you should get what you want.
    – gusbrs
    Mar 26, 2018 at 19:24
  • \renewcommand{\thesubfigure}{\arabic{subfigure}} should help
    – user31729
    Mar 26, 2018 at 19:24
  • Thanks, using minipage produces exactly the right results. (The renewcommand doesn't leave the numbering consistent with the rest of the document)
    – Oscar S
    Mar 26, 2018 at 19:35
  • @OscarS: Since you have not provided any document at all, the consistency of your numbering scheme is not obvious to us, so the \renewcommand was a valid suggestion.
    – user31729
    Mar 26, 2018 at 19:37

1 Answer 1

4

A subfigure environment is nothing but a minipage environment that provides some extra styling for the \caption command. Since you don't need this styling, don't use subfigures. Instead, use minipages directly.

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\begin{document}

\begin{figure}[h!]
\begin{minipage}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{rolling_sml}
\caption{Hot rolling to produce a rod of the required diameter.}
\label{fig:rolling}
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{thread400x}
\caption{A microstructure sketch of the grains near the thread of one of the screws.}
\label{fig:screwthread}
\end{minipage}
\end{figure}

\end{document}

You must log in to answer this question.

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