使用 OverLeaf
我想在页眉的右上角添加一个徽标。距离右边缘 1 厘米。在页脚中距离左边缘 1 厘米处添加一段文本。我尝试使用 rhead。但我对 LaTex 还很陌生,这对新手来说太花哨了。右侧的蓝色边框必须保留。
\documentclass[a4paper]{letter}
\usepackage{xcolor}
\definecolor{maxlink}{RGB}{2,60,180}
\usepackage{tikz} % you know what this does!
\usetikzlibrary{calc}
\usepackage{fancyhdr} % put things headers and footers and we plan misuse it ;)
\usepackage{lipsum}
%\usepackage[margin=2.5cm,headheight=26pt,includeheadfoot]{geometry}
%\setlength\headheight{26pt} %% just to make warning go away. Adjust the value after looking into the warning.
%\rhead{{\color{blue}\rule{1cm}{1cm}}}
%\rhead{\includegraphics[width=1cm]{Max-Logo.png}}
%\rhead{\begin{picture}(3,3)
%\put(3,3){\includegraphics[width=1cm]{example-image-a}}
%\end{picture}}
\fancypagestyle{mypage}{%
\fancyhf{}
\fancyhead[LO]{%
\begin{tikzpicture}[overlay,remember picture]
\fill [color=maxlink] (current page.north west) rectangle
($ (current page.south west) + (0.4cm,0cm) $);
\end{tikzpicture}
}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\begin{document}
\pagestyle{mypage} % activate colored margins
\pagenumbering{gobble}
\mbox{}
\clearpage
%\pagestyle{mypage} % activate colored margins
\pagenumbering{gobble}
\mbox{}
\end{document}
我不需要使用 tikz 和 fancy head 来制作边框,我刚刚在 如何为某些页面设置彩色边距