0

I'm using my University's template to typeset my document and it's messing up some things about the subfigure captions in my document. This is a MWE .tex file that demonstrates my issue:

\documentclass[language=english,stage=alpha]{FRIteza}

\usepackage{graphicx}

\newlength{\colwidth}
\newlength{\rowheight}

\begin{document}

\begin{figure*}
    \setlength{\colwidth}{.24\linewidth}
    \setlength{\rowheight}{.57\colwidth}
    \begin{subfigure}{\colwidth}
        \includegraphics[width=\textwidth,height=\rowheight]{example-image-a}
        \caption{Image A}
        \label{fig:a}
    \end{subfigure}\hfill%
    \begin{subfigure}{\colwidth}
        \includegraphics[width=\textwidth,height=\rowheight]{example-image-b}
        \caption{Image B}
        \label{fig:b}
    \end{subfigure}\hfill%
    \begin{subfigure}{2\colwidth}
        \includegraphics[width=\textwidth,height=\rowheight]{example-image-c}
        \caption{Image C}
        \label{fig:c}
    \end{subfigure}\hfill%
    \caption{3 sample images, specifically \subref{fig:a} an excerpt from A, \subref{fig:b} some stuff from B, and \subref{fig:c} things from C.}
    \label{fig:example}
\end{figure*}

Fig.~\ref{fig:example} shows some examples. Note the big letter C in Fig.~\ref{fig:c}.

\end{document}

I also made an Overleaf project that contains the class files and the required fonts, and can be downloaded as a zip file. It also has the correct software versions set up (TeX Live 2019 and XeLaTeX).

How it looks:

Desired outcome

How I'd like it to look:

Actual outcome

In the projects I've done so far, the subcaptions have normally been centered by default. I've also tried to center them manually using this advice:

\captionsetup[subfigure]{justification=centering}

I've tried adding this line right after the \documentclass declaration, inside the figure environment, and inside the subfigure environment. None of these worked as the captions were still left-aligned.

Additionally, when I reference the captions in text, \ref references to subfigures don't include the parentheses. I.e. they are referred to as Fig. 0.1c, instead of Fig. 0.1(c). I've fixed this in another project by using the following:

\usepackage{caption}
\makeatletter
\DeclareCaptionLabelFormat{mysublabelfmt}{(\alph{sub\@captype})}
\makeatother
\usepackage[labelformat=mysublabelfmt]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\renewcommand\thesubtable{(\alph{subtable})}

However, in this project now this same code gives me double parentheses around \subrefs.

The only code in the .cls I can find that alters caption positioning and reference format is this:

\RequirePackage[style=base]{caption}
\DeclareCaptionLabelSeparator{br}{\par\vspace*{2\p@}}
\captionsetup{singlelinecheck=off,labelsep=br,labelfont=it,textfont={RaggedRight,scriptsize}}
% subcaptions
\RequirePackage{subcaption}
\captionsetup[sub]{subrefformat=parens}
\captionsetup[sub]{format=plain,labelformat=parens,labelsep=space,font={normalfont,scriptsize},labelfont=up,hypcap=true}

but this doesn't seem to change anything about subcaption adjustment. And as far as the issue with the referencing style, I've tried to mess around with these subrefformat, format, and labelformat properties along with the \renewcommands from the previously mentioned solution but I can't get all the references and captions to be parenthesised as shown in the image.

I've checked some other students' accepted submissions and they have centered subcaptions (though they seemingly did it by manually captioning the images in image editing software rather than in TeX), so these left-adjusted subcaptions don't seem to be a typesetting requirement, and they really make some of my figures unclear and difficult to read.

So, in short:

  1. How do I center the subfigure captions, while keeping the figure caption style as is?
  2. How do I parenthesise the \ref subfigure referencing, while keeping both \subref subfigure referencing and \ref figure referencing as is?
7
  • 2
    Document class FRIteza apparently has built in subfigure and caption styles. If this is for publication, don't mess with it. Commented Jan 15, 2023 at 3:30
  • Regarding the reference style, add to preamble \captionsetup[sub]{subrefformat=simple} followed by \renewcommand\thesubfigure{(\alph{subfigure})}. It should give you the style you are looking for.
    – Celdor
    Commented Jan 15, 2023 at 11:15
  • @Celdor this unfortunately makes the caption labels have double parentheses (so subfigures are captioned as "((a)) Image A", etc.). Commented Jan 15, 2023 at 22:10
  • @JohnKormylo I've checked other submissions and several contain subfigures with centralized captions. I can live with the referencing style not being parenthesised as I want it to be, but the left-aligned subcaptions really reduce the clarity of some of my figures. Commented Jan 15, 2023 at 22:11
  • Worst case, you can create your own caption command. See tex.stackexchange.com/questions/497597/… for example. Commented Jan 15, 2023 at 22:30

1 Answer 1

0

Combining the advice from the comments, I've managed to get my captions to be placed and referenced as I wanted them to be with the following approach:

\DeclareCaptionFormat{centered}{%
    \scriptsize\centerline{#1#2\textit{#3}}
}
\captionsetup[sub]{format=centered,labelformat=simple,subrefformat=simple}
\renewcommand{\thesubfigure}{(\alph{subfigure})}

You must log in to answer this question.

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