0

I am working on my thesis. There is this rule for the enumeration of the sub-figures:

Sub-figures should be enumerated by adding the corresponding lowercase letter to the Figure designation such as Figure 3.8a

However, I could only manage the 3.8(a)

The code that I am using this:

\begin{figure}[h]
\subfigure[]{\includegraphics[width=\textwidth]{2016.png}
\label{2016}}
\subfigure[]{\includegraphics[width=\textwidth]{2017.png}
\label{2017}}
\caption{Graphs of daily averages of Turkish hourly electricity consumption values in \subref{2016} 2016
\subref{2017} 2017.}
\label{consumptions}
\end{figure}

The thesis rules tell us to use subfigure package. How can I get 3.8a instead of 3.8(a)? Thank you!

1
  • 3
    Welcome t TeX.SE! Please provide complete small document with your figures. Off-topic: it seems that you use obsolete package subfigure.
    – Zarko
    Apr 10, 2020 at 7:12

1 Answer 1

3

As pointed by @Zarko in the comments, subfigure is deprecated and is now covered by subfig or subcaption.

To achieve what you want with subcaption we'll change the default setup by adding :

\usepackage[labelformat=simple]{subcaption} %%default is [labelformat=parens]

%%Setup for captions
%%If you want figure numbering as 'figure 3.8'
\renewcommand{\thefigure}{\thechapter.\arabic{figure}}
%%if you want 3.8a for subfigure
\renewcommand{\thesubfigure}{\normalsize\thefigure.\alph{subfigure}:}
%%if you want figure 3.8a for subfigure
\renewcommand{\thesubfigure}{\normalsize figure \thefigure.\alph{subfigure}:}

Here is a complete testing code :

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage{caption}

\usepackage[labelformat=simple]{subcaption} %%default is [labelformat=parens]
%%If you want figure numbering as 'figure 3.8'
\renewcommand{\thefigure}{\thechapter.\arabic{figure}}
%%if you want 3.8a
%\renewcommand{\thesubfigure}{\normalsize\thefigure.\alph{subfigure}:}
%%if you want figure 3.8a
\renewcommand{\thesubfigure}{\normalsize figure \thefigure.\alph{subfigure}:}



\begin{document}
    \chapter{fist chapter}
    \begin{figure}
        \centering
        \begin{subfigure}{0.45\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{Test}
        \end{subfigure}\hfill
        \begin{subfigure}{0.45\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{Test}
        \end{subfigure}
        \caption{Total}
    \end{figure}
\end{document}

Who produces the following output :

Output

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.