我一直在处理一篇论文。我遇到了两个具体问题。
我通过以下代码解决了第二个问题。但对于 ToC 的第一个问题,我还没有找到任何解决\@dottedtocline{1}{1.5em}
方案。\@dottedtocline{1}{0em}
\makeatletter
\xpatchcmd\@dottedtocline
{\leaders\hbox{$\m@th\mkern\@dotsep mu\hbox{.}\mkern\@dotsep mu$}}
{}
{}{\fail}
% enlarge label width
\renewcommand*\l@figure{\@dottedtocline{1}{0em}{4em}}
\renewcommand*\l@table{\@dottedtocline{1}{0em}{5em}}
\makeatother
MWE 如下所示
\documentclass[12pt,a4paper]{report}
%%--------------Basic Packages------------%%
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[top=2.54cm, bottom=2.54cm, left=3.56cm, right=2.54cm]{geometry}
%\usepackage[labelfont=bf, labelsep=space]{caption}
%\usepackage[belowskip=4pt, labelformat=simple]{subcaption}
\usepackage{titletoc}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{titletoc} % Chapter title formatting in ToC
\titlecontents{chapter}[17pt]{\vskip8pt}{\fontsize{14}{16.8}\selectfont\bfseries\MakeUppercase{chapter}~\thecontentslabel\quad}{\bfseries}{\bfseries\hfill\contentspage}[\vskip5pt]
\begin{document}
\tableofcontents
\listoffigures
\chapter{Introduction}
\section{Introduction}
\lipsum[2-3]
\begin{figure}[!htb]
\centering
\includegraphics[width=6cm]{example-image}
\caption{Light Clock}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=6cm]{example-image}
\caption{Light Clock}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=6cm]{example-image}
\caption{Light Clock}
\end{figure}
\end{document}
答案1
我改为17pt
,并补充\titlecontents{chapter}[17pt]...
道0pt
\dottedcontents{section}[2.3em]{}{2.3em}{1pc}
\dottedcontents{figure}[2.3em]{}{2.3em}{1pc}
\dottedcontents{table}[2.3em]{}{2.3em}{1pc}
完整示例
\documentclass[12pt,a4paper]{report}
%%--------------Basic Packages------------%%
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[top=2.54cm, bottom=2.54cm, left=3.56cm, right=2.54cm]{geometry}
\geometry{showframe}
%\usepackage[labelfont=bf, labelsep=space]{caption}
%\usepackage[belowskip=4pt, labelformat=simple]{subcaption}
%\usepackage{titletoc}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{titletoc} % Chapter title formatting in ToC
\titlecontents{chapter}[0pt]{\vskip8pt}{\fontsize{14}{16.8}\selectfont\bfseries\MakeUppercase{chapter}~\thecontentslabel\quad}{\bfseries}{\bfseries\hfill\contentspage}[\vskip5pt]
\dottedcontents{section}[2.3em]{}{2.3em}{1pc}
\dottedcontents{figure}[2.3em]{}{2.3em}{1pc}
\dottedcontents{table}[2.3em]{}{2.3em}{1pc}
\begin{document}
\tableofcontents
\listoffigures
\chapter{Introduction}
\section{Introduction}
\lipsum[2-3]
\begin{figure}[!htb]
\centering
\includegraphics[width=6cm]{example-image}
\caption{Light Clock}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=6cm]{example-image}
\caption{Light Clock}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=6cm]{example-image}
\caption{Light Clock}
\end{figure}
\end{document}