
我的頁腳位於頁邊距之外。無論我的頁面幾何形狀如何,它都應該在內部。
\documentclass[11pt,a4paper]{report}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\rhead{}
\lfoot{My Name}
\cfoot{\thepage}
\rfoot{University}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
test
\end{document}
答案1
當您設定 時bottom=1cm
,geometry
將進行設定以使文字區塊中的最後一行距頁面邊界 1 厘米,當然,這會將頁腳向下推。
該includefoot
選項會告訴你geometry
您頁尾基線必須距頁面邊界 1 公分。
\documentclass[11pt,a4paper]{report}
\usepackage[
left=1cm,
right=1cm,
top=1cm,
bottom=1cm,
includefoot,
heightrounded,
]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all fields
\fancyfoot[L]{My Name}
\fancyfoot[C}{\thepage}
\fancyfoot[R]{University}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
test
\end{document}
我還補充說heightrounded
,這將確保(可能稍微改變文字區塊高度)頁面上的行數是整數。我還將“舊”語法更改為fancyhdr
“現代”語法。
為了產生下面的圖像,我添加了showframe
選項geometry
,只是為了更好地顯示各個部分。附加行不會出現在您的文件中。