有沒有辦法在僅包含頁碼的頁面頂部製作水平線

有沒有辦法在僅包含頁碼的頁面頂部製作水平線

我嘗試寫一本以下風格的書: 有沒有辦法修改上部水平線,使其不包含“Sisältö”一詞或除頁碼之外的任何其他文本?

\documentclass[10pt]{book}

\usepackage[utf8]{inputenc}
\usepackage[finnish]{babel}

\usepackage{blindtext}

\usepackage[a5paper]{geometry}
%\usepackage[a5paper, top=2in, bottom=1.5in, left=1in, right=1in]{geometry}

\usepackage{scrextend}
\changefontsizes{10.0pt}  % Change base font size

\usepackage{lettrine}
\usepackage{fancyhdr}

\fancyhead[LE,RO]{\thepage}
\fancyfoot{}
\fancyhead[RO,LE]{\thepage}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}

\cfoot{} % get rid of the page number 

\linespread{1.3}
\vbadness=20000
\pagestyle{fancy}
\begin{document}
\tableofcontents
\newpage
\section*{Chapter one}
\addcontentsline{toc}{section}{beginning}
First lines.

\newpage

\section*{Chapter two}
\addcontentsline{toc}{section}{somewhere}
Some text.

\newpage

\section*{Chapter two}
\addcontentsline{toc}{section}{end}
The end.
\end{document}

答案1

如果您只想在頁首中包含規則和頁碼,而在頁腳中不包含任何內容,請執行下列操作

\pagestyle{fancy}
\fancyhf{} % clear all fields
\fancyhead[RO,LE]{\thepage}

就這樣。不要設定任何與 相關的其他內容fancyhdr

相關內容