![将节样式格式化为点](https://linux22.com/image/339338/%E5%B0%86%E8%8A%82%E6%A0%B7%E5%BC%8F%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%B8%BA%E7%82%B9.png)
这是代码,更改文档正文中的部分格式。
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.
输出: