目录序号与标题内容之间的间距如何调整?

2021-02-01 22:27发布

## 编译环境 操作系统 * [x ] Windows 7/8/10 * [ ] macOS * [ ] Linux `若需勾选,请把[ ]改成[x]` Tex发行版 * [x ] TexLive ...

## 编译环境 操作系统 * [x ] Windows 7/8/10 * [ ] macOS * [ ] Linux `若需勾选,请把[ ]改成[x]` Tex发行版 * [x ] TexLive `年份` * [ ] MikTeX `版本号` * [ ] CTeX VScode `若需勾选,请把[ ]改成[x]` ## 我的问题 ``` 一级标题序号与标题内容之间间距太大,但是二级标题和三级标题就正常 \usepackage{titletoc} \titlecontents{section}[4em]{\songti \zihao{-4}}{\contentslabel{4em}}{\songti \zihao{-4} \hspace*{-4em}}{~\titlerule*[0.6pc]{$.$}~\contentspage}% 设置目录格式 \titlecontents{subsection}[4em]{\songti \zihao{-4}}{\contentslabel{2em}}{\songti \zihao{-4} \hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}~\contentspage} \titlecontents{subsubsection}[7em]{\songti \zihao{-4}}{\contentslabel{3em}}{\songti \zihao{-4} \hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}~\contentspage} ```
1条回答
预言书
2021-02-03 16:49
根据你提供的代码简单的调整了一下, 下次提问给的代码要从 `\documentclass` 开始, 从 `\end{document}` 结束 ```latex \documentclass{ctexart} \usepackage{titletoc} \titlecontents{section}[2em]{\songti \zihao{-4}}{\contentslabel{1.5em}}{\songti \zihao{-4} \hspace*{-4em}}{~\titlerule*[0.6pc]{$.$}~\contentspage}% 设置目录格式 \titlecontents{subsection}[4em]{\songti \zihao{-4}}{\contentslabel{2em}}{\songti \zihao{-4} \hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}~\contentspage} \titlecontents{subsubsection}[7em]{\songti \zihao{-4}}{\contentslabel{3em}}{\songti \zihao{-4} \hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}~\contentspage} \begin{document} \tableofcontents \section{第一节} \subsection{第一小节} \subsubsection{第一小小节} \subsection{第二小节} \section{第二节} \subsection{第一小节} \subsubsection{第一小小节} \end{document} ``` ![](https://wenda.latexstudio.net/data/attach/210203/Cnc0duTv.png)

一周热门 更多>