首先,我几天前才开始学习 LaTeX,所以请原谅我的无知。
我正在编写一份报告,我注意到一旦我添加了目录,页眉和页脚就会从页面上消失。您可以在下面看到页眉的样子:
页脚如下:
但是,标题在目录页上消失了。
我的.tex:
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[margin=3cm]{geometry}
\pagestyle{fancy}
\usepackage[document]{ragged2e}
\usepackage{titletoc}
\usepackage{tocloft}
\setlength\headheight{26pt}
\rhead{\includegraphics[scale=0.15]{images/x.pdf}}
\lhead{\includegraphics[width=4cm]{images/y.jpg}}
\addtocontents{toc}{\vspace{1cm}}
\addto\captionsenglish{
\renewcommand{\contentsname}
{\LARGE Table of Contents}
}
\begin{document}
\setlength{\headsep}{3.5cm}
\centering
{\huge\bfseries Something something something\par}
\vspace{2cm}
{\huge Internship Report \par}
\vspace{2cm}
\renewcommand\baselinestretch{1.5}\Large\bfseries
{
John Doe \linebreak
12345678
}
\par
\vspace{2cm}
\renewcommand\baselinestretch{1.5}\Large\normalfont
{
Advisors: \linebreak
Jane Doe \(|\) ISEC \linebreak
John Doe \(|\) GoodBarber
}
\par
\vspace{2cm}
\renewcommand\baselinestretch{1.5}\Large\normalfont
{
Bachelor in John Doing \linebreak
Jane Doe Branch \linebreak
Polytechnic Institute of John Doe \linebreak
Institute of John Doe \linebreak
June 2021
}
\newpage
\ % The empty page
\thispagestyle{empty}
\clearpage
\newpage
\setlength{\headsep}{1cm}
\setlength{\cftbeforetoctitleskip}{-3em}
\tableofcontents
\renewcommand{\footrulewidth}{0.4pt}
\end{document}
你能发现这个错误吗?
先感谢您。
答案1
您使用tocloft
将初始目录等页面的页面样式设置为可用页面样式之一的包\tocloftpagestyle{<style>}
。<style>
默认值为\tocloftpagestyle{plain}
做\renewcommand{\tocloftpagestyle}{<your page style>}