以下代码基于:精美的页眉和页脚
我想删除页眉中的章节编号,但将其保留在正文中。我试过但没有成功:
\titleformat{\chapter}[display]
{\normalfont\bfseries}{}{0pt}{\Large}
\documentclass{article}
\usepackage[a4paper, left=1.5cm, right=1.5cm, bindingoffset=1.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{etoolbox}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\bfseries}{}{0pt}{\Large}
\definecolor{gmitblue}{RGB}{93,138,168}
\usetikzlibrary{calc}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{%
\begin{tikzpicture}[overlay, remember picture]%
\fill[gmitblue] (current page.north west) rectangle ($(current page.north east)+(0,-1in)$);
\node[anchor=north west, text=white, font=\Large, minimum size=1in, inner xsep=5mm] at (current page.north west) {\leftmark};
%node[minimum width=\x2-\x1, minimum height=2cm, draw, rectangle, fill=blue!20, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {\Large\bfseries \quad #1};
\end{tikzpicture}
}
\fancyfoot[C]{
\begin{tikzpicture}[overlay, remember picture]%
\fill[gmitblue] (current page.south west) rectangle ($(current page.south east)+(0,.5in)$);
\node[anchor=south west, text=white, font=\Large, minimum size=.5in] at (current page.south west) {\thepage};
\node[anchor=south, text=white, font=\large, minimum size=.5in] at (current page.south) {};
\node[anchor=south east, text=white, font=\large, minimum size=.5in, inner xsep=5mm] at (current page.south east) {\today};
\end{tikzpicture}
}
\fancyfoot[CO]{
\begin{tikzpicture}[overlay, remember picture]%
\fill[gmitblue] (current page.south west) rectangle ($(current page.south east)+(0,.5in)$);
\node[anchor=south west, text=white, font=\large, minimum size=.5in, inner xsep=5mm] at (current page.south west) {\today};
\node[anchor=south, text=white, font=\large, minimum size=.5in] at (current page.south) {};
\node[anchor=south east, text=white, font=\Large, minimum size=.5in] at (current page.south east) {\thepage};
\end{tikzpicture}
}
\begin{document}
%\chapter{first chapter}
\section{Sectiona A}
\lipsum[1-9]
%\chapter{second chapter}
\newpage
\section{Section B}
\lipsum[10-19]
\end{document}