将节样式格式化为点

将节样式格式化为点

这是代码,更改文档正文中的部分格式。

1 Start
2 Market Study
3 Stakeholder Opinions

到:

1. Start
2. Market Study
3. Stakeholder Opinions

来自[这个 StackExchange TeX 帖子]。

  • 如何采取行动,使 TOC 匹配?

但是,我该写什么来重新定义 \tableofcontents 命令中的样式呢?使用 article 类。

答案1

输入:

\usepackage{titletoc,titlesec}

\titlecontents{section}[0pt]
  {\bfseries\Large}
  {\thecontentslabel.\ }
  {}
  {\titlerule*[8pt]{.}\contentspage}
% ---
\titleformat{name=\section}[block]
  {\Large}{\textbf\thesection.}{6pt}{\bfseries}{\filleft}
\titleformat{name=\subsection}[block]
  {\normalfont}{\textbf\thesubsection}{6pt}{\bfseries}{\filleft}
\titleformat{name=\subsubsection}[block]
  {\normalfont}{\textbf\thesubsubsection}{6pt}{\bfseries}{\filleft}

\begin{document}
\pagenumbering{gobble}
\maketitle
\
\\
\centerline{\large{\thesubtitle}}
\
\\

\tableofcontents
\newpage
\pagenumbering{arabic}

\section{Introduction}
This is an introduction to the introduction, of an introduction.
\subsection{Main Article}
Now, write your main article here.
\subsection{Supporting Article}
Now, write article here.

\section{Follow-Up}
New section.
\subsection{New Article}
Now, write article here.
\subsection{Following Article}
Now, write article here.
\subsection{Conclusion}
Now, write article here.

输出:

在此处输入图片描述 在此处输入图片描述

相关内容