
heading
我的論文使用頁面樣式。作為要求,頁碼必須始終位於右上角全部頁。
我的論文最後有索引。索引第一頁的頁碼位於底部中心。但索引的其他頁面位於右上角。我無法使該頁面(索引的第一頁)與其他頁面相似。這是一個 MWE。
\documentclass[12pt]{ucbthesis}
\usepackage{lipsum}
\usepackage{imakeidx}
\makeindex[program=makeindex,columns=1,intoc=true]
\begin{document}
\pagestyle{headings}
\chapter{Introduction}
\index{One}
\lipsum
\chapter{Conclusion}
\index{Two}
\lipsum
\printindex
\newpage
This page has the correct page number on the top right.
\end{document}
我假設索引的第一頁使用該plain
樣式。因此,為了解決這個問題,我嘗試透過以下方式修改plain
樣式fancyhdr
:
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
\fancyhf{}
\rhead{\thepage}
\renewcommand{\headrulewidth}{0pt}
}
首先,我不確定改變簡單的風格是個好主意。有更好的解決方案嗎?可以
makeindx
不打電話直接訂製套餐嗎fancyhdr
?其次,
fancyhdr
上面將索引頁頁碼的位置從底部中心更改為右上角,但頁碼太靠右,超出了文字邊距。如何將索引頁的頁碼設為恰恰與其他頁面位於相同位置?
編輯:顯然,設定會\rhead{\thepage \hspace{2cm}}
在所需位置產生頁碼。