我在文档中使用\sectionmark
。如何隐藏正文中的部分文本并仅显示\sectionmark
页眉中的文本。如附图中所示,重复出现。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[paper=executivepaper,margin=0.75in,top=1in]{geometry}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{calc}
\usetikzlibrary{calc}
\definecolor{MyBlue2}{RGB}{30,63,111}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection. #1}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[C]{%
\begin{tikzpicture}[overlay, remember picture]%
\fill[MyBlue2] (current page.north west) rectangle ($(current page.north east)+(0,-0.75in)$);
\node[anchor=north west, text=white, font=\LARGE, minimum size=0.75in, inner xsep=0.75in] at (current page.north west) {\rightmark};
\end{tikzpicture}
}
\fancyfoot[C]{
\begin{tikzpicture}[overlay, remember picture]%
\fill[MyBlue2] (current page.south west) rectangle ($(current page.south east)+(0,.75in)$);
\node[anchor=south west, text=white, font=\Large, minimum size=.75in, inner xsep=0.75in] at (current page.south west) {\includegraphics[scale=0.7]{footer.PNG}};
\node[anchor=south east, text=white, font=\large, minimum size=.65in, inner xsep=0.75in] at (current page.south east) {\textbf{Page:} \thepage};
\end{tikzpicture}
}
\begin{document}
\section{Executive Summary}
\lipsum
\subsection{ABC}
\section{ABC}
\end{document}