
図のリストでは、サブ図の前に「図」という単語を付けたくありません。また、図のリストではサブ図の番号を括弧で囲み(つまり、「a」ではなく「(a)」)、また図のリストでは「SuperTest」図の「S」のすぐ下に付けたいと思います。
事前にどうもありがとうございました!
これが私の MWE です:
\documentclass[11pt]{article}
\usepackage{blindtext,tabularx,graphicx}
\usepackage[margin=1in]{geometry}
\usepackage[list=true]{subcaption}
\usepackage[labelfont=bf,labelsep=period]{caption}
\usepackage{tocloft}
\captionsetup[subfigure]{skip=8pt,position=bottom,font=bf}
\captionsetup[table]{font=bf}
\captionsetup[figure]{labelfont=bf}
%%%%%%%%%%%% ToC, LoF, LoT ADJUSTMENTS %%%%%%%%%%%%%%%%%%%%
% Formatting ToC
% Adjust spacing between number and title in ToC
% Adjust dots in ToC, LoF, LoT
\renewcommand\cftdotsep{1}
\makeatletter
\renewcommand{\@dotsep}{1}
\makeatother
\setlength{\cftfigindent}{0pt} % remove indentation from figures in lof
\setlength{\cfttabindent}{0pt} % remove indentation from tables in lot
% Formatting LoF
\setcounter{lofdepth}{2}
\cftpagenumbersoff{subfigure}
\makeatletter
\renewcommand\cftfigfont{\bfseries}
\makeatother
\makeatletter
\newcommand\cftsubtabdotsep{\cftdotsep}
\newcommand\cftsubfigfont{\normalfont}
\newcommand\cftsubfigpresnum{}
\newcommand\cftsubfigaftersnum{}
\newcommand\cftsubfigaftersnumb{}
\newcommand\cftsubfigleader{\hfill}
\newcommand\cftsubfigpagefont{\normalfont}
\newcommand\cftsubfigafterpnum{}
\providecommand{\toclevel@subfigure}{1}
\renewcommand*\l@subfigure[2]{%
\ifnum \c@lofdepth > \toclevel@subfigure
\vskip \cftbeforesubfigskip
{\leftskip \cftsubfigindent\relax
\rightskip \@tocrmarg
\parfillskip -\rightskip
\parindent \cftsubfigindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima \cftsubfignumwidth\relax
\let\@cftbsnum \cftsubfigpresnum
\let\@cftasnum \cftsubfigaftersnum
\let\@cftasnumb \cftsubfigaftersnumb
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{\cftsubfigfont #1}\nobreak
\cftsubfigfillnum{#2}}%
\fi
}%
\newlength\cftbeforesubfigskip
\setlength\cftbeforesubfigskip{\z@ \@plus.2\p@}
\newlength\cftsubfigindent
\setlength\cftsubfigindent{3.8em}
\newlength\cftsubfignumwidth
\setlength\cftsubfignumwidth{2.5em}
\renewcommand{\cftsubfigfillnum}[1]{%
{\cftsubfigleader\hfill}\par
}
\makeatother
% Formatting LoT
\setcounter{lotdepth}{1}
\makeatletter
\renewcommand\cfttabfont{\bfseries}
\makeatother
\begin{document}
\tableofcontents
\clearpage
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
}
%\listoffigures
\addcontentsline{toc}{section}{List of Figures}
\clearpage
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\tablename~\oldnumberline}%
\listoftables
}
\addcontentsline{toc}{section}{List of Tables}
\clearpage
\section{Nice0}
\begin{figure}[htb] \label{figure:Test}
\centering
\includegraphics[width=\textwidth]{example-image}
\captionsetup[subfigure]{skip=8pt,position=bottom}
\parbox{0.5\textwidth}{\subcaption[Test]{Test}}\hfill
\parbox{0.5\textwidth}{\subcaption[Test2]{Test2}}
\caption[SuperTest]{{\bf Test} \\Histogram of (a) Test and (b) most common Test sample.}
\end{figure}
\clearpage
\section{Nice1}
\begin{table}[htbp]\label{table:Test}
\caption[Test]{Test} \blindtext
\begin{center}
\begin{tabular}{|l||c|c|} \hline\hline
Ice Cream Store & Location & How to Get There \\ \hline
Toscanini’s & Central Square & Just walk! \\
Herrell’s & Harvard Square & Red Line \\
J.P. Licks & Davis Square & Red Line \\
Ben \& Jerry’s & Newbury Street & Green Line \\ \hline\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
答え1
サブ図の文字を囲む括弧については、独自のリスト形式を定義することができます。
\DeclareCaptionListFormat{myListFormat}{(#2)}
そして、サブキャプションパッケージを定義する際に次のように使用します。
\usepackage[list=true, listformat=myListFormat]{subcaption}
サブ図の前に「図」という接頭辞を付けたくない場合は、その部分を置き換える必要があります。
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
あなたのコードを
\renewcommand{\cftfigpresnum}{Figure~}
\setlength{\cftfignumwidth}{5em}
あなたのコードを完全に修正した例を追加しました。
\documentclass[11pt]{article}
\usepackage{blindtext,tabularx,graphicx}
\usepackage[margin=1in]{geometry}
\usepackage[labelfont=bf,labelsep=period]{caption}
\DeclareCaptionListFormat{myListFormat}{(#2)}
\usepackage[list=true, listformat=myListFormat]{subcaption}
\usepackage{tocloft}
\captionsetup[subfigure]{skip=8pt,position=bottom,font=bf}
\captionsetup[table]{font=bf}
\captionsetup[figure]{labelfont=bf}
%%%%%%%%%%%% ToC, LoF, LoT ADJUSTMENTS %%%%%%%%%%%%%%%%%%%%
% Formatting ToC
% Adjust spacing between number and title in ToC
% Adjust dots in ToC, LoF, LoT
\renewcommand\cftdotsep{1}
\makeatletter
\renewcommand{\@dotsep}{1}
\makeatother
\setlength{\cftfigindent}{0pt} % remove indentation from figures in lof
\setlength{\cfttabindent}{0pt} % remove indentation from tables in lot
% Formatting LoF
\setcounter{lofdepth}{2}
\cftpagenumbersoff{subfigure}
\makeatletter
\renewcommand\cftfigfont{\bfseries}
\makeatother
\makeatletter
\newcommand\cftsubtabdotsep{\cftdotsep}
\newcommand\cftsubfigfont{\normalfont}
\newcommand\cftsubfigpresnum{}
\newcommand\cftsubfigaftersnum{}
\newcommand\cftsubfigaftersnumb{}
\newcommand\cftsubfigleader{\hfill}
\newcommand\cftsubfigpagefont{\normalfont}
\newcommand\cftsubfigafterpnum{}
\providecommand{\toclevel@subfigure}{1}
\renewcommand*\l@subfigure[2]{%
\ifnum \c@lofdepth > \toclevel@subfigure
\vskip \cftbeforesubfigskip
{\leftskip \cftsubfigindent\relax
\rightskip \@tocrmarg
\parfillskip -\rightskip
\parindent \cftsubfigindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima \cftsubfignumwidth\relax
\let\@cftbsnum \cftsubfigpresnum
\let\@cftasnum \cftsubfigaftersnum
\let\@cftasnumb \cftsubfigaftersnumb
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{\cftsubfigfont #1}\nobreak
\cftsubfigfillnum{#2}}%
\fi
}%
\newlength\cftbeforesubfigskip
\setlength\cftbeforesubfigskip{\z@ \@plus.2\p@}
\newlength\cftsubfigindent
\setlength\cftsubfigindent{3.8em}
\newlength\cftsubfignumwidth
\setlength\cftsubfignumwidth{2.5em}
\renewcommand{\cftsubfigfillnum}[1]{%
{\cftsubfigleader\hfill}\par
}
\makeatother
% Formatting LoT
\setcounter{lotdepth}{1}
\makeatletter
\renewcommand\cfttabfont{\bfseries}
\makeatother
\begin{document}
\tableofcontents
\clearpage
{%
\renewcommand{\cftfigpresnum}{Figure~}
\setlength{\cftfignumwidth}{5em}
\listoffigures%
}
%\listoffigures
\addcontentsline{toc}{section}{List of Figures}
\clearpage
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\tablename~\oldnumberline}%
\listoftables
}
\addcontentsline{toc}{section}{List of Tables}
\clearpage
\section{Nice0}
\begin{figure}[htb] \label{figure:Test}
\centering
\includegraphics[width=\textwidth]{example-image}
\captionsetup[subfigure]{skip=8pt,position=bottom}
\parbox{0.5\textwidth}{\subcaption[Test]{Test}}\hfill
\parbox{0.5\textwidth}{\subcaption[Test2]{Test2}}
\caption[SuperTest]{{\bf Test} \\Histogram of (a) Test and (b) most common Test sample.}
\end{figure}
\clearpage
\section{Nice1}
\begin{table}[htbp]\label{table:Test}
\caption[Test]{Test} \blindtext
\begin{center}
\begin{tabular}{|l||c|c|} \hline\hline
Ice Cream Store & Location & How to Get There \\ \hline
Toscanini’s & Central Square & Just walk! \\
Herrell’s & Harvard Square & Red Line \\
J.P. Licks & Davis Square & Red Line \\
Ben \& Jerry’s & Newbury Street & Green Line \\ \hline\hline
\end{tabular}
\end{center}
\end{table}
\end{document}