答案1
这是一个基于这里fancyhdr
。可以找到该软件包的手册这里。
% Based on https://overleaf.com/learn/latex/Headers_and_footers
\documentclass{book}
\usepackage{blindtext}
\usepackage{fancyhdr} % <-- Important package!
\pagestyle{fancy}
\fancyhf{} % Clear all header and footer fields and then re-define the field, see below.
\fancyhead[LE,RO]{Overleaf}
\fancyhead[RE,LO]{Guides and tutorials}
\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
% E for even page
% O for odd page
% L for left side
% C for centered
% R for right side
\renewcommand{\headrulewidth}{10pt} % <-- Width of head line
\renewcommand{\footrulewidth}{0.1pt} % <-- Width of foot line
\begin{document}
\blinddocument[2]
\end{document}