【问题标题】:Add some space befor TOC title in latex在乳胶中的 TOC 标题之前添加一些空格
【发布时间】:2020-10-10 18:44:46
【问题描述】:

我尝试在 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}

有人有解决办法吗?

【问题讨论】:

  • 我想这在这里直言不讳。在 LaTeX 上移动的标记。
  • 好的对不起,怎么搬,这个话题

标签: latex latex-environment


【解决方案1】:

目录将自动在新页面上开始新章节。如果您在它之前使用\vspace,它仍然会在前一页上,并且对您的目录没有任何影响。但是,您可以更改目录的定义并在其中添加一些空间:

\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}

【讨论】:

  • 感谢重新定义的技巧,它完美运行,我最近开始使用乳胶。我将记录自己,以了解如何重新定义命令,以备后用
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-17
  • 2023-03-23
  • 1970-01-01
  • 1970-01-01
  • 2017-12-26
  • 1970-01-01
相关资源
最近更新 更多