latex - 在乳胶中的 TOC 标题前添加一些空格
问题描述
我尝试在 TOC 之前添加一些空格,我使用\vspace
了但它不起作用
\documentclass[12pt, french,a4paper]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
%...
\vspace*{.3\paperheight} %doesn't work
\tableofcontents
%...
\chapter{chapitre}
\section{section}
\subsection{subsection}
\newpage
\chapter{chapitre}
\section{section}
\subsection{subsection}
\end{document}
有人有解决方案吗?
解决方案
目录将自动在新页面上开始新章节。如果你\vspace
在它之前使用,它仍然会在前一页上,对你的目录没有任何影响。但是,您可以更改 toc 的定义并在其中添加一些空格:
\documentclass[12pt, french,a4paper]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\vspace{5cm}\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother
\begin{document}
%...
\tableofcontents
%...
\chapter{chapitre}
\section{section}
\subsection{subsection}
\newpage
\chapter{chapitre}
\section{section}
\subsection{subsection}
\end{document}
推荐阅读
- java - 最终字段的 ConfigurationProperties 不起作用
- azure-iot-edge - 节点模块无法在边缘启动
- reactjs - Reactjs - 数据被多次获取
- python - Odoo 13:登录后如何检查允许公司中的所有公司?
- c++ - Arduino CANBUS MCP2515 扩展 ID 接收过滤器问题
- sql - 在数据库中的每个团队中查找最年轻的
- heatmap - dc.js:在热图中显示所有域 x 值
- html - 响应式电子邮件签名在 iPhone 上不起作用
- python - argparser 覆盖设置选项手册
- python - 如何获取pandas DataFrame中两列的每一行的p值?