首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

如何在LaTeX中将目录的标题居中?

要在LaTeX中将目录的标题居中,您可以使用以下代码:

代码语言:latex
复制
\documentclass{article}

\usepackage{tocloft}

\renewcommand{\cfttoctitlefont}{\hfill\Huge\bfseries\centering}
\renewcommand{\cftaftertoctitle}{\hfill}

\begin{document}

\tableofcontents

\section{Section 1}
\subsection{Subsection 1.1}
\subsection{Subsection 1.2}

\section{Section 2}
\subsection{Subsection 2.1}
\subsection{Subsection 2.2}

\end{document}

这将使目录标题居中,并在标题下方添加一个水平线。您可以根据需要调整字体大小和样式。

页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

领券