LaTeX 复杂的页眉和页脚

LaTeX 复杂的页眉和页脚

我最近遇到了这个文档,我正在尝试重新创建它,这就是我正在处理的内容:


第一页


第二页等等


我不知道从哪里开始尝试复制这样的页眉和页脚,我是 LaTeX 课程的新手,所以我真的不知道从哪里开始。

Youtube 对这个主题的介绍很简单,而 Overleaf 的学习部分也对我帮助不大。

我确实想创建一个.cls 文件以便使其适应其他相关文档......

如果有人能给我指明方向那就太好了,或者如果你已经有一些经验并且可以轻松地自己重新创造它,那就太棒了!

提前致谢!

答案1

在此处输入图片描述

\documentclass{article}

\usepackage{fancyhdr,graphicx,lastpage,geometry,array}
\usepackage{lipsum}

\geometry{
  margin = 1.5in,
  headheight = 45pt % Adjust this with a change in your image size
}

\fancypagestyle{firstpagestyle}{%
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% Remove header rule
  \fancyfoot[C]{% Center footer
    \small
    \begin{tabular}{@{} c @{}}
      \rule[0.5em]{0.35\textwidth}{.4pt}
      \includegraphics[height=1em]{example-image}
      \rule[0.5em]{0.35\textwidth}{.4pt} \\
      \bfseries Page \thepage~of \pageref{LastPage} \\
      Some address in Randomville \\
      who.cares.com $|$ 123-456-7890 $|$ [email protected]
    \end{tabular}
  }
}

\fancypagestyle{defaultpagestyle}{%
  \pagestyle{firstpagestyle}% Duplicate firstpagestyle, but update the header
  \fancyhead[C]{% Center header
    \rule[2em]{0.3\textwidth}{.4pt}
    \includegraphics[height=4em]{example-image}
    \rule[2em]{0.3\textwidth}{.4pt}
  }
}

% Set page style to defaultpagestyle
\pagestyle{defaultpagestyle}

\begin{document}

% Change this page to have a different page style
\thispagestyle{firstpagestyle}

\vspace*{-5\baselineskip}% Move up on the page

% Set first page "header"/title
\noindent
\begin{tabular}{@{} w{c}{\textwidth} @{}}
  \includegraphics[height=4em]{example-image} \\
  \scshape Some Foreign Place \\
  \scshape With Interesting Stuff That Is Useful \\
  \scshape And Has Knowledge To Share \\
  \hline
\end{tabular}

\begin{center}
  \bfseries\large 
  An interesting article title that is bold and impressive \\
  maybe with reference to funding partners and colleagues \\
  and other valuable contributors
\end{center}

\section{A section}
\lipsum[1-50]

\end{document}

相关内容