有很多主题。但这些对我的目录没有帮助。即使是那个命令\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
。你能猜出原因吗?
\documentclass[a4paper, 14pt]{article}
\usepackage[14pt]{extsizes}
\usepackage{floatrow,caption}
\usepackage[usenames,dvipsnames,pdftex]{xcolor}
\floatsetup[table]{capposition=top}
\captionsetup[table]{singlelinecheck=false, justification=RaggedLeft}
\usepackage{extsizes}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{EuScript}
\usepackage{wrapfig}
\usepackage[left=30mm, top=20mm, right=15mm, bottom=20mm ]{geometry}
\usepackage{setspace}
\usepackage[tocflat]{tocstyle}
\usetocstyle{standard}
\usepackage{tocloft}
\makeatletter
\renewcommand\tableofcontents{%
\null\hfill\textbf{\Large\contentsname}\hfill\null\par
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\@starttoc{toc}%
}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\begin{document}
\tableofcontents
\section{one}
\subsection{one one}
\section{two}
\end{document}
答案1
使用两个具有类似实用程序的软件包时要非常小心。这通常会导致兼容性问题。在您的示例中,keeptocloft
和 leave outtocstyle
解决了这个问题。
\documentclass{article}
%\usepackage[tocflat]{tocstyle}
%\usetocstyle{standard}
\usepackage{tocloft}
% redefining \tableofcontents is irrelavent
%\makeatletter
%\renewcommand\tableofcontents{%
% \null\hfill\textbf{\Large\contentsname}\hfill\null\par
% \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
% \@starttoc{toc}%
%}
%\makeatother
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\begin{document}
\tableofcontents
\section{one}
\subsection{one one}
\section{two}
\end{document}
答案2
您强制使用标准 tocstyle,该样式现已被删除
\documentclass[a4paper, 14pt]{article}
\usepackage[14pt]{extsizes}
\usepackage{floatrow,caption}
\usepackage[usenames,dvipsnames,pdftex]{xcolor}
\floatsetup[table]{capposition=top}
%\captionsetup[table]{singlelinecheck=false, justification=RaggedLeft}
\usepackage{extsizes}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{EuScript}
\usepackage{wrapfig}
\usepackage[left=30mm, top=20mm, right=15mm, bottom=20mm ]{geometry}
\usepackage{setspace}
%\usepackage[tocflat]{tocstyle}%<----------removed
%\usetocstyle{standard}%<-------------------removed
\usepackage{tocloft}
\makeatletter
\renewcommand\tableofcontents{%
\null\hfill\textbf{\Large\contentsname}\hfill\null\par
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\@starttoc{toc}%
}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\begin{document}
\tableofcontents
\section{one}
\subsection{one one}
\section{two}
\end{document}