对于任何读到这篇文章的人来说:页脚被设置的边距推离了页面
\usepackage[margin=.7in]{geometry}
请参阅下面的评论。
最初的问题
正如标题所述,fancyhdr
包装中缺少页脚。
\documentclass{article}
% For testing
\usepackage{blindtext}
% General document formatting
\usepackage[margin=0.7in]{geometry}
\usepackage[parfill]{parskip}
% Colors
\usepackage[table]{xcolor}
\definecolor{mycolor}{RGB}{146,208,80}
\usepackage[most]{tcolorbox}
%Header
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{48pt}
\fancyhead[R]{
\begin{tcolorbox}[
colback=mycolor!100,
colframe=white,
arc=0pt,
outer arc=0pt,
]
\begin{flushright}
\textsc{
\textbf{
MyFancyHeader
}
}
\end{flushright}
\end{tcolorbox}
}
% Footer - Why is the page number not showing
\fancyfoot[C]{Page \thepage}
\begin{document}
% Title Page
\thispagestyle{empty}
\begin{tcolorbox}[
frame code={},
center title,
left=0pt,
right=0pt,
top=50pt,
bottom=0pt,
colback=mycolor!100,
colframe=white,
width=\dimexpr\textwidth\relax,
enlarge left by=0mm,
boxsep=5pt,
arc=0pt,outer arc=0pt,
]
\begin{flushright}
\textsc{\Huge \textbf{My Title}}
\end{flushright}
\end{tcolorbox}
\vspace*{1cm}
\Huge My Other Title \\
%
\large DEC \textit{Saarland} \verb|->| DED \textit{Sachsen} \normalsize\\
\today
% Page numbering should start here
\newpage
\pagestyle{fancy}
\pagenumbering{arabic}
\section{Foo}
\blindtext{1}
\end{document}
输出
到目前为止我已经看过这个问答,但无法解决问题:Fancyhdr 页眉和页脚消失