| 1 |
% \iffalse^^A meta-comment |
| 2 |
% ====================================================================== |
| 3 |
% scrlayer-fancyhdr.dtx |
| 4 |
% Copyright (c) Markus Kohm, 2021–2025 |
| 5 |
% |
| 6 |
% This file is part of the LaTeX2e package `scrlayer-fancyhdr'. |
| 7 |
% |
| 8 |
% This work may be distributed and/or modified under the conditions of |
| 9 |
% the LaTeX Project Public License, version 1.3c of the license. |
| 10 |
% The latest version of this license is in |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 13 |
% version 2005/12/01 and of this work. |
| 14 |
% |
| 15 |
% This work has the LPPL maintenance status "author-maintained". |
| 16 |
% |
| 17 |
% The Current Maintainer and author of this work is Markus Kohm. |
| 18 |
% |
| 19 |
% This work consists of the files `scrlayer-fancyhdr.dtx' and |
| 20 |
% `README.md'. |
| 21 |
% ====================================================================== |
| 22 |
% |
| 23 |
%<identify>%%% docstrip run: identify |
| 24 |
%<init>%%% docstrip run: init |
| 25 |
%<options>%%% docstrip run: options |
| 26 |
%<body>%%% docstrip run: body |
| 27 |
%\changes{v0.3}{2025-01-07}{needs at least \LaTeX{} 2020-10-01} |
| 28 |
%<identify>\NeedsTeXFormat{LaTeX2e}[2020/10/01] |
| 29 |
%<*dtx> |
| 30 |
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi |
| 31 |
\ProvidesFile{scrlayer-fancyhdr.dtx} |
| 32 |
%</dtx> |
| 33 |
%<package&identify>\ProvidesPackage{scrlayer-fancyhdr} |
| 34 |
%<*dtx|(package&identify)> |
| 35 |
[2025-02-10 v0.4 |
| 36 |
%</dtx|(package&identify)> |
| 37 |
%<*dtx> |
| 38 |
source of package scrlayer-scrpage] |
| 39 |
%</dtx> |
| 40 |
%<*package> |
| 41 |
%<identify> combining fancyhdr with KOMA-Script's scrlayer] |
| 42 |
%</package> |
| 43 |
%<*dtx> |
| 44 |
\ifx\documentclass\undefined |
| 45 |
\input docstrip.tex |
| 46 |
\generate{% |
| 47 |
\file{scrlayer-fancyhdr.sty}{% |
| 48 |
\from{scrlayer-fancyhdr.dtx}{package,identify}% |
| 49 |
\from{scrlayer-fancyhdr.dtx}{package,init}% |
| 50 |
\from{scrlayer-fancyhdr.dtx}{package,options}% |
| 51 |
\from{scrlayer-fancyhdr.dtx}{package,body}% |
| 52 |
}% |
| 53 |
} |
| 54 |
\else |
| 55 |
\let\endbatchfile\relax |
| 56 |
\fi |
| 57 |
\endbatchfile |
| 58 |
\documentclass{koma-script-source-doc}% KOMA-Script related packages use this. |
| 59 |
\usepackage[main=english,ngerman]{babel} |
| 60 |
\usepackage{csquotes} |
| 61 |
\usepackage{biblatex} |
| 62 |
\usepackage{listings} |
| 63 |
\usepackage{scrhack} |
| 64 |
|
| 65 |
\begin{filecontents}[force]{\jobname.bib} |
| 66 |
@Misc{ package:fancyhdr, |
| 67 |
language= {english}, |
| 68 |
author = {Piet van Oostrum}, |
| 69 |
title = {{\pkg{fancyhdr}}\,---\,Extensive control of page headers and |
| 70 |
footers in {\LaTeXe}}, |
| 71 |
date = {2025-02-07}, |
| 72 |
edition = {5.2}, |
| 73 |
url = {https://www.ctan.org/pkg/fancyhdr}, |
| 74 |
urldate = {2025-02-10} |
| 75 |
} |
| 76 |
|
| 77 |
@Misc{ package:koma-script, |
| 78 |
language= {english}, |
| 79 |
author = {Markus Kohm}, |
| 80 |
title = {{\pkg{koma-script}}\,---\,A bundle of versatile classes and |
| 81 |
packages}, |
| 82 |
date = {2024-10-24}, |
| 83 |
edition = {3.43}, |
| 84 |
url = {https://www.ctan.org/pkg/koma-script}, |
| 85 |
urldate = {2025-01-07} |
| 86 |
} |
| 87 |
|
| 88 |
@Misc{ package:scrlayer, |
| 89 |
language= {english}, |
| 90 |
author = {Markus Kohm}, |
| 91 |
title = {{\pkg{scrlayer}}\,---\,Manage text `layers' within |
| 92 |
{\KOMAScript}}, |
| 93 |
date = {2024-10-24}, |
| 94 |
edition = {3.43}, |
| 95 |
url = {https://www.ctan.org/pkg/scrlayer}, |
| 96 |
urldate = {2025-01-07} |
| 97 |
} |
| 98 |
\end{filecontents} |
| 99 |
|
| 100 |
\addbibresource{\jobname.bib} |
| 101 |
|
| 102 |
\CodelineIndex |
| 103 |
\RecordChanges |
| 104 |
\GetFileInfo{scrlayer-fancyhdr.dtx} |
| 105 |
\title{The \texttt{scrlayer} interface \texttt{scrlayer-fancyhdr}% |
| 106 |
\footnote{\parbox[t]{.9\linewidth}{\raggedright |
| 107 |
This is version \fileversion\ of file \texttt{\filename}.\\ |
| 108 |
Dies ist Version \fileversion\ der Datei \texttt{\filename}.}}\\ |
| 109 |
\otherlanguage{ngerman}{Das \texttt{scrlayer}-Interface |
| 110 |
\texttt{scrlayer-fancyhdr}\footnotemark[1]}} |
| 111 |
\date{\filedate} |
| 112 |
\author{Markus Kohm} |
| 113 |
|
| 114 |
\NewDocElement[% |
| 115 |
macrolike = false, |
| 116 |
toplevel = true, |
| 117 |
idxtype = \textit{internal}, |
| 118 |
idxgroup = Page styles (internal), |
| 119 |
printtype = \textit{internal} |
| 120 |
]{iPageStyle}{ipgstyle} |
| 121 |
|
| 122 |
|
| 123 |
\renewcaptionname{english}{\partname}{Part} |
| 124 |
\renewcaptionname{english}{\contentsname}{Contents\,/\,Inhalt}% |
| 125 |
\renewcaptionname{english}{\refname}{References\,/\,Literatur}% |
| 126 |
\renewcaptionname{ngerman}{\partname}{Teil} |
| 127 |
\renewcaptionname{ngerman}{\contentsname}{Inhalt\,/\,Contents} |
| 128 |
\renewcaptionname{ngerman}{\refname}{Literatur\,/\,References}% |
| 129 |
|
| 130 |
\begin{document} |
| 131 |
\maketitle |
| 132 |
\tableofcontents |
| 133 |
\DocInput{\filename} |
| 134 |
\printbibliography |
| 135 |
\PrintChanges |
| 136 |
\PrintIndex |
| 137 |
\end{document} |
| 138 |
% \fi^^A meta-comment |
| 139 |
% |
| 140 |
% \changes{v0.0}{2018/09/01}{start of interface} |
| 141 |
% \changes{v0.0}{2018/09/05}{some user documentation} |
| 142 |
% \changes{v0.2}{2021/02/18}{package is no longer part of \KOMAScript} |
| 143 |
% \changes{v0.2.1}{2021/03/30}{improved user manual} |
| 144 |
% \changes{v0.2.1}{2021/03/30}{German user manual} |
| 145 |
% \changes{v0.2.2}{2022/07/08}{using class \cls*{koma-script-source-doc}} |
| 146 |
% |
| 147 |
% \part{English User Manual} |
| 148 |
% \section{The Purpose of this Package} |
| 149 |
% \label{sec:purpose} |
| 150 |
% This package has been made to give users a chance to combine the features of |
| 151 |
% Piet van Oostrum's \pkg{fancyhdr} \autocite{package:fancyhdr} with the |
| 152 |
% features of \pkg{scrlayer} \autocite{package:scrlayer}. In other words: It |
| 153 |
% has been made to combine the page layers of \pkg{scrlayer} with the page |
| 154 |
% styles of \pkg{fancyhdr}. |
| 155 |
% |
| 156 |
% In this combination compatibility with \pkg{fancyhdr} is the |
| 157 |
% first aim! Usability and the freedom provided by \pkg{scrlayer} |
| 158 |
% is only the second one. Compatibility with other packages or classes of |
| 159 |
% \KOMAScript{} \cite{package:koma-script} is not a primary aim. Perhaps it |
| 160 |
% will become an optional feature in future. Abolishing any real or virtual |
| 161 |
% limitations of \pkg{fancyhdr} other than make it possible to use |
| 162 |
% layers is not an aim and will not be an aim in future. |
| 163 |
% |
| 164 |
% If you need a better combination of page styles and layers, you should |
| 165 |
% either use the low level interface of \pkg{scrlayer} to define |
| 166 |
% your page styles or\,---\,and this is the recommendation of the |
| 167 |
% author\,---\,use \pkg{scrlayer-scrpage} instead of |
| 168 |
% \pkg*{scrlayer-fancyhdr} or \pkg{fancyhdr}. If you need more |
| 169 |
% compatibility with other parts of \KOMAScript, i.\,e.\@ with the |
| 170 |
% \KOMAScript{} classes, you should use \pkg{scrlayer-scrpage} instead of |
| 171 |
% \pkg*{scrlayer-fancyhdr} or \pkg{fancyhdr}. |
| 172 |
% |
| 173 |
% |
| 174 |
% \section{How it works} |
| 175 |
% \label{sec:howitworks} |
| 176 |
% |
| 177 |
% To combine \pkg{fancyhdr} and \pkg{scrlayer}, |
| 178 |
% \pkg{scrlayer-scrpage} loads both packages. After loading |
| 179 |
% \pkg{fancyhdr} it redefines page style \pstyle{@fancy} (up to |
| 180 |
% \pkg{fancyhdr} version 3.10) resp. \pstyle{f@nch@fancycore} |
| 181 |
% (from \pkg{fancyhdr} version 4) to make it a layer page style of |
| 182 |
% \pkg{scrlayer} using the newly defined layers |
| 183 |
% \texttt{fancy.head.even}, \texttt{fancy.head.odd}, \texttt{fancy.foot.even} |
| 184 |
% and \texttt{fancy.foot.odd}. The \texttt{\dots head\dots} layers are |
| 185 |
% background layers like the page head of \pkg{fancyhdr}'s page |
| 186 |
% styles (or other usual page styles). The \texttt{\dots foot\dots} layers are |
| 187 |
% foreground layers like the page footer of \pkg{fancyhdr}'s page |
| 188 |
% styles (or other usual page styles). The \texttt{\dots even} layers are |
| 189 |
% restricted to even pages, that means left side pages in two-sided |
| 190 |
% documents. The \texttt{\dots odd} layers are restricted to odd pages, that |
| 191 |
% means right side pages in two-sided documents or all pages in single-sided |
| 192 |
% documents. |
| 193 |
% |
| 194 |
% \DescribeiPageStyle{@fancy} |
| 195 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 196 |
% \DescribePageStyle{fancyplain} |
| 197 |
% \DescribeiPageStyle{plain@fancy} |
| 198 |
% Up to \pkg{fancyhdr} version 3.10 page style \pstyle{@fancy} |
| 199 |
% was an internal page style, users should not select direclty. From version 4 |
| 200 |
% page style \pstyle{f@nch@fancycore} is used internally by package |
| 201 |
% \pkg{fancyhdr}. In both cases, the internal page style is used |
| 202 |
% for the user page style \pstyle{fancy}. The user page style |
| 203 |
% \pstyle{fancy} is also used for \pkg{fancyheadings}'s deprecated page |
| 204 |
% style \pstyle{fancyplain}, that also redefines page style |
| 205 |
% \pstyle{plain} to be \pkg{fancyhdr}'s internal page style |
| 206 |
% \pstyle{plain@fancy}, that also uses \pstyle{fancy} but with |
| 207 |
% \cs{if@fancyplain} set to \cs{iftrue}. There is an additional |
| 208 |
% deprecated command \cs{fancyplain}\marg{plain code}\marg{fancy |
| 209 |
% code}, too. The command uses the \meta{plain code} if \cs{if@fancyplain} |
| 210 |
% is \cs{iftrue} and \meta{fancy code} if \cs{if@fancyplain} is |
| 211 |
% \cs{iffalse}. It can be used inside the definition of the page style |
| 212 |
% elements to distinguish settings of \pstyle{fancy} and \pstyle{plain} |
| 213 |
% pages. |
| 214 |
% |
| 215 |
% Page styles defined using \pkg{fancyhdr}'s command |
| 216 |
% \cs{fancypagestyle} also always use page style \pstyle{fancy} and so |
| 217 |
% the internal basic page style \pstyle{@fancy} (up to |
| 218 |
% \pkg{fancyhdr} version 3.10) resp. \pstyle{f@nch@fancycore} |
| 219 |
% (from \pkg{fancyhdr} version 4). |
| 220 |
% |
| 221 |
% As a result of the two notes above, every page style of |
| 222 |
% \pkg{fancyhdr} always uses the same internal basic page style |
| 223 |
% \pstyle{@fancy} (up to \pkg{fancyhdr} version 3.10) |
| 224 |
% resp. \pstyle{f@nch@fancycore} (from \pkg{fancyhdr} version |
| 225 |
% 4). As a result of redefining page style \pstyle{@fancy} (up to |
| 226 |
% \pkg{fancyhdr} version 3.10) resp. \pstyle{f@nch@fancycore} |
| 227 |
% (from \pkg{fancyhdr} version 4) to be a layer page style, users |
| 228 |
% can add layers to or remove layers from all \pkg{fancyhdr} page |
| 229 |
% styles by adding layers to or remove layers from page style |
| 230 |
% \pstyle{@fancy} (up to \pkg{fancyhdr} version 3.10) |
| 231 |
% resp. \pstyle{f@nch@fancycore} (from \pkg{fancyhdr} version |
| 232 |
% 4). You cannot add layers to or remove layers from |
| 233 |
% \pkg{fancyhdr}'s single page styles \pstyle{fancy}, |
| 234 |
% \pstyle{fancyplain}, \pstyle{plain@fancy} or the page styles defined |
| 235 |
% using \cs{fancypagestyle} directly. So using layers is a all or nothing |
| 236 |
% feature with \pkg{scrlayer-scrpage}. However, you can use the second |
| 237 |
% argument of \cs{fancypagestyle} to add or remove layers whenever one of |
| 238 |
% the \pkg{fancyhdr} page styles is activated. So this is a move |
| 239 |
% from the \pkg{scrlayer} interface of adding or removing layers to |
| 240 |
% single page styles to the \pkg{fancyhdr} interface of defining |
| 241 |
% modifications of page style \pstyle{fancy}. |
| 242 |
% |
| 243 |
% Another such movement from a \pkg{scrlayer} user interface to a |
| 244 |
% \pkg{fancyhdr} user interface is the decision whether or not |
| 245 |
% automatic running heads are used. \pkg{scrlayer} provides the |
| 246 |
% options \opt{automark} and \opt{manualmark} and commands |
| 247 |
% \cs{automark} and \cs{manualmark} to do this decision and also to |
| 248 |
% configure commands like \cs{partmark}, \cs{chaptermark}, |
| 249 |
% \cs{sectionmark} etc. With \pkg*{scrlayer-fancyhdr} already using page |
| 250 |
% style \pstyle{@fancy} (up to \pkg{fancyhdr} version 3.10) |
| 251 |
% resp. \pstyle{f@nch@fancycore} (from \pkg{fancyhdr} version 4) |
| 252 |
% does switch to automatic running heads. The first activation of page style |
| 253 |
% \pstyle{fancy} still redefines \cs{chaptermark} and |
| 254 |
% \cs{sectionmark}, if a class with \cs{chapter} is used, or |
| 255 |
% \cs{sectionmark} and \cs{subsectionmark}, if a class without |
| 256 |
% \cs{chapter} is used. However, you still can use \cs{manualmark} and |
| 257 |
% \cs{automark} after switching to a \pkg{fancyhdr} page style |
| 258 |
% to configure the running heads. So this movement is only partial. |
| 259 |
% |
| 260 |
% \DescribePageStyle{headings} |
| 261 |
% \DescribePageStyle{myheadings} |
| 262 |
% \DescribePageStyle{plain} |
| 263 |
% Note: Currently, neither \pkg{scrlayer} nor |
| 264 |
% \pkg{fancyhdr} nor \pkg*{scrlayer-fancyhdr} do redefine page |
| 265 |
% styles \pstyle{headings} or \pstyle{myheadings} by default. And |
| 266 |
% neither \pkg{scrlayer} nor \pkg{fancyhdr} nor |
| 267 |
% \pkg*{scrlayer-fancyhdr} do redefine page style \pstyle{plain} unless |
| 268 |
% you are activating the deprecated \pkg{fancyhdr} page style |
| 269 |
% \pstyle{fancyplain}. So if you like to use layers on \pstyle{plain} |
| 270 |
% pages, i.\,e. usually the first page of a chapter or part or the page with a |
| 271 |
% title head, you have to either use \pkg{fancyhdr}'s deprecated |
| 272 |
% page style \pstyle{fancyplain} or redefine page style \pstyle{plain} |
| 273 |
% either using \cs{fancypagestyle} as documented in the |
| 274 |
% \pkg{fancyhdr} manual or using \cs{DeclarePageStyleByLayers}, |
| 275 |
% documented in the \KOMAScript{} manual. |
| 276 |
% \DescribeOption{myheading}% |
| 277 |
% \DescribeOption{heading}% |
| 278 |
% However from version 4.0 \pkg{fancyhdr} provides options |
| 279 |
% \opt{myheadings} and \opt{headings} to redefine the corresponding page |
| 280 |
% style. \pkg*{scrlayer-fancyhdr} also provides these options and passes |
| 281 |
% them to \pkg{fancyhdr}. |
| 282 |
% |
| 283 |
% \DescribePageStyle{empty} |
| 284 |
% \DescribeiPageStyle{@empty} |
| 285 |
% Note: Pagestyle \pstyle{empty} is somehow |
| 286 |
% special. \pkg{scrlayer} redefines it to be a layer page |
| 287 |
% style. And \pkg{fancyhdr}'s internal page style |
| 288 |
% \pstyle{@empty} is the same like \pstyle{empty}. So \pstyle{@empty} |
| 289 |
% also uses the layers of \pstyle{empty} but you should not try to modify |
| 290 |
% it directly using the interface of \pkg{scrlayer}. Moreover, if |
| 291 |
% \pkg{fancyhdr} is loaded before \pkg*{scrlayer-fancyhdr}, |
| 292 |
% \pkg{fancyhdr}'s internal page style \pstyle{@empty} is not a |
| 293 |
% copy of \pkg{scrlayer}'s layer page style \pstyle{empty} but |
| 294 |
% the original standard page style \pstyle{empty}. However, with |
| 295 |
% \pkg*{scrlayer-fancyhdr} package \pkg{fancyhdr} does not |
| 296 |
% longer use the internal page style \pstyle{@empty}. So you would not need |
| 297 |
% to know this. |
| 298 |
% |
| 299 |
% \section{How to use the Package} |
| 300 |
% \label{sec:howtouse} |
| 301 |
% |
| 302 |
% To use the package you have to load it, e.\,g., using: |
| 303 |
%\begin{verbatim} |
| 304 |
% \usepackage{scrlayer-fancyhdr} |
| 305 |
%\end{verbatim} |
| 306 |
% instead of loading \pkg{scrlayer} and \pkg{fancyhdr} |
| 307 |
% or before or after loading one of these packages. However it is recommended |
| 308 |
% to replace loading \pkg{scrlayer} and \pkg{fancyhdr} |
| 309 |
% by loading \pkg*{scrlayer-fancyhdr} because this avoids option |
| 310 |
% clashes. \pkg*{scrlayer-fancyhdr} provides all options of |
| 311 |
% \pkg{scrlayer} and \pkg{fancyhdr} and passes them to |
| 312 |
% \pkg{scrlayer} resp. \pkg{fancyhdr}. Nevertheless |
| 313 |
% sometimes it may be useful to be able to additionally load |
| 314 |
% \pkg{scrlayer} or \pkg{fancyhdr}. In this case you |
| 315 |
% should first load \pkg{scrlayer} next \pkg{fancyhdr} |
| 316 |
% and last \pkg*{scrlayer-fancyhdr}. |
| 317 |
% |
| 318 |
% \DescribeiPageStyle{@fancy} |
| 319 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 320 |
% \DescribePageStyle{fancy} |
| 321 |
% \DescribePageStyle{fancyplain} |
| 322 |
% \DescribeiPageStyle{plain@fancy} |
| 323 |
% \DescribeCommand\fancypagestyle |
| 324 |
% After loading the package you should be able to use the page styles and |
| 325 |
% commands of \pkg{fancyhdr} and to add layers to or remove layers |
| 326 |
% from the \pkg{fancyhdr}'s internal basic page style |
| 327 |
% \pstyle{@fancy} (up to \pkg{fancyhdr} version 3.10) |
| 328 |
% resp. \pstyle{f@nch@fancycore} (from \pkg{fancyhdr} version |
| 329 |
% 4). Note, you are not able to add layers to or remove layers from |
| 330 |
% \pkg{fancyhdr}'s page styles \pstyle{fancy}, |
| 331 |
% \pstyle{fancyplain}, \pstyle{plain@fancy} or page styles defined by |
| 332 |
% \cs{fancypagestyle}. However adding layers to or removing layers from |
| 333 |
% \pstyle{@fancy} (up to \pkg{fancyhdr} version 3.10) |
| 334 |
% resp. \pstyle{f@nch@fancycore} (from \pkg{fancyhdr} version 4) |
| 335 |
% will always change all these page styles! |
| 336 |
% |
| 337 |
% \DescribePageStyle{plain} |
| 338 |
% \DescribePageStyle{headings} |
| 339 |
% \DescribePageStyle{myheadings} |
| 340 |
% \DescribePageStyle{empty} |
| 341 |
% Note: Loading \pkg*{scrlayer-fancyhdr} will not make page style |
| 342 |
% \pstyle{plain} nor \pstyle{headings} nor \pstyle{myheadings} or any |
| 343 |
% other page style but \pstyle{empty} to automatically be a layer page |
| 344 |
% style! But if you are using option \opt{headings} or \opt{myheadings}, |
| 345 |
% package \pkg{fancyhdr} redefines the corresponding page styles to |
| 346 |
% be \pkg{fancyhdr} page styles\,---\,and so relate to the same |
| 347 |
% internal layer page style, either \pstyle{@fancy} (up to |
| 348 |
% \pkg{fancyhdr} version 3.10) or \pstyle{@f@nch@fancycore} |
| 349 |
% (from \pkg{fancydr} version 4.0). |
| 350 |
% |
| 351 |
% |
| 352 |
% \section{Hint} |
| 353 |
% \label{sec:hint} |
| 354 |
% |
| 355 |
% To become independent from the used version of \pkg{fancyhdr} you |
| 356 |
% can use: |
| 357 |
% \begin{verbatim} |
| 358 |
% \IfPackageAtLeastTF{fancyhdr}{2019/03/21}{% |
| 359 |
% \DeclarePageStyleAlias{@fancy}{f@nch@fancycore}% |
| 360 |
% }{% |
| 361 |
% \DeclarePageStyleAlias{f@nch@fancycore}{@fancy}% |
| 362 |
% } |
| 363 |
% \end{verbatim}^^A |
| 364 |
% \unskip after loading \pkg*{scrlayer-fancyhdr} and before adding a layer |
| 365 |
% to the internal layer page style. This code defines page style |
| 366 |
% \pstyle{@fancy} to be an alias of \pstyle{f@nch@fancycore} if |
| 367 |
% \pkg{fancyhdr} from version 4.0 is used or vise versa |
| 368 |
% \pstyle{f@nch@fancycore} as an alias of \pstyle{@fancy} if |
| 369 |
% \pkg{fancyhdr} before version 4.0 is used. So after this code |
| 370 |
% using either |
| 371 |
% \begin{verbatim} |
| 372 |
% \AddLayersToPageStyle{@fancy}{...} |
| 373 |
% \end{verbatim}^^A |
| 374 |
% \unskip or |
| 375 |
% \begin{verbatim} |
| 376 |
% \AddLayersToPageStyle{f@nch@fancycore}{...} |
| 377 |
% \end{verbatim}^^A |
| 378 |
% \unskip would both result in adding the layers to the internal layer page |
| 379 |
% style. |
| 380 |
% |
| 381 |
% |
| 382 |
% \section{Known Issues} |
| 383 |
% \label{sec:issues} |
| 384 |
% |
| 385 |
% Please note, the follow issues are either notes to the package author or |
| 386 |
% notes to the user to avoid them reporting the same issues again and |
| 387 |
% again. Listing these issues does not say they are bugs or features. |
| 388 |
% \begin{itemize} |
| 389 |
% \item |
| 390 |
% \DescribePageStyle{fancy} |
| 391 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 392 |
% \DescribePageStyle{fancyplain} |
| 393 |
% \DescribeCommand\fancypagestyle |
| 394 |
% \DescribeiPageStyle{@fancy} |
| 395 |
% You are not able to add layers to the user level page style |
| 396 |
% \pstyle{fancy} or \pstyle{fancyplain} or any page style defined by |
| 397 |
% \cs{fancypagestyle} but only to the internal page style |
| 398 |
% \pstyle{@fancy} (if you are using \pkg{fancyhdr} up to |
| 399 |
% version 3.10) resp. \pstyle{f@nch@fancycore} (if you are using |
| 400 |
% \pkg{fancyhdr} from version 4). This is intended as explained |
| 401 |
% in this manual (see also section~\ref{sec:hint}). |
| 402 |
% \item |
| 403 |
% \DescribeiPageStyle{@empty} |
| 404 |
% Using \pkg{fancyhdr}'s internal page style \pstyle{@empty} |
| 405 |
% could have strange results. However, there is a simple solution for this: |
| 406 |
% Don't use the internal \pstyle{@empty} but always the user level page |
| 407 |
% style \pstyle{empty}! |
| 408 |
% \item |
| 409 |
% \DescribeiPageStyle{@fancy} |
| 410 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 411 |
% The vertical position of the page header does differ a little bit, if |
| 412 |
% \pkg*{scrlayer-fancyhdr} is used instead of |
| 413 |
% \pkg{fancyhdr}. This could be fixed by a modification of the |
| 414 |
% layers \texttt{fancy.head.odd} and \texttt{fancy.head.even} using |
| 415 |
% \opt{addvoffset}. More tests are needed. |
| 416 |
% \item |
| 417 |
% Not all ew features of \pkg{fancyhdr} v5 have been tested yet. |
| 418 |
% \end{itemize} |
| 419 |
% See \url{https://github.com/komascript/scrlayer-fancyhdr/issues} for more |
| 420 |
% issues. |
| 421 |
% |
| 422 |
% \selectlanguage{ngerman} |
| 423 |
% \part{Benutzeranleitung auf Deutsch} |
| 424 |
% \section{Der Sinn dieses Pakets} |
| 425 |
% \label{sec:sinn} |
| 426 |
% Dieses Paket wurde entwickelt, um den Anwendern die Möglichkeit zu geben, |
| 427 |
% die Fähigkeiten von Piet van Oostrums \pkg{fancyhdr} |
| 428 |
% \autocite{package:fancyhdr} mit den Fähigkeiten von |
| 429 |
% \pkg{scrlayer} \autocite{package:scrlayer} zu kombinieren. In |
| 430 |
% anderen Worten: Es wurde geschaffen, um die Seiten-Ebenen von |
| 431 |
% \pkg{scrlayer} mit den Seiten-Stilen von |
| 432 |
% \pkg{fancyhdr} zu kombinieren. |
| 433 |
% |
| 434 |
% In dieser Kombination ist Kompatibilität mit \pkg{fancyhdr} das |
| 435 |
% oberste Ziel! Verwendbarkeit und die Freiheiten, die von |
| 436 |
% \pkg{scrlayer} geboten werden, ist das zweite |
| 437 |
% Ziel. Kompatibilität mit anderen Paketen oder Klassen von \KOMAScript{} |
| 438 |
% \cite{package:koma-script} ist kein primäres Ziel. Vielleicht wird dies in |
| 439 |
% Zukunft eine optionale Fähigkeit werden. Die Aufhebung irgendwelcher realen |
| 440 |
% oder eingebildeter Beschränkungen von \pkg{fancyhdr}, die darüber |
| 441 |
% hinaus gehen, die Verwendung von Ebenen zu ermöglichen, ist kein Ziel und |
| 442 |
% wird auch in Zukunft kein Ziel werden. |
| 443 |
% |
| 444 |
% Wenn Sie eine bessere Kombination von Seitenstilen und Ebenen benötigen, so |
| 445 |
% sollten Sie entweder die Low-Level-Schnittstelle von |
| 446 |
% \pkg{scrlayer} zur Definition von Seitenstilen oder ---~und das |
| 447 |
% ist die Empfehlung des Autors~--- das Paket \pkg{scrlayer-scrpage} |
| 448 |
% anstelle von \pkg*{scrlayer-fancyhdr} oder \pkg{fancyhdr} |
| 449 |
% verwenden. Wenn Sie bessere Kompatibilität mit anderen Teilen von |
| 450 |
% \KOMAScript, beispielsweise mit den \KOMAScript-Klassen. benötigen, sollten |
| 451 |
% Sie \pkg{scrlayer-scrpage} anstelle von \pkg*{scrlayer-fancyhdr} oder |
| 452 |
% \pkg{fancyhdr} verwenden. |
| 453 |
% |
| 454 |
% \section{Wie es funktioniert} |
| 455 |
% \label{sec:funktion} |
| 456 |
% Zur Kombination von \pkg{fancyhdr} mit \pkg{scrlayer} |
| 457 |
% lädt \pkg{scrlayer-scrpage} beide Pakete. Nach dem Laden von |
| 458 |
% \pkg{fancyhdr} definiert es den Seitenstil \pstyle{@fancy} |
| 459 |
% (bis einschließlich \pkg{fancyhdr} Version 3.10) |
| 460 |
% bzw. \pstyle{f@nch@fancycore} (ab \pkg{fancyhdr} Version 4.0) |
| 461 |
% in einen Ebenen-Seitenstil von \pkg{scrlayer} um, bestehend aus |
| 462 |
% den neu definierten Ebenen \texttt{fancy.head.even}, |
| 463 |
% \texttt{fancy.head.odd}, \texttt{fancy.foot.even} und |
| 464 |
% \texttt{fancy.foot.odd}. Die \texttt{\dots head\dots}-Ebenen sind |
| 465 |
% Hintergrund-Ebenen entsprechend dem Seitenkopf von |
| 466 |
% \pkg{fancyhdr}-Seiten\-stilen (oder anderen gebräuchlichen |
| 467 |
% Seitenstilen). Die \texttt{\dots foot\dots}-Ebenen sind Vordergrund-Ebenen |
| 468 |
% entsprechend dem Seitenfuß von |
| 469 |
% \linebreak\pkg{fancyhdr}-Seitenstilen (oder anderen |
| 470 |
% gebräuchlichen Seitenstilen). Die \texttt{\dots even}-Ebenen sind auf gerade |
| 471 |
% Seiten, also linke Seiten von doppelseitigen Dokumenten, beschränkt. Die |
| 472 |
% \texttt{\dots odd}-Ebenen sind auf ungerade Seiten, also rechte Seiten bei |
| 473 |
% doppelseitigen Dokumenten oder alle Seiten bei einseitigen Dokumenten, |
| 474 |
% beschränkt. |
| 475 |
% |
| 476 |
% \DescribeiPageStyle{@fancy} |
| 477 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 478 |
% \DescribePageStyle{fancyplain} |
| 479 |
% \DescribeiPageStyle{plain@fancy} |
| 480 |
% Bis Version 3.10 von \pkg{fancyhdr} war Seitenstil |
| 481 |
% \pstyle{@fancy} ein interner Seitenstil, den Anwender selbst nicht direkt |
| 482 |
% verwenden sollten. Ab Version 4.0 wird \pstyle{f@nch@fancycore} als |
| 483 |
% interner Seitenstil von Paket \pkg{fancyhdr} genutzt. In beiden |
| 484 |
% Fällen wird der interne Seitenstil für den Benutzer\-seiten\-stil |
| 485 |
% \pstyle{fancy} verwendet. Der Benutzerseitenstil \pstyle{fancy} wird |
| 486 |
% ebenfalls für den veralteten Seitenstil \pstyle{fancyplain} des Pakets |
| 487 |
% \pkg{fancyheadings} verwendet, der zusätzlich den Seitenstil |
| 488 |
% \pstyle{plain} in \pkg{fancyhdr}s internen Seitenstil |
| 489 |
% \pstyle{plain@fancy} ändert, der ebenfalls \pstyle{fancy} verwendet, |
| 490 |
% wobei allerdings \cs{if@fancyplain} auf \cs{iftrue} gesetzt ist. Es |
| 491 |
% gibt eine weitere überholte Anweisung |
| 492 |
% \cs{fancyplain}\marg{plain-Code}\marg{fancy-Code}. Diese |
| 493 |
% Anweisung verwendet \meta{plain-Code}, wenn \cs{if@fancyplain} |
| 494 |
% \cs{iftrue} ist, aber \meta{fancy-Code}, wenn \cs{if@fancyplain} |
| 495 |
% \cs{iffalse} ist. Sie kann innerhalb der Definition der |
| 496 |
% Seitenstilelemente verwendet werden um zwischen den Einstellung für |
| 497 |
% \pstyle{fancy} und \pstyle{plain} zu unterscheiden. |
| 498 |
% |
| 499 |
% Seitenstile, die mit der \pkg{fancyhdr}-Anweisung |
| 500 |
% \cs{fancypagestyle} definiert wurden, verwenden ebenfalls immer den |
| 501 |
% Seitenstil \pstyle{fancy} und damit den internen grundlegenden Seitenstil |
| 502 |
% \pstyle{@fancy} (bis einschließlich \pkg{fancyhdr} Version |
| 503 |
% 3.10) bzw. \pstyle{f@nch@fancycore} (ab \pkg{fancyhdr} Version |
| 504 |
% 4). |
| 505 |
% |
| 506 |
% Als Ergebnis der beiden obigen Anmerkungen, verwenden alle Seitenstile von |
| 507 |
% \pkg{fancyhdr} immer denselben internen grundlegenden Seitenstil |
| 508 |
% \pstyle{@fancy} (bis einschließlich \pkg{fancyhdr} Version |
| 509 |
% 3.10) bzw. \pstyle{f@nch@fancycore} (ab \pkg{fancyhdr} Version |
| 510 |
% 4). Als Ergebnis daraus resultiert aus der Umdefinierung des Seitenstils |
| 511 |
% \pstyle{@fancy} (bis einschließlich \pkg{fancyhdr} Version |
| 512 |
% 3.10) bzw. \pstyle{f@nch@fancycore} (ab \pkg{fancyhdr} Version |
| 513 |
% 4) in einen Ebenen-Seitenstil, dass Anwender Ebenen zu allen Seitenstilen |
| 514 |
% von \pkg{fancyhdr} hinzufügen oder daraus löschen können, indem |
| 515 |
% sie Ebenen zu \pstyle{@fancy} (bis einschließlich |
| 516 |
% \pkg{fancyhdr} Version 3.10) bzw. \pstyle{f@nch@fancycore} (ab |
| 517 |
% \pkg{fancyhdr} Version 4) hinzufügen oder daraus löschen. Sie |
| 518 |
% können keine Ebenen unmittelbar zu einzelnen Seitenstilen von |
| 519 |
% \pkg{fancyhdr} wie \pstyle{fancy}, \pstyle{fancyplain}, |
| 520 |
% \pstyle{plain@fancy} oder anderen mit \cs{fancypagestyle} definierten |
| 521 |
% Seitenstilen hinzufügen oder daraus löschen. Aber natürlich können Sie das |
| 522 |
% zweite Argument von \cs{fancypagestyle} nutzen, um Ebenen zum Zeitpunkt |
| 523 |
% der Aktivierung eines \pkg{fancyhdr}-Seitenstils hinzuzufügen |
| 524 |
% oder zu entfernen. Dies stellt eine Verschiebung dar weg von der |
| 525 |
% \pkg{scrlayer}-Schnittstelle zum Hinzufügen oder Entfernen von |
| 526 |
% Ebenen hin zur \pkg{fancyhdr}-Schnittstelle zur Definition von |
| 527 |
% Änderungen des Seitenstils \pstyle{fancy}. |
| 528 |
% |
| 529 |
% Ein weitere solche Verschiebung von der Anwenderschnittstelle von |
| 530 |
% \pkg{scrlayer} zur Anwenderschnittstelle von |
| 531 |
% \pkg{fancyhdr} ist die Entscheidung, ob automatische, lebende |
| 532 |
% Kolumnentitel verwendet werden sollen oder nicht. \pkg{scrlayer} |
| 533 |
% bietet dafür die Optionen \opt{automark} und \opt{manualmark} und die |
| 534 |
% Anweisungen \cs{automark} und \cs{manualmark}. Diese konfigurieren |
| 535 |
% gleichzeitig Anweisungen wie \cs{partmark}, \cs{chaptermark}, |
| 536 |
% \cs{sectionmark} etc. Mit \pkg*{scrlayer-fancyhdr} wird bereits durch |
| 537 |
% Verwendung von Seitenstil \pstyle{@fancy} (bis einschließlich |
| 538 |
% \pkg{fancyhdr} Version 3.10) bzw. \pstyle{f@nch@fancycore} (ab |
| 539 |
% \pkg{fancyhdr} Version 4) auf automatische, lebende Kolumnentitel |
| 540 |
% umgeschaltet. Die erste Aktivierung von \pstyle{fancy} definiert auch |
| 541 |
% weiterhin \cs{chaptermark} und \cs{sectionmark}, wenn eine Klasse mit |
| 542 |
% \cs{chapter} verwendet wird, oder \cs{sectionmark} und |
| 543 |
% \cs{subsectionmark}, wenn eine Klasse ohne \cs{chapter} verwendet |
| 544 |
% wird. Dennoch können Sie weiterhin \cs{manualmark} und \cs{automark} |
| 545 |
% nach der Umschaltung zu einem \pkg{fancyhdr}-Seitenstil |
| 546 |
% verwenden, um die lebenden Kolumnentitel zu konfigurieren. Diese |
| 547 |
% Verschiebung ist also nur partiell. |
| 548 |
% |
| 549 |
% \DescribePageStyle{headings} |
| 550 |
% \DescribePageStyle{myheadings} |
| 551 |
% \DescribePageStyle{plain} |
| 552 |
% Hinweis: Derzeit definieren weder \pkg{scrlayer} noch |
| 553 |
% \pkg{fancyhdr} noch \pkg*{scrlayer-fancyhdr} die Seitenstile |
| 554 |
% \pstyle{headings} oder \pstyle{myheadings} in der Voreinstellung |
| 555 |
% um. Und weder \pkg{scrlayer} noch \pkg{fancyhdr} oder |
| 556 |
% \pkg*{scrlayer-fancyhdr} definieren den Seitenstil \pstyle{plain} um, |
| 557 |
% solange nicht der veraltete \pkg{fancyhdr}-Seitenstil |
| 558 |
% \pstyle{fancyplain} aktiviert wird. Wenn Sie also einen Ebeneseitenstil |
| 559 |
% für \pstyle{plain}-Seiten wünschen, insbesondere für die erste Seite |
| 560 |
% eines Kapitels oder Teils oder die Seiten mit dem Titelkopf, so müssen Sie |
| 561 |
% entweder den veralteten \pkg{fancyhdr}-Seitenstil |
| 562 |
% \pstyle{fancyplain} verwenden oder den Seitenstil \pstyle{plain} |
| 563 |
% entweder per \cs{fancypagestyle} umdefinieren, wie dies in der |
| 564 |
% \pkg{fancyhdr}-Anleitung beschrieben ist, oder per |
| 565 |
% \cs{DeclarePageStyleByLayers}, wie dies in der \KOMAScript-Anleitung |
| 566 |
% dokumentiert ist. |
| 567 |
% \DescribeOption{myheading}% |
| 568 |
% \DescribeOption{headings}% |
| 569 |
% Darüber hinaus bietet \pkg{fancyhdr} ab Version 4.0 die Optionen |
| 570 |
% \opt{myheadings} und \opt{headings}, um die entsprechenden Seitenstile |
| 571 |
% umzudefinieren. \pkg*{scrlayer-fancyhdr} bietet diese Optionen ebenfalls |
| 572 |
% und leitet sie an \pkg{fancyhdr} weiter. |
| 573 |
% |
| 574 |
% \DescribePageStyle{empty} |
| 575 |
% \DescribeiPageStyle{@empty} |
| 576 |
% Hinweis: Der Seitenstil \pstyle{empty} ist etwas |
| 577 |
% speziell. \pkg{scrlayer} definiert diesen in einen |
| 578 |
% Ebenen-Seitenstil um. Und \pkg{fancyhdr}s interner Seitenstil |
| 579 |
% \pstyle{@empty} ist ebenfalls identisch mit \pstyle{empty}. Daher |
| 580 |
% verwendet auch \pstyle{@empty} die Ebenen von \pstyle{empty}, aber Sie |
| 581 |
% sollten nicht versuchen, diese direkt mit der Schnittstelle von |
| 582 |
% \pkg{scrlayer} zu verändern. Mehr noch, wenn |
| 583 |
% \pkg{fancyhdr} vor \pkg*{scrlayer-fancyhdr} geladen wird, ist |
| 584 |
% der interne Seitenstil \pstyle{@empty} von \pkg{fancyhdr} |
| 585 |
% nicht länger eine Kopie des Ebenen-Seitenstils \pstyle{empty} von |
| 586 |
% \pkg{scrlayer}, sondern weiterhin des Standard-Seitenstils |
| 587 |
% \pstyle{empty}. Allerdings verwendet \pkg{fancyhdr} mit |
| 588 |
% \pkg*{scrlayer-fancyhdr} selbst den internen Seitenstil |
| 589 |
% \pstyle{@empty} gar nicht mehr. Daher brauchen Sie das eigentlich auch |
| 590 |
% nicht zu wissen. |
| 591 |
% |
| 592 |
% \section{Wie man das Paket verwendet} |
| 593 |
% \label{sec:verwendung} |
| 594 |
% |
| 595 |
% Um das Paket zu verwenden, muss man es laden, beispielsweise per: |
| 596 |
%\begin{verbatim} |
| 597 |
% \usepackage{scrlayer-fancyhdr} |
| 598 |
%\end{verbatim} |
| 599 |
% an Stelle von \pkg{scrlayer} oder \pkg{fancyhdr} oder |
| 600 |
% vor dem Laden eines dieser Pakete. Empfohlen wird das komplette Ersetzen von |
| 601 |
% \pkg{scrlayer} und \pkg{fancyhdr} durch das Laden von |
| 602 |
% \pkg*{scrlayer-fancyhdr}, weil dadurch Optionskonflikte |
| 603 |
% (engl. \emph{option clash}) vermieden wird. \pkg*{scrlayer-fancyhdr} |
| 604 |
% stellt alle Optionen von \pkg{scrlayer} und |
| 605 |
% \pkg{fancyhdr} bereit und leitet diese an |
| 606 |
% \pkg{scrlayer} bzw. \pkg{fancyhdr} |
| 607 |
% weiter. Nichtsdestotrotz kann es in seltenen Fällen nützlich sein, dass man |
| 608 |
% das Paket auch zusätzlich nach \pkg{scrlayer} und |
| 609 |
% \pkg{fancyhdr} laden kann. In diesem Fall sollte |
| 610 |
% \pkg{scrlayer} vor \pkg{fancyhdr} und zuletzt |
| 611 |
% \pkg*{scrlayer-fancyhdr} geladen werden. |
| 612 |
% |
| 613 |
% \DescribeiPageStyle{@fancy} |
| 614 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 615 |
% \DescribePageStyle{fancy} |
| 616 |
% \DescribePageStyle{fancyplain} |
| 617 |
% \DescribeiPageStyle{plain@fancy} |
| 618 |
% \DescribeCommand\fancypagestyle |
| 619 |
% Nach dem Laden des Pakets sollten Sie in der Lage sein, die Seitenstile und |
| 620 |
% Befehle von \pkg{fancyhdr} zu verwenden und Ebenen zum internen |
| 621 |
% \pkg{fancyhdr}-Seitenstil \pstyle{@fancy} (bis einschließlich |
| 622 |
% \pkg{fancyhdr} Version 3.10) bzw. \pstyle{f@nch@fancycore} (ab |
| 623 |
% \pkg{fancyhdr} Version 4) hinzuzufügen oder davon zu |
| 624 |
% entfernen. Hinweis: Es ist Ihnen nicht möglich, Ebenen zu den |
| 625 |
% \pkg{fancyhdr}-Seitenstilen \pstyle{fancy}, |
| 626 |
% \pstyle{fancyplain}, \pstyle{plain@fancy} oder jedem anderen mit |
| 627 |
% \cs{fancypagestyle} definierten Seitenstil hinzuzufügen. Jedoch wird das |
| 628 |
% Hinzufügen oder Entfernen von Ebenen zu bzw. von \pstyle{@fancy} (bis |
| 629 |
% einschließlich \pkg{fancyhdr} Version 3.10) |
| 630 |
% bzw. \pstyle{f@nch@fancycore} (ab \pkg{fancyhdr} Version 4) |
| 631 |
% immer alle diese Seitenstile mit ändern! |
| 632 |
% |
| 633 |
% \DescribePageStyle{plain} |
| 634 |
% \DescribePageStyle{headings} |
| 635 |
% \DescribePageStyle{myheadings} |
| 636 |
% \DescribePageStyle{empty} |
| 637 |
% Hinweis: Das Laden von Paket \pkg*{scrlayer-fancyhdr} wird weder den |
| 638 |
% Seitenstil \pstyle{plain} noch \pstyle{headings} noch |
| 639 |
% \pstyle{myheadings} noch irgend einen anderen Seitenstil außer |
| 640 |
% \pstyle{empty} automatisch in einen Ebenen-Seitenstil umwandeln! Wenn Sie |
| 641 |
% aber Option \opt{headings} oder \opt{myheadings} angeben, definiert |
| 642 |
% \pkg{fancyhdr} die entsprechenden Seitenstile in |
| 643 |
% \pkg{fancyhdr}-Seitenstil um --~somit hängen diese dann von |
| 644 |
% demselben internen Seitenstil, entweder \pstyle{@fancy} (bis einschließlich |
| 645 |
% \pkg{fancyhdr} Version 3.10) oder \pstyle{f@nch@fancycore} (ab |
| 646 |
% \pkg{fancyhdr} Version 4), ab. |
| 647 |
% |
| 648 |
% |
| 649 |
% |
| 650 |
% \section{Tipp} |
| 651 |
% \label{sec:tipp} |
| 652 |
% |
| 653 |
% Um unabhängig von der verendeten Version von \pkg{fancyhdr} zu |
| 654 |
% werden, kann man: |
| 655 |
% \begin{verbatim} |
| 656 |
% \IfPackageAtLeastTF{fancyhdr}{2019/03/21}{% |
| 657 |
% \DeclarePageStyleAlias{@fancy}{f@nch@fancycore}% |
| 658 |
% }{% |
| 659 |
% \DeclarePageStyleAlias{f@nch@fancycore}{@fancy}% |
| 660 |
% } |
| 661 |
% \end{verbatim}^^A |
| 662 |
% \unskip nach dem Laden von \pkg*{scrlayer-fancyhdr} verwendenm, bevor man |
| 663 |
% irgendwelche Ebenen zu dem internen Seitenstil hinzufügt oder davon |
| 664 |
% entfernt. Diese Codezeilen definieren bei Verwendung von |
| 665 |
% \pkg{fancyhdr} aber Version 4.0 Seitenstil \pstyle{@fancy} als |
| 666 |
% Alias für Seitenstil \pstyle{f@nch@fancycore} und umgekehrt für |
| 667 |
% \pkg{fancyhdr} bis einschließlich Version 3.10 |
| 668 |
% \pstyle{f@ch@fancycore} als Alias für Seitenstil \pstyle{@fancy}. Damit |
| 669 |
% führt dann sowohl: |
| 670 |
% \begin{verbatim} |
| 671 |
% \AddLayersToPageStyle{@fancy}{...} |
| 672 |
% \end{verbatim}^^A |
| 673 |
% \unskip als auch |
| 674 |
% \begin{verbatim} |
| 675 |
% \AddLayersToPageStyle{f@nch@fancycore}{...} |
| 676 |
% \end{verbatim}^^A |
| 677 |
% \unskip dazu, dass die Ebenen zum internen Ebenen-Seitenstil hinzugefügt |
| 678 |
% werden. |
| 679 |
% |
| 680 |
% |
| 681 |
% |
| 682 |
% \section{Bekannte Probleme} |
| 683 |
% \label{sec:probleme} |
| 684 |
% |
| 685 |
% Bitte beachten Sie, dass die folgenden Hinweise entweder Notizen für den |
| 686 |
% Paketautor oder Hinweise für die Anwender darstellen und verhindern sollen, |
| 687 |
% dass dieselben Probleme immer wieder gemeldet werden. Die Auflistung sagt |
| 688 |
% nichts darüber aus, ob es sich dabei um Fehler oder Eigenschaften handelt: |
| 689 |
% \begin{itemize} |
| 690 |
% \item |
| 691 |
% \DescribePageStyle{fancy} |
| 692 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 693 |
% \DescribePageStyle{fancyplain} |
| 694 |
% \DescribeCommand\fancypagestyle |
| 695 |
% \DescribeiPageStyle{@fancy} |
| 696 |
% Sie können keine Ebenen zu den Seitenstilen auf Benutzerebene |
| 697 |
% \pstyle{fancy} oder \pstyle{fancyplain} oder irgendwelchen anderen |
| 698 |
% Seitenstilen, die mit \cs{fancypagestyle} definiert wurden, |
| 699 |
% hinzufügen. Dies ist nur für den internen Seitenstil \pstyle{@fancy} (bis |
| 700 |
% einschließlich \pkg{fancyhdr} Version 3.10) |
| 701 |
% bzw. \pstyle{f@nch@fancycore} (ab \pkg{fancyhdr} Version 4) |
| 702 |
% möglich (see auch Abschnitt~\ref{sec:tipp}). |
| 703 |
% \item |
| 704 |
% \DescribeiPageStyle{@empty} |
| 705 |
% Die Verwendung des internen \pkg{fancyhdr}-Seitenstils |
| 706 |
% \pstyle{@empty} kann zu unerwarteten Ergebnissen führen. Es gibt jedoch |
| 707 |
% eine einfache Lösung für dieses Problem: Verwenden Sie nicht den internen |
| 708 |
% Seitenstile \pstyle{@empty}, sondern immer den Seitenstile |
| 709 |
% \pstyle{empty} der Benutzerebene. |
| 710 |
% \item |
| 711 |
% \DescribeiPageStyle{@fancy} |
| 712 |
% \DescribeiPageStyle{f@nch@fancycore} |
| 713 |
% Die vertikale Position des Seitenkopfes weicht ein wenig ab, wenn |
| 714 |
% \pkg*{scrlayer-fancyhdr} an Stelle von \pkg{fancyhdr} |
| 715 |
% verwendet wird. Dies kann durch leichte Modifikation der Ebenen |
| 716 |
% \texttt{fancy.head.odd} und \texttt{fancy.head.even} mit Hilfe von |
| 717 |
% \opt{addvoffset} behoben werden. Weitere Tests sind hier erforderlich. |
| 718 |
% \item |
| 719 |
% Die neuen Möglichkeiten von \pkg{fancyhdr} v5 sind weitgehend ungetested. |
| 720 |
% \end{itemize} |
| 721 |
% Siehe \url{https://github.com/komascript/scrlayer-fancyhdr/issues} für |
| 722 |
% weitere bekannte Probleme. |
| 723 |
% |
| 724 |
%\iffalse |
| 725 |
%</dtx> |
| 726 |
%\fi |
| 727 |
% |
| 728 |
% \StopEventually{} |
| 729 |
% |
| 730 |
% \selectlanguage{english} |
| 731 |
% \part{Implementation of \pkg{scrlayer-fancyhdr}} |
| 732 |
% \label{sec:scrlayer-fancyhdr} |
| 733 |
% |
| 734 |
% \sloppy^^A Good paragraph breaking is not the purpose of implementation |
| 735 |
% ^^A documentation. |
| 736 |
% \iffalse |
| 737 |
%<*package> |
| 738 |
% \fi |
| 739 |
% |
| 740 |
% This section if for developers only. |
| 741 |
% |
| 742 |
% We need \pkg{scrlayer} at least version 2021/02/15, |
| 743 |
% \begin{macrocode} |
| 744 |
%<*init> |
| 745 |
\RequirePackage{scrlayer}[2021/02/15] |
| 746 |
%</init> |
| 747 |
% \end{macrocode} |
| 748 |
% Because before \cs{scrlayer@do@inherited@options} would not be defined. And |
| 749 |
% we need it, to inherit all options of \pkg{scrlayer}. |
| 750 |
% \begin{macrocode} |
| 751 |
%<*options> |
| 752 |
\scrlayer@do@inherited@options{\scrlayer@inherit@option} |
| 753 |
%</options> |
| 754 |
% \end{macrocode} |
| 755 |
% |
| 756 |
% And the very first thing at the body, after definition of the options is to |
| 757 |
% process the options. |
| 758 |
% \begin{macrocode} |
| 759 |
%<*body> |
| 760 |
\KOMAProcessOptions |
| 761 |
%</body> |
| 762 |
% \end{macrocode} |
| 763 |
% |
| 764 |
% Note: The main problem of this interface is, that it tries to implement the |
| 765 |
% user interface of package \pkg{fancyhdr} by Piet van Oostrum, that is |
| 766 |
% completely different from \pkg{scrlayer} and not really compatible with |
| 767 |
% \pkg{scrlayer}, using \pkg{scrlayer}. This means, that |
| 768 |
% \pkg*{scrlayer-fancyhdr} never can be a drop-in replacement of |
| 769 |
% \pkg{fancyhdr}. Nevertheless it can help to let \pkg{scrlayer} and |
| 770 |
% \pkg{fancyhdr} coexist. To do so |
| 771 |
% \begin{itemize} |
| 772 |
% \item the lowest level of \pkg{fancyhdr} should not be the page style |
| 773 |
% but a layer |
| 774 |
% \item the page styles of \pkg{fancyhdr} should be layer page styles |
| 775 |
% \item init code of the page styles of \pkg{fancyhdr} should use the |
| 776 |
% layer page init code |
| 777 |
% \end{itemize} |
| 778 |
% Currently it is unsure whether it would be best to do a new implementation |
| 779 |
% or to load original \pkg{fancyhdr} and to only modify some things. First |
| 780 |
% I'll try the second method. Currently we explicitly provide the options of |
| 781 |
% \pkg{fancyhdr}. |
| 782 |
% \changes{v0.3}{2025-01-07}{new \pkg{fancyhdr} option \opt{twoside}} |
| 783 |
% \begin{macrocode} |
| 784 |
%<*options> |
| 785 |
\DeclareOption{nocheck}{\PassOptionsToPackage{nocheck}{fancyhdr}} |
| 786 |
\DeclareOption{compatV3}{\PassOptionsToPackage{compatV3}{fancyhdr}} |
| 787 |
\DeclareOption{myheadings}{\PassOptionsToPackage{myheadings}{fancyhdr}} |
| 788 |
\DeclareOption{headings}{\PassOptionsToPackage{headings}{fancyhdr}} |
| 789 |
\DeclareOption{twoside}{\PassOptionsToPackage{twoside}{fancyhdr}} |
| 790 |
%</options> |
| 791 |
% \end{macrocode} |
| 792 |
% \begin{macrocode} |
| 793 |
%<*body> |
| 794 |
\RequirePackage{fancyhdr} |
| 795 |
%</body> |
| 796 |
% \end{macrocode} |
| 797 |
% |
| 798 |
% We need at least one new layer for the new layer page style |
| 799 |
% \pstyle{fancy}. However, it could be useful to have not only one but |
| 800 |
% four layers (even side head, odd side head, even side foot, odd side foot). |
| 801 |
% \changes{v0.3}{2025-01-07}{\cs{f@nch@head} and \cs{f@nch@foot} have 8 |
| 802 |
% arguments with \pkg{fancyhdr} v5} |
| 803 |
% \changes{v0.3.1}{2025-01-07}{missing backslashs added} |
| 804 |
% \changes{v0.4}{2025-02-10}{\cs{f@nch@head} and \cs{f@nch@foot} have 6 |
| 805 |
% arguments with \pkg{fancyhdr} v5.2} |
| 806 |
% \begin{macrocode} |
| 807 |
%<*body> |
| 808 |
\IfPackageAtLeastTF{fancyhdr}{2025/02/07}{% |
| 809 |
\DeclareNewLayer[% |
| 810 |
background,oddpage, |
| 811 |
head, |
| 812 |
contents={\hb@xt@ \layerwidth{% |
| 813 |
\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh{o}% |
| 814 |
}}% |
| 815 |
]{fancy.head.odd} |
| 816 |
\DeclareNewLayer[% |
| 817 |
background,evenpage, |
| 818 |
head, |
| 819 |
contents={\hb@xt@ \layerwidth{% |
| 820 |
\f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh{e}% |
| 821 |
}}% |
| 822 |
]{fancy.head.even} |
| 823 |
\DeclareNewLayer[% |
| 824 |
foreground,oddpage, |
| 825 |
foot, |
| 826 |
contents={\hb@xt@ \layerwidth{% |
| 827 |
\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf{o}% |
| 828 |
}}% |
| 829 |
]{fancy.foot.odd} |
| 830 |
\DeclareNewLayer[% |
| 831 |
foreground,evenpage, |
| 832 |
foot, |
| 833 |
contents={\hb@xt@ \layerwidth{% |
| 834 |
\f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf{e}% |
| 835 |
}}% |
| 836 |
]{fancy.foot.even} |
| 837 |
}{% |
| 838 |
\IfPackageAtLeastTF{fancyhdr}{2025/01/01}{% |
| 839 |
\DeclareNewLayer[% |
| 840 |
background,oddpage, |
| 841 |
head, |
| 842 |
contents={\hb@xt@ \layerwidth{% |
| 843 |
\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh |
| 844 |
\f@nch@width@olh\f@nch@width@och\f@nch@width@orh |
| 845 |
}} |
| 846 |
]{fancy.head.odd} |
| 847 |
\DeclareNewLayer[% |
| 848 |
background,evenpage, |
| 849 |
head, |
| 850 |
contents={\hb@xt@ \layerwidth{% |
| 851 |
\f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh |
| 852 |
\f@nch@width@elh\f@nch@width@ech\f@nch@width@erh |
| 853 |
}} |
| 854 |
]{fancy.head.even} |
| 855 |
\DeclareNewLayer[% |
| 856 |
foreground,oddpage, |
| 857 |
foot, |
| 858 |
contents={\hb@xt@ \layerwidth{% |
| 859 |
\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf |
| 860 |
\f@nch@width@olf\f@nch@width@ocf\f@nch@width@orf |
| 861 |
}} |
| 862 |
]{fancy.foot.odd} |
| 863 |
\DeclareNewLayer[% |
| 864 |
foreground,evenpage, |
| 865 |
foot, |
| 866 |
contents={\hb@xt@ \layerwidth{% |
| 867 |
\f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf |
| 868 |
\f@nch@width@elf\f@nch@width@ecf\f@nch@width@erf |
| 869 |
}} |
| 870 |
]{fancy.foot.even} |
| 871 |
}{% |
| 872 |
\DeclareNewLayer[% |
| 873 |
background,oddpage, |
| 874 |
head, |
| 875 |
contents={\hb@xt@ \layerwidth{% |
| 876 |
\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh |
| 877 |
}} |
| 878 |
]{fancy.head.odd} |
| 879 |
\DeclareNewLayer[% |
| 880 |
background,evenpage, |
| 881 |
head, |
| 882 |
contents={\hb@xt@ \layerwidth{% |
| 883 |
\f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh |
| 884 |
}} |
| 885 |
]{fancy.head.even} |
| 886 |
\DeclareNewLayer[% |
| 887 |
foreground,oddpage, |
| 888 |
foot, |
| 889 |
contents={\hb@xt@ \layerwidth{% |
| 890 |
\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf |
| 891 |
}} |
| 892 |
]{fancy.foot.odd} |
| 893 |
\DeclareNewLayer[% |
| 894 |
foreground,evenpage, |
| 895 |
foot, |
| 896 |
contents={\hb@xt@ \layerwidth{% |
| 897 |
\f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf |
| 898 |
}} |
| 899 |
]{fancy.foot.even} |
| 900 |
}% |
| 901 |
} |
| 902 |
% \end{macrocode} |
| 903 |
% \begin{ipgstyle}{f@nch@fancycore} |
| 904 |
% \changes{0.1.3558}{2021/02/15}{support for \pkg{fancyhdr} 4} |
| 905 |
% \begin{ipgstyle}{@fancy} |
| 906 |
% \begin{macro}{\@mkboth} |
| 907 |
% And have to create a layer page style from this new layers, but we do not |
| 908 |
% redefine page style \pstyle{fancy} but the low level page style |
| 909 |
% \pstyle{@fancy} (up to \pkg{fancyhdr} version 3.10) |
| 910 |
% resp. \pstyle{f@nch@fancycore} (from \pkg{fancyhdr} version 4.0). |
| 911 |
% |
| 912 |
% \pkg{fancyhdr} does some initialization at the very first call |
| 913 |
% of \cs{pagestyle{fancy}}. To do so \pkg{fancyhdr} first uses a different |
| 914 |
% page style definition, that does the initialization and redefines the page |
| 915 |
% style afterwards. This is still active with \pkg*{scrlayer-fancyhdr}. |
| 916 |
% Additionally, \pkg{fancyhdr} redefines \cs{@mkboth} at every selection |
| 917 |
% of the internal page style \pstyle{@fancy} |
| 918 |
% resp. \pstyle{f@nch@fancycore}. This can be adapted using the |
| 919 |
% \opt{onselect} feature of the new layer page style \pstyle{@fancy} |
| 920 |
% resp. \pstyle{f@nch@fancycore}. In my opinion, the |
| 921 |
% |\let\@mkboth\markboth| used by page style \pstyle{headings} of, e.\,g., |
| 922 |
% the standard classes or the \KOMAScript{} classes would be best |
| 923 |
% here. However, \pkg{fancyhdr} uses the uncommon |
| 924 |
% |\def\@mkboth{\protect\markboth}|, which would fail if a class or package |
| 925 |
% tests \cs{@mkboth} using |\ifx\@mkboth\markboth|. However, \KOMAScript's |
| 926 |
% \cs{IfActiveMkBoth} (see the \pkg{scrbase} chapter in the \KOMAScript{} |
| 927 |
% manual) does also recognize the \pkg{fancyhdr} definition and copying |
| 928 |
% this is more compatible with \pkg{fancyhdr}. |
| 929 |
% \begin{macrocode} |
| 930 |
\IfPackageAtLeastTF{fancyhdr}{2019/03/21}{% |
| 931 |
\DeclarePageStyleByLayers[ |
| 932 |
onselect={\def\@mkboth{\protect\markboth}}, |
| 933 |
]{f@nch@fancycore}{% |
| 934 |
fancy.head.odd,fancy.head.even,fancy.foot.odd,fancy.foot.even |
| 935 |
}% |
| 936 |
}{% |
| 937 |
\DeclarePageStyleByLayers[ |
| 938 |
onselect={\def\@mkboth{\protect\markboth}}, |
| 939 |
]{@fancy}{% |
| 940 |
fancy.head.odd,fancy.head.even,fancy.foot.odd,fancy.foot.even |
| 941 |
}% |
| 942 |
} |
| 943 |
%</body> |
| 944 |
% \end{macrocode} |
| 945 |
% Note: Redefining page style \pstyle{@fancy} |
| 946 |
% resp. \pstyle{f@nch@fancycore} instead of \pstyle{fancy} |
| 947 |
% does also mean, that features like options \opt{automark} and |
| 948 |
% \opt{manualmark} resp. \cs{automark} and \cs{manualmark} are not fully |
| 949 |
% supported by \pkg*{scrlayer-fancyhdr}. Also currently the font features |
| 950 |
% of the \KOMAScript{} classes are not supported by |
| 951 |
% \pkg*{scrlayer-fancyhdr}. However you are now able to combine other |
| 952 |
% features of \pkg{scrlayer} with features of |
| 953 |
% \pkg{fancyhdr} and you can, e.g., use |
| 954 |
% \pkg{scrlayer-notecolumn} with \pkg*{scrlayer-fancyhdr}. |
| 955 |
% \end{macro}%^^A \@mkboth |
| 956 |
% \end{ipgstyle}%^^A @fancy |
| 957 |
% \end{ipgstyle}%^^A f@nch@fancycore |
| 958 |
% |
| 959 |
% A future release of \pkg*{scrlayer-fancyhdr} may even provide the font |
| 960 |
% features of the \KOMAScript{} classes and a working |
| 961 |
% \opt{markcase}. However, in this case I would have to redefine the |
| 962 |
% initial page style \pstyle{fancy} and the layers above. |
| 963 |
% |
| 964 |
% \iffalse |
| 965 |
%</package> |
| 966 |
% \fi |
| 967 |
% |
| 968 |
% \Finale |
| 969 |
% |
| 970 |
\endinput |
| 971 |
% |
| 972 |
% End of file `scrlayer-fancyhdr.dtx'. |
| 973 |
% |
| 974 |
|
| 975 |
%%% Local Variables: |
| 976 |
%%% mode: doctex |
| 977 |
%%% eval: (flyspell-mode 1) |
| 978 |
%%% ispell-local-dictionary: "en_US" |
| 979 |
%%% TeX-master: t |
| 980 |
%%% End: |