Code: Select all
% !TEX xelatex
\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}
How it looks:

How I'd like it to look:

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:
Code: Select all
\captionsetup[subfigure]{justification=centering}
\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 refered to as Fig. 0.1c, instead of Fig. 0.1(c). I've fixed this in another project by using the following:
Code: Select all
\usepackage{caption}
\makeatletter
\DeclareCaptionLabelFormat{mysublabelfmt}{(\alph{sub\@captype})}
\makeatother
\usepackage[labelformat=mysublabelfmt]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\renewcommand\thesubtable{(\alph{subtable})}
\subref
s.The only code in the .cls I can find that alters caption positioning and reference format is this:
Code: Select all
\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}
subrefformat
, format
, and labelformat
properties along with the \renewcommand
s 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:
- How do I center the subfigure captions, while keeping the figure caption style as is?
- How do I parenthesise the
\ref
subfigure referencing, while keeping both\subref
subfigure referencing and\ref
figure referencing as is?