【发布时间】:2025-12-30 18:55:17
【问题描述】:
我正在尝试在 LaTex 中创建一个机构页面,该页面必须具有我的机构提供的页眉和页脚,并且无法更改,所以我试图用我的下一个代码强制它们借用这里https://tex.stackexchange.com/questions/297240/adding-an-image-to-a-header-in-latex
\documentclass[12pt,letterpaper]{article}
\usepackage{fancyhdr}
\usepackage[left=4cm,top=4cm,right=3cm,bottom=3cm,headheight=3.8cm]{geometry}
\pagestyle{fancy}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{tikzpagenodes}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[R]{\begin{tikzpicture}[remember picture,overlay]
\draw let \p1=($(current page footer area.north)-(current page.south)$),
\n1={veclen(\x1,\y1)} in
node [inner sep=0,outer sep=0,below right]
at (current page.south west){\includegraphics[width=\paperwidth,height=\n1]{exampleH}};
\end{tikzpicture}}
\fancyhead[L]{\begin{tikzpicture}[remember picture,overlay]
\draw let \p1=($(current page.north)-(current page header area.south)$),
\n1={veclen(\x1,\y1)} in
node [inner sep=0,outer sep=0,below right]
at (current page.north west){\includegraphics[width=\paperwidth,height=\n1]{ExampleF}};
\end{tikzpicture}}
\begin{document}
\section{First section}
Type your document as usual!
\newpage
\section{Second section}
Type your document as usual!
\end{document}
【问题讨论】: