请问这样的目录该怎么设置呢?

发布于 2024-04-05 00:37:08

请问这样的目录该怎么实现呢?
image.png

查看更多

关注者
0
被浏览
292
LaTeXStudio
LaTeXStudio 2024-04-05
这家伙很懒,什么也没写!

可以重定义下 \tableofcontents 如下示例:

\documentclass{article}
\usepackage{multicol,xcolor}

\makeatletter
\setlength{\columnseprule}{1pt}
\renewcommand{\columnseprulecolor}{\color{green}} 
\renewcommand\tableofcontents{%
    \section*{\makebox[\linewidth][c]{\contentsname}%
      \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \begin{multicols}{2}%
    \@starttoc{toc}%
    \end{multicols}
    }
\makeatother

\begin{document}

\tableofcontents

\section{test}

\section{another test}
\end{document} 

效果如下:
image.png

1 个回答

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览