Theses, Books, Title pagesReference to Subfigures

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
maccp1893
Posts: 2
Joined: Sun Jan 01, 2017 6:11 pm

Reference to Subfigures

Post by maccp1893 »

Hallo everybody.

I am unsing the template for Theses of Sunil Patel provided by LaTeX-Templates.

I am trying to reference to subfigures but I don't get it correctly. I include my figures with

Code: Select all

\begin{figure*}[htbp] 
    \centering
    \begin{subfigure}[c]{0.27\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Fig1}
        \caption{Fig1}
        \label{fig: Fig1}
    \end{subfigure}%
    ~ 
    \begin{subfigure}[c]{0.27\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Fig2}
        \caption{Fig2}
        \label{fig: Fig2}
    \end{subfigure}
    ~ 
    \begin{subfigure}[c]{0.27\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Fig3}
        \caption{Fig3}
        \label{fig: Fig3}
    \end{subfigure}
    \decoRule
    \caption[Caption]{Caption}
    \label{fig: Figures}
\end{figure*}
and this works quite well.

However, if I reference to one of the Subfigures, say to Fig1, via \ref{fig: Fig1} I get the reference 1.1a (for example). But in the subfigures are labeled with uppercase letters (A), (B), etc. So what I would like to get is a reference like 1.1(A).

Can someone help me to fix this problem?

Thanks in advance!

Edit: I forgot to mention that I use Version 2.X with major modifications by vel@latextemplates.com

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Reference to Subfigures

Post by Johannes_B »

Simple alternative: Use \captionsetup[subfigure]{labelfont=rm} after loading package subcaption.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
maccp1893
Posts: 2
Joined: Sun Jan 01, 2017 6:11 pm

Reference to Subfigures

Post by maccp1893 »

You are awesome! Hadn't thought to get an answer an new years eve!

Your solution changed the enumeration of the subfigures to lowercase letters which is nice. You linked the package site of CTAN in your answer, I checked the docu before but coudn't get by.

Would you be so kind to additionally tell my how to change the reference style from 1.1a to 1.1(a)? (Global, self-evidently.)

EDIT: Okay, I made it by myself. Thank you anyway! You saved me from a midnight frustration!
Post Reply