我正在报告类中编写文档(出于多种原因)。我想要除封面之外的所有页面的自定义页眉。我已经成功做到了,唯一的问题是我无法删除标题的章节名称。
到目前为止,这是我的方法:
\documentclass[12p]{report}
\usepackage{arabtex}
\usepackage[utf8]{inputenc}
\usepackage[T2A,LAE,T1]{fontenc}
\usepackage{utf8}
\setcode{utf8}
\usepackage{ae}
\usepackage{aecompl}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage{mdframed}
\usepackage{fancybox}
\usepackage{adjustbox}
\usepackage{enumitem}
\usepackage{bbding}
\usepackage{tikz}
\usepackage{setspace}
\usepackage{csquotes}
\usepackage{sectsty}
\usepackage{tikz, blindtext}
\usepackage{float}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage{listings}
\usepackage{lipsum}
\definecolor{myblue}{RGB}{100,127,255}
\usepackage{titlesec}
\fancypagestyle{plain}
{\chead{\includegraphics[width=\textwidth]{forestfloor.jpg} \\
\textcolor{myblue}{Whatever} \\ BLA BLA BLA}}
\pagestyle{plain}
\pagestyle{fancyplain}
\begin{document}
\chapter{One}
\lipsum[1-15]
\chapter{Two}
\lipsum[1-15]
\end{document}
答案1
由于您加载了titlesec
,它有一个titleps
配套包,可以通过选项加载,这使得它非常容易,在stackengine geometry fancyhdr titleps`pagestyles
的帮助下是不兼容的。package. As your header is quite high, I had to set some parameters of the
package to remove error messages. Note that
and
无关:自 3.10 版起,的语言选项babel
应与文档类一起加载,以便所有与语言相关的包都得到通知。此外,包ae
和aecompl
已过时,不再需要。
\documentclass[12pt, french]{report}
\usepackage{arabtex}
\usepackage[utf8]{inputenc}
\usepackage[T2A,LAE,T1]{fontenc}
\usepackage{utf8}
\setcode{utf8}
%\usepackage{ae}%% obsolete
%\usepackage{aecompl}%% obsolete
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{graphicx}
%\usepackage{fancyhdr}
\usepackage[headheight=125pt, top = 160pt]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage{mdframed}
\usepackage{fancybox}
\usepackage{adjustbox}
\usepackage{enumitem}
\usepackage{bbding}
\usepackage{tikz}
\usepackage{setspace}
\usepackage{csquotes}
\usepackage{sectsty}
\usepackage{tikz, blindtext}
\usepackage{float}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage{listings}
\usepackage{lipsum}
\usepackage[usestackEOL]{stackengine}
\definecolor{myblue}{RGB}{100,127,255}
\usepackage[pagestyles]{titlesec}
\renewpagestyle{plain}{%
\headrule
\sethead{}{\Longstack{\includegraphics[width=\textwidth]{forestfloor.jpg} \\
\textcolor{myblue}{Whatever} \\ BLA BLA BLA}}{}
\setfoot{}{\thepage}{}
}
\pagestyle{plain}
\begin{document}
\chapter{One}
\lipsum[1-15]
\chapter{Two}
\lipsum[1-15]
\end{document}