
答え1
パッケージの機能を使用してsubcaption
、ラベルとその参照をカスタマイズできます。これらの丸で囲まれた数字を描画するには、TikZ を使用するのが最も簡単だと思います。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{tikz}
\newcommand*{\circlednumber}[1]{%
\tikz[text=white, font=\bfseries, baseline=(X.base)]{%
\node[circle, draw=red!70!black, fill=red!70!black, inner sep=1.5pt] (X) {#1};
}%
}
\renewcommand{\thesubfigure}{\arabic{subfigure}}
\DeclareCaptionLabelFormat{circled}{\circlednumber{#2}}
\captionsetup[subfigure]{labelformat=circled}
\captionsetup{subrefformat=circled}
\begin{document}
References to subfigures \subref{fig:A} and \subref{fig:B}.
\begin{figure}
\begin{subfigure}{.45\textwidth}
\includegraphics[width=\linewidth]{example-image-A}
\caption{A first subfigure.}
\label{fig:A}
\end{subfigure}
\begin{subfigure}{.45\textwidth}
\includegraphics[width=\linewidth]{example-image-B}
\caption{A second subfigure.}
\label{fig:B}
\end{subfigure}
\end{figure}
\end{document}
この例では、参照の書式は、サブ参照、つまり\subref
コマンドを使用して作成された参照用です。 を単に使用しても、\ref
円を使用して参照がフォーマットされません。