├── latexmkrc ├── fancyheadings.sty ├── Makefile ├── fancyhdr.ins ├── README.TPL ├── README ├── extramarks.sty ├── README.md ├── extramarks-v4.sty └── fancyhdr.sty /latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = 1; 2 | $pdflatex = 'pdflatex %O -synctex=1 -file-line-error -interaction=nonstopmode %S'; 3 | $makeindex = 'makeindex -s gind -g %S'; 4 | # Custom dependency for glossary/glossaries package 5 | # if you make custom glossaries you may have to add items to the @cus_dep_list and corresponding sub-routines 6 | add_cus_dep('glo', 'gls', 0, 'makeglo2gls'); 7 | sub makeglo2gls { 8 | system("makeindex -s gglo -o '$_[0]'.gls '$_[0]'.glo"); 9 | } 10 | -------------------------------------------------------------------------------- /fancyheadings.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `fancyheadings.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% fancyhdr.dtx (with options: `fancyheadings') 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% This file may be distributed and/or modified under the conditions of 12 | %% the LaTeX Project Public License, either version 1.3 of this license 13 | %% or (at your option) any later version. The latest version of this 14 | %% license is in: 15 | %% 16 | %% http://www.latex-project.org/lppl.txt 17 | %% 18 | %% and version 1.3 or later is part of all distributions of LaTeX version 19 | %% 2005/12/01 or later. 20 | %% 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | \NeedsTeXFormat{LaTeX2e} 23 | \ProvidesPackage{fancyheadings} 24 | [2022/11/09 v4.1 25 | Legacy package to call fancyhdr] 26 | % Public domain 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | \PackageWarningNoLine{fancyheadings}{% 29 | Please stop using fancyheadings!\MessageBreak 30 | Use fancyhdr instead.\MessageBreak 31 | We will call fancyhdr with the very same\MessageBreak 32 | options you passed to fancyheadings.\MessageBreak 33 | \MessageBreak 34 | fancyhdr is 99 percent compatible with\MessageBreak 35 | fancyheadings. The only incompatibility is\MessageBreak 36 | that \protect\headrulewidth\space and \protect\footrulewidth\space 37 | and\MessageBreak 38 | their \protect\plain... versions are no longer length\MessageBreak 39 | parameters, but normal macros (to be changed\MessageBreak 40 | with \protect\renewcommand\space rather than \protect\setlength).} 41 | \RequirePackage{fancyhdr} 42 | \endinput 43 | %% 44 | %% End of file `fancyheadings.sty'. 45 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean dist release 2 | 3 | VERSION1:=$(shell grep '% *\[20' fancyhdr.dtx | sed 's/.*\[//' \ 4 | | awk '{print $$2 " " $$1}') 5 | VERSION0:=$(shell grep '% *\[20' fancyhdr.dtx | sed 's/.*\[//' \ 6 | | awk '{print $$2 " " $$1}') 7 | VERSION4:=$(shell grep '% *\[20' fancyhdr.dtx | sed 's/.*\[//' \ 8 | | awk '{print $$2 " " $$1}') 9 | VERSION:=$(shell echo "$(VERSION1)" | awk '{print $$1}' | sed 's/v//') 10 | 11 | all: fancyhdr.sty extramarks.sty extramarks-v4.sty fancyheadings.sty fancyhdr.pdf 12 | 13 | extramarks.sty fancyhdr.sty extramarks-v4.sty fancyheadings.sty: fancyhdr.dtx fancyhdr.ins 14 | tex fancyhdr.ins 15 | 16 | fancyhdr.pdf: fancyhdr.dtx fancyhdr.sty extramarks.sty extramarks-v4.sty fancyheadings.sty 17 | rm -f fancyhdr.ind 18 | latexmk fancyhdr.dtx 19 | 20 | clean: 21 | rm -f *.aux *.log *.idx *.ind *.ilg *.fdb_latexmk *.fls *.glo *.gls *~ *.rel *.toc 22 | rm -f *.synctex.gz *.bbl *.blg *.out fancyhdr.pdf 23 | rm -f fancyhdr.sty extramarks*.sty fancyheadings.sty 24 | 25 | README: README.TPL fancyhdr.dtx 26 | sed -e "s@@$(VERSION1)@g" -e "s@@$(VERSION0)@g" -e "s@@$(VERSION4)@g" \ 27 | -e "s@@$(VERSION)@g" README.TPL > README 28 | 29 | install: 30 | cp fancyhdr.sty extramarks*.sty ~/Library/texmf/tex/latex 31 | 32 | # Make dist to make fancyhdr.zip for submission to CTAN 33 | dist: fancyhdr.zip 34 | distfiles = README fancyhdr.dtx fancyhdr.pdf fancyhdr.ins 35 | fancyhdr.zip: $(distfiles) 36 | cd .. ; zip -9 fancyhdr/fancyhdr.zip $(addprefix fancyhdr/,$(distfiles)) 37 | 38 | # Make release for release files (like a github release) 39 | release: fancyhdr-$(VERSION).zip fancyhdr-dist-$(VERSION).zip 40 | 41 | releasefiles = README fancyhdr.sty fancyheadings.sty extramarks.sty extramarks-v4.sty fancyhdr.pdf 42 | fancyhdr-dist-$(VERSION).zip: $(releasefiles) 43 | cd .. ; zip -9 fancyhdr/fancyhdr-dist-$(VERSION).zip $(addprefix fancyhdr/,$(releasefiles)) 44 | 45 | sourcefiles = README README.TPL fancyhdr.dtx fancyhdr.ins Makefile latexmkrc 46 | fancyhdr-$(VERSION).zip: $(sourcefiles) 47 | cd .. ; zip -9 fancyhdr/fancyhdr-$(VERSION).zip $(addprefix fancyhdr/,$(sourcefiles)) 48 | -------------------------------------------------------------------------------- /fancyhdr.ins: -------------------------------------------------------------------------------- 1 | %% 2 | %% Copyright (C) 2016-2019 by Pieter van Oostrum 3 | %% 4 | %% This file may be distributed and/or modified under the conditions of 5 | %% the LaTeX Project Public License, either version 1.3 of this license 6 | %% or (at your option) any later version. The latest version of this 7 | %% license is in: 8 | %% 9 | %% http://www.latex-project.org/lppl.txt 10 | %% 11 | %% and version 1.3 or later is part of all distributions of LaTeX version 12 | %% 2005/12/01 or later. 13 | %% 14 | 15 | \input l3docstrip.tex 16 | \keepsilent 17 | 18 | \usedir{tex/latex/fancyhdr} 19 | 20 | \preamble 21 | 22 | This is a generated file. 23 | 24 | This file may be distributed and/or modified under the conditions of 25 | the LaTeX Project Public License, either version 1.3 of this license 26 | or (at your option) any later version. The latest version of this 27 | license is in: 28 | 29 | http://www.latex-project.org/lppl.txt 30 | 31 | and version 1.3 or later is part of all distributions of LaTeX version 32 | 2005/12/01 or later. 33 | 34 | \endpreamble 35 | 36 | \askforoverwritefalse 37 | \generate{\file{fancyhdr.sty}{\from{\jobname.dtx}{fancyhdr}}} 38 | \generate{\file{fancyheadings.sty}{\from{\jobname.dtx}{fancyheadings}}} 39 | \generate{\file{extramarks.sty}{\from{\jobname.dtx}{extramarks}}} 40 | \generate{\file{extramarks-v4.sty}{\from{\jobname.dtx}{extramarks-v4}}} 41 | 42 | \obeyspaces 43 | \Msg{*************************************************************} 44 | \Msg{* *} 45 | \Msg{* To finish the installation you have to move the following *} 46 | \Msg{* file into a directory searched by TeX: *} 47 | \Msg{* *} 48 | \Msg{* fancyhdr.sty *} 49 | \Msg{* fancyheadings.sty *} 50 | \Msg{* extramarks.sty *} 51 | \Msg{* *} 52 | \Msg{* To produce the documentation run the file \jobname.dtx *} 53 | \Msg{* through LaTeX. *} 54 | \Msg{* *} 55 | \Msg{* Happy TeXing! *} 56 | \Msg{* *} 57 | \Msg{*************************************************************} 58 | 59 | \endbatchfile 60 | -------------------------------------------------------------------------------- /README.TPL: -------------------------------------------------------------------------------- 1 | fancyhdr – Extensive control of page headers and footers in LaTeX 2 | extramarks - Extra marks for LaTeX 3 | 4 | The package provides extensive facilities, both for constructing headers 5 | and footers, and for controlling their use (for example, at times when 6 | LaTeX would automatically change the heading style in use). 7 | 8 | This is version of fancyhdr.sty and extramarks.sty. 9 | 10 | The distribution package from CTAN (e.g. fancyhdr.zip) 11 | consists of the following files: 12 | 13 | README This file 14 | fancyhdr.dtx The complete source of the package and documentation 15 | fancyhdr.ins The installation file; run through TeX to generate *.sty 16 | fancyhdr.pdf PDF of the documentation 17 | 18 | After processing (by tex) of fancyhdr.ins, the following package files will be generated: 19 | 20 | fancyhdr.sty the LaTeX package 21 | extramarks.sty a package for additional marks 22 | extramarks-v4.sty a legacy version of extramarks.sty 23 | fancyheadings.sty this loads fancyhdr with a warning message 24 | 25 | If you have a user distribution package from github (fancyhdr-dist-.zip), 26 | then you don't have to do this processing. 27 | 28 | If you have a source distribution from github (fancyhdr-.zip), 29 | it will also contain the .sty files, but not the .pdf file. 30 | To create fancyhdr.pdf, either just run the 'make' command, or: 31 | latexmk fancyhdr.dtx 32 | To recreate the .sty files run: 33 | tex fancyhdr.ins 34 | 35 | The package fancyheadings included here is an ancient version of fancyhdr. 36 | It should not be used anymore. It just loads fancyhdr with a warning message. 37 | 38 | The documentation (fancyhdr.dtx/fancyhdr.pdf) describes both 39 | fancyhdr.sty and extramarks.sty. 40 | In order to latex the documentation you need to have a copy of 41 | boxedminipage.sty (CTAN:/macros/latex/contrib/boxedminipage) and 42 | refcount.sty (CTAN:/macros/latex/contrib/oberdiek/) installed. 43 | 44 | The older versions fancyhdr.sty version 3 and extramarks.sty version 2 45 | are the packages as described in the second edition of The LaTeX 46 | Companion. That documentation can still be used for the newer 47 | versions, but some of the newer features will be missing. 48 | 49 | LICENCE: All files in this package may be distributed under the terms of 50 | the LaTeX Project Public License, as described in lppl.txt in the base 51 | LaTeX distribution. Either version 1.3 or, at your option, any later 52 | version. 53 | -- 54 | Pieter van Oostrum. 55 | 56 | http://pieter.vanoostrum.org/ 57 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | fancyhdr – Extensive control of page headers and footers in LaTeX 2 | extramarks - Extra marks for LaTeX 3 | 4 | The package provides extensive facilities, both for constructing headers 5 | and footers, and for controlling their use (for example, at times when 6 | LaTeX would automatically change the heading style in use). 7 | 8 | This is version 5.2 of fancyhdr.sty and extramarks.sty. 9 | 10 | The distribution package from CTAN (e.g. fancyhdr.zip) 11 | consists of the following files: 12 | 13 | README This file 14 | fancyhdr.dtx The complete source of the package and documentation 15 | fancyhdr.ins The installation file; run through TeX to generate *.sty 16 | fancyhdr.pdf PDF of the documentation 17 | 18 | After processing (by tex) of fancyhdr.ins, the following package files will be generated: 19 | 20 | fancyhdr.sty v5.2 2025/02/07 the LaTeX package 21 | extramarks.sty v5.2 2025/02/07 a package for additional marks 22 | extramarks-v4.sty v4.5 2024/11/30 a legacy version of extramarks.sty 23 | fancyheadings.sty v4.1 2022/11/09 this loads fancyhdr with a warning message 24 | 25 | If you have a user distribution package from github (fancyhdr-dist-5.2.zip), 26 | then you don't have to do this processing. 27 | 28 | If you have a source distribution from github (fancyhdr-5.2.zip), 29 | it will also contain the .sty files, but not the .pdf file. 30 | To create fancyhdr.pdf, either just run the 'make' command, or: 31 | latexmk fancyhdr.dtx 32 | To recreate the .sty files run: 33 | tex fancyhdr.ins 34 | 35 | The package fancyheadings included here is an ancient version of fancyhdr. 36 | It should not be used anymore. It just loads fancyhdr with a warning message. 37 | 38 | The documentation (fancyhdr.dtx/fancyhdr.pdf) describes both 39 | fancyhdr.sty and extramarks.sty. 40 | In order to latex the documentation you need to have a copy of 41 | boxedminipage.sty (CTAN:/macros/latex/contrib/boxedminipage) and 42 | refcount.sty (CTAN:/macros/latex/contrib/oberdiek/) installed. 43 | 44 | The older versions fancyhdr.sty version 3 and extramarks.sty version 2 45 | are the packages as described in the second edition of The LaTeX 46 | Companion. That documentation can still be used for the newer 47 | versions, but some of the newer features will be missing. 48 | 49 | LICENCE: All files in this package may be distributed under the terms of 50 | the LaTeX Project Public License, as described in lppl.txt in the base 51 | LaTeX distribution. Either version 1.3 or, at your option, any later 52 | version. 53 | -- 54 | Pieter van Oostrum. 55 | 56 | http://pieter.vanoostrum.org/ 57 | -------------------------------------------------------------------------------- /extramarks.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `extramarks.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% fancyhdr.dtx (with options: `extramarks') 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% This file may be distributed and/or modified under the conditions of 12 | %% the LaTeX Project Public License, either version 1.3 of this license 13 | %% or (at your option) any later version. The latest version of this 14 | %% license is in: 15 | %% 16 | %% http://www.latex-project.org/lppl.txt 17 | %% 18 | %% and version 1.3 or later is part of all distributions of LaTeX version 19 | %% 2005/12/01 or later. 20 | %% 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | \NeedsTeXFormat{LaTeX2e}[2018-04-01] 23 | \ProvidesPackage{extramarks} 24 | [2025/02/07 v5.2 25 | Extra marks for LaTeX] 26 | % Copyright (C) 1994-2025 by Pieter van Oostrum 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | \DeclareRelease{v4}{2024/11/30}{extramarks-v4.sty} 29 | \DeclareCurrentRelease{v5}{2025/02/07} 30 | \@ifundefined{NewMarkClass} 31 | {\PackageWarningNoLine{extramarks}{% 32 | **************************************************\MessageBreak 33 | Your LaTeX installation is too old for extramarks version 5.\MessageBreak 34 | We will fallback to extramarks version 4 now.\MessageBreak 35 | Please note that some commands will not be available,\MessageBreak 36 | and that the functionality may be slightly different.\MessageBreak 37 | You are advised to update your LaTeX installation.\MessageBreak 38 | **************************************************} 39 | \RequirePackage{extramarks-v4}\endinput}{} 40 | \AtBeginDocument{% 41 | \IfPackageLoadedT{multicol}% 42 | {\IfPackageAtLeastF{multicol}{2024-11-21}{% 43 | \PackageWarningNoLine{extramarks}{% 44 | You are using package `extramarks' with a version\MessageBreak 45 | of `multicol' that is too old. The new version\MessageBreak 46 | of `multicol' will be released on June 1, 2025.\MessageBreak 47 | We will fallback to extramarks version 4 now.}% 48 | \let\extramarks\undefined 49 | \RequirePackage{extramarks-v4} 50 | }% 51 | }% 52 | } 53 | \ifx\@mkboth\@gobbletwo\else\def\@mkboth{\protect\markboth}\fi 54 | \NewMarkClass{extramarks-left} 55 | \NewMarkClass{extramarks-right} 56 | \newcommand\extramarks[2]{% 57 | \InsertMark{extramarks-left}{#1}% 58 | \InsertMark{extramarks-right}{#2}} 59 | \newcommand\extramarksleft[1]{% 60 | \InsertMark{extramarks-left}{#1}} 61 | \newcommand\extramarksright[1]{% 62 | \InsertMark{extramarks-right}{#1}} 63 | \newcommand\firstleftmark{\FirstMark{2e-left}} 64 | \newcommand\lastrightmark{\LastMark{2e-right}} 65 | \newcommand\firstrightmark{\rightmark} 66 | \let\firstrightmark \rightmark 67 | \newcommand\lastleftmark{\leftmark} 68 | \let\lastleftmark \leftmark 69 | \newcommand\firstleftxmark{\FirstMark{extramarks-left}} 70 | \newcommand\lastrightxmark{\LastMark{extramarks-right}} 71 | \newcommand\firstrightxmark{\FirstMark{extramarks-right}} 72 | \newcommand\topleftxmark{\TopMark{extramarks-left}} 73 | \newcommand\toprightxmark{\TopMark{extramarks-right}} 74 | \newcommand\lastleftxmark{\LastMark{extramarks-left}} 75 | \newcommand\firstxmark{\firstleftxmark} 76 | \let\firstxmark\firstleftxmark 77 | \newcommand\lastxmark{\lastrightxmark} 78 | \let\lastxmark\lastrightxmark 79 | \newcommand\topxmark{\topleftxmark} 80 | \let\topxmark\topleftxmark 81 | \endinput 82 | %% 83 | %% End of file `extramarks.sty'. 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fancyhdr/Extramarks version V5.x 2 | 3 | This is the ongoing development version of the fancyhdr package. 4 | It has been released as V5.x (for some x or x.y) 5 | 6 | The code has been through all the tests I have, so in that sense it can 7 | be considered reliable. But the release is quite young, so it hasn't 8 | been thoroughly tested ‘in the field’. 9 | 10 | New features in this version: 11 | 12 | - New command `\fancyfootalign` 13 | - New command `\fancyhdrbox` 14 | - New command `\fancypagestyleassign` 15 | - New commands `\fancyheadwidth`, `\fancyfootwidth` and `\fancyhfwidth` 16 | 17 | `\fancypagestyle` has a starred version: 18 | `\fancypagestyle*{newstyle}[basestyle]{definitions}` 19 | 20 | This works like the unstarred version, but it picks up all relevant 21 | fields/values from the point where it is defined. This includes: 22 | - The header and footer fields in all variants (EO,LRC,HF), total 12. 23 | - The header and footer field widths in all variants (EO,LRC,HF), total 12. 24 | - The header and footer offsets (EO,LR,HF), total 8. 25 | - The header and footer init values (2). 26 | - `\headrule`, `\headrulewidth`, `\footrule`, `\footrulewidth` 27 | - The value of the [nocheck] option 28 | 29 | `\fancyhdrsettoheight{lengthvar}{H-OR-F}` 30 | where H-OR-F is one of the values oddhead, evenhead, oddfoot, evenfoot. 31 | This calculates the height of the specifies header or footer with the 32 | current fancyhdr definitions and assigns the value to the lengthvar. 33 | This should be used after fancyhdr has been setup, and after `\begin{document}`, 34 | for example in `\AtBeginDocument`. It can for example be used to set `\headheight` 35 | or `\footskip` but also other variables. 36 | 37 | Example: 38 | ``` 39 | \AtBeginDocument{% 40 | \fancyhdrsettoheight{\headheight}{oddhead} 41 | } 42 | ``` 43 | In this way `\headheigth` is set to a value that prevents fancyhdrs's warning messages. 44 | If the odd and the even header have different heights, the tallest one should 45 | be used in the example above. Or the maximum should be calculated. 46 | 47 | ## Extramarks.sty 48 | 49 | This implementation of extramarks.sty is completely new. It has independent marks and some new commands. The old version is in extramarks-v4.sty. See the documentation for more details. 50 | 51 | The marks in the original extramarks package are tied to the normal marks 52 | and to each other; they are not independent. This may cause unwanted effects 53 | and therefore certain problems, like really independent marks for 54 | sections and subsections, are not possible with extramarks. 55 | On the other hand, the marks in the new version are really independent, and can 56 | be set separately. Also they don't influence each other. See below for an example. 57 | 58 | There are also new commands: 59 | 60 | ``` 61 | \extramarksleft{Some text} 62 | \extramarksright{Some text} 63 | ``` 64 | 65 | These set the marks, independently. In fact the \extramarks command is redefined 66 | to call these, `\extramarksleft` with its first argument, and `\extramarksright` 67 | with the second one. 68 | 69 | This implementation uses the new marks mechanism in the LaTeX kernel. See The LaTeX Companion, Third edition, pp. 390 ff. 70 | 71 | In fact, with this new mechanism, extramarks.sty isn't that useful anymore, just for legacy use. For new documents it is recommended to use the new LaTeX marks directly. 72 | 73 | The predefined marks are called 'extramarks-left' and 'extramarks-right', and the new commands 74 | `\extramarksleft` and `\extramarksright` are just shorthands for 75 | `\InsertMark{extramarks-left}` and `\InsertMark{extramarks-right}`. 76 | 77 | ``` 78 | \firstleftxmark 79 | \firstrightxmark 80 | \topleftxmark 81 | \toprightxmark 82 | \lastleftxmark 83 | \lastrightxmark 84 | \firstleftmark 85 | \lastrightmark 86 | ``` 87 | 88 | These are the same commands as in the original version, but with the new implementation. 89 | 90 | Example: we want to have the first section title of a page in the left header, 91 | and the first subsection title in the right header: 92 | 93 | ``` 94 | \usepackage{fancyhdr} 95 | \usepackage{extramarks} 96 | 97 | \pagestyle{fancy} 98 | \fancyhead[L]{\firstleftxmark} % section 99 | \fancyhead[R]{\firstrightxmark} % subsection 100 | 101 | \renewcommand{\sectionmark}[1]{% 102 | \extramarksleft{\thesection. #1}% 103 | } 104 | \renewcommand{\subsectionmark}[1]{% 105 | \extramarksright{\thesubsection. #1}% 106 | } 107 | ``` 108 | -------------------------------------------------------------------------------- /extramarks-v4.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `extramarks-v4.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% fancyhdr.dtx (with options: `extramarks-v4') 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% This file may be distributed and/or modified under the conditions of 12 | %% the LaTeX Project Public License, either version 1.3 of this license 13 | %% or (at your option) any later version. The latest version of this 14 | %% license is in: 15 | %% 16 | %% http://www.latex-project.org/lppl.txt 17 | %% 18 | %% and version 1.3 or later is part of all distributions of LaTeX version 19 | %% 2005/12/01 or later. 20 | %% 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | \NeedsTeXFormat{LaTeX2e}[2018-04-01] 23 | \ProvidesPackage{extramarks} 24 | [2024/11/30 v4.5 25 | Legacy version of extramarks for LaTeX] 26 | % Copyright (C) 1994-2024 by Pieter van Oostrum 27 | %% 28 | %% This is a legacy version (v4) of extramarks.sty 29 | %% 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | \ifx\@temptokenb\undefined \csname newtoks\endcsname\@temptokenb\fi 32 | \providecommand\unrestored@protected@xdef{% 33 | \let\protect\@unexpandable@protect \xdef} 34 | \ifdefined\ExplSyntaxOn 35 | \ExplSyntaxOn 36 | \DeclareRobustCommand*\markboth[2]{% 37 | \begingroup 38 | \let\label\relax \let\index\relax \let\glossary\relax 39 | \expandafter\@markboth\@themark{#1}{#2}% 40 | \@temptokena \expandafter{\@themark}% 41 | \ifdefined\mark_insert:nn 42 | % 3 new lines to set the new marks 43 | \mark_insert:nn{2e-left}{#1} 44 | \mark_insert:nn{2e-right}{#2} 45 | \tl_if_empty:nF{#2}{ \mark_insert:nn{2e-right-nonempty}{#2} } 46 | \fi 47 | \mark{\the\@temptokena}% 48 | \endgroup 49 | \if@nobreak\ifvmode\nobreak\fi\fi} 50 | \ExplSyntaxOff 51 | \else 52 | \def\markboth#1#2{% 53 | \begingroup 54 | \let\label\relax \let\index\relax \let\glossary\relax 55 | \expandafter\@markboth\@themark{#1}{#2}% 56 | \@temptokena \expandafter{\@themark}% 57 | \mark{\the\@temptokena}% 58 | \endgroup 59 | \if@nobreak\ifvmode\nobreak\fi\fi} 60 | \fi 61 | \ifx\@mkboth\@gobbletwo\else\def\@mkboth{\protect\markboth}\fi 62 | \def\@markboth#1#2#3#4#5#6{\@temptokena{{#3}{#4}}% 63 | \unrestored@protected@xdef\@themark{{#5}{#6}\the\@temptokena}} 64 | \def\@markright#1#2#3#4#5{\@temptokena{#1}\@temptokenb{{#3}{#4}}% 65 | \unrestored@protected@xdef\@themark{{\the\@temptokena}{#5}\the\@temptokenb}} 66 | 67 | \def\@leftmark#1#2#3#4{#1} 68 | \def\@rightmark#1#2#3#4{#2} 69 | \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} 70 | \IfFormatAtLeastTF{2025-06-01}{}{% 71 | \def\leftmark{\expandafter\@leftmark 72 | \botmark\@empty\@empty\@empty\@empty} 73 | \def\rightmark{\expandafter\@rightmark 74 | \firstmark\@empty\@empty\@empty\@empty} 75 | } 76 | \def\firstleftmark{\expandafter\@leftmark 77 | \firstmark\@empty\@empty\@empty\@empty} 78 | \def\lastrightmark{\expandafter\@rightmark 79 | \botmark\@empty\@empty\@empty\@empty} 80 | \let\firstrightmark \rightmark 81 | \let\lastleftmark \leftmark 82 | 83 | \def\@themark{{}{}{}{}} 84 | 85 | \newcommand\extramarks[2]{% 86 | \begingroup 87 | \let\label\relax \let\index\relax \let\glossary\relax 88 | \expandafter\@markextra\@themark{#1}{#2}% 89 | \@temptokena \expandafter{\@themark}% 90 | \mark{\the\@temptokena}% 91 | \endgroup 92 | \if@nobreak\ifvmode\nobreak\fi\fi} 93 | \def\@markextra#1#2#3#4#5#6{\@temptokena {{#1}{#2}}% 94 | \unrestored@protected@xdef\@themark{\the\@temptokena{#5}{#6}}} 95 | \def\extramarksleft#1{% 96 | \begingroup 97 | \let\label\relax \let\index\relax \let\glossary\relax 98 | \expandafter\@markextraleft\@themark{#1}% 99 | \@temptokena \expandafter{\@themark}% 100 | \mark{\the\@temptokena}% 101 | \endgroup 102 | \if@nobreak\ifvmode\nobreak\fi\fi} 103 | \def\@markextraleft#1#2#3#4#5{\@temptokena {{#1}{#2}}% 104 | \@temptokenb {{#4}}% 105 | \unrestored@protected@xdef\@themark{\the\@temptokena{#5}\the\@temptokenb}} 106 | \def\extramarksright#1{% 107 | \begingroup 108 | \let\label\relax \let\index\relax \let\glossary\relax 109 | \expandafter\@markextraright\@themark{#1}% 110 | \@temptokena \expandafter{\@themark}% 111 | \mark{\the\@temptokena}% 112 | \endgroup 113 | \if@nobreak\ifvmode\nobreak\fi\fi} 114 | \def\@markextraright#1#2#3#4#5{\@temptokena {{#1}{#2}{#3}}% 115 | \unrestored@protected@xdef\@themark{\the\@temptokena{#5}}} 116 | \def\firstleftxmark{\expandafter\@leftxmark 117 | \firstmark\@empty\@empty\@empty\@empty} 118 | \def\firstrightxmark{\expandafter\@rightxmark 119 | \firstmark\@empty\@empty\@empty\@empty} 120 | \def\topleftxmark{\expandafter\@leftxmark 121 | \topmark\@empty\@empty\@empty\@empty} 122 | \def\toprightxmark{\expandafter\@rightxmark 123 | \topmark\@empty\@empty\@empty\@empty} 124 | \def\lastleftxmark{\expandafter\@leftxmark 125 | \botmark\@empty\@empty\@empty\@empty} 126 | \def\lastrightxmark{\expandafter\@rightxmark 127 | \botmark\@empty\@empty\@empty\@empty} 128 | \let\firstxmark\firstleftxmark 129 | \let\lastxmark\lastrightxmark 130 | \let\topxmark\topleftxmark 131 | \def\@leftxmark#1#2#3#4{#3} 132 | \def\@rightxmark#1#2#3#4{#4} 133 | \endinput 134 | %% 135 | %% End of file `extramarks-v4.sty'. 136 | -------------------------------------------------------------------------------- /fancyhdr.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `fancyhdr.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% fancyhdr.dtx (with options: `fancyhdr') 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% This file may be distributed and/or modified under the conditions of 12 | %% the LaTeX Project Public License, either version 1.3 of this license 13 | %% or (at your option) any later version. The latest version of this 14 | %% license is in: 15 | %% 16 | %% http://www.latex-project.org/lppl.txt 17 | %% 18 | %% and version 1.3 or later is part of all distributions of LaTeX version 19 | %% 2005/12/01 or later. 20 | %% 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | \NeedsTeXFormat{LaTeX2e}[2018-04-01] 23 | \ProvidesPackage{fancyhdr}% 24 | [2025/02/07 v5.2 25 | Extensive control of page headers and footers]% 26 | % Copyright (C) 1994-2025 by Pieter van Oostrum 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | \ifdefined\NewDocumentCommand\else\RequirePackage{xparse}\fi 29 | \newif\iff@nch@check 30 | \f@nch@checktrue 31 | \DeclareOption{nocheck}{% 32 | \f@nch@checkfalse 33 | } 34 | \let\f@nch@gbl\relax 35 | \newif\iff@nch@compatViii 36 | \DeclareOption{compatV3}{% 37 | \PackageWarningNoLine{fancyhdr}{The `compatV3' option is deprecated.\MessageBreak 38 | It will disappear in one of the following releases.\MessageBreak 39 | Please change your document to work\MessageBreak 40 | without this option} 41 | \let\f@nch@gbl\global 42 | \f@nch@compatViiitrue 43 | } 44 | \newif\iff@nch@twoside 45 | \f@nch@twosidefalse 46 | \DeclareOption{twoside}{% 47 | \if@twoside\else\f@nch@twosidetrue\fi 48 | } 49 | \newcommand\f@nch@def[2]{% 50 | \def\temp@a{#2}\ifx\temp@a\@empty\f@nch@gbl\def#1{}% 51 | \else\f@nch@gbl\def#1{#2\strut}\fi} 52 | \DeclareOption{myheadings}{% 53 | \@ifundefined{chapter}{% 54 | \def\ps@myheadings{\ps@f@nch@fancyproto \let\@mkboth\@gobbletwo 55 | \fancyhf{} 56 | \fancyhead[LE,RO]{\thepage}% 57 | \fancyhead[RE]{\slshape\leftmark}% 58 | \fancyhead[LO]{\slshape\rightmark}% 59 | \let\sectionmark\@gobble 60 | \let\subsectionmark\@gobble 61 | }% 62 | }% 63 | {\def\ps@myheadings{\ps@f@nch@fancyproto \let\@mkboth\@gobbletwo 64 | \fancyhf{} 65 | \fancyhead[LE,RO]{\thepage}% 66 | \fancyhead[RE]{\slshape\leftmark}% 67 | \fancyhead[LO]{\slshape\rightmark}% 68 | \let\chaptermark\@gobble 69 | \let\sectionmark\@gobble 70 | }% 71 | }% 72 | } 73 | \DeclareOption{headings}{% 74 | \@ifundefined{chapter}{% 75 | \if@twoside 76 | \def\ps@headings{\ps@f@nch@fancyproto \def\@mkboth{\protect\markboth} 77 | \fancyhf{} 78 | \fancyhead[LE,RO]{\thepage}% 79 | \fancyhead[RE]{\slshape\leftmark}% 80 | \fancyhead[LO]{\slshape\rightmark}% 81 | \def\sectionmark##1{% 82 | \markboth{\MakeUppercase{% 83 | \ifnum \c@secnumdepth >\z@ \thesection\quad \fi##1}}{}}% 84 | \def\subsectionmark##1{% 85 | \markright{% 86 | \ifnum \c@secnumdepth >\@ne \thesubsection\quad \fi##1}}% 87 | }% 88 | \else 89 | \def\ps@headings{\ps@f@nch@fancyproto \def\@mkboth{\protect\markboth} 90 | \fancyhf{} 91 | \fancyhead[LE,RO]{\thepage}% 92 | \fancyhead[RE]{\slshape\leftmark}% 93 | \fancyhead[LO]{\slshape\rightmark}% 94 | \def\sectionmark##1{% 95 | \markright {\MakeUppercase{% 96 | \ifnum \c@secnumdepth >\z@ \thesection\quad \fi##1}}}% 97 | \let\subsectionmark\@gobble % Not needed but inserted for safety 98 | }% 99 | \fi 100 | }{\if@twoside 101 | \def\ps@headings{\ps@f@nch@fancyproto \def\@mkboth{\protect\markboth} 102 | \fancyhf{} 103 | \fancyhead[LE,RO]{\thepage}% 104 | \fancyhead[RE]{\slshape\leftmark}% 105 | \fancyhead[LO]{\slshape\rightmark}% 106 | \def\chaptermark##1{% 107 | \markboth{\MakeUppercase{% 108 | \ifnum \c@secnumdepth >\m@ne \if@mainmatter 109 | \@chapapp\ \thechapter. \ \fi\fi##1}}{}}% 110 | \def\sectionmark##1{% 111 | \markright {\MakeUppercase{% 112 | \ifnum \c@secnumdepth >\z@ \thesection. \ \fi##1}}}% 113 | }% 114 | \else 115 | \def\ps@headings{\ps@f@nch@fancyproto \def\@mkboth{\protect\markboth} 116 | \fancyhf{} 117 | \fancyhead[LE,RO]{\thepage}% 118 | \fancyhead[RE]{\slshape\leftmark}% 119 | \fancyhead[LO]{\slshape\rightmark}% 120 | \def\chaptermark##1{% 121 | \markright{\MakeUppercase{% 122 | \ifnum \c@secnumdepth >\m@ne \if@mainmatter 123 | \@chapapp\ \thechapter. \ \fi\fi##1}}}% 124 | \let\sectionmark\@gobble % Not needed but inserted for safety 125 | }% 126 | \fi 127 | }% 128 | } 129 | \ProcessOptions* 130 | \newcommand{\f@nch@forc}[3]{\expandafter\f@nchf@rc\expandafter#1\expandafter{#2}{#3}} 131 | \newcommand{\f@nchf@rc}[3]{\def\temp@ty{#2}\ifx\@empty\temp@ty\else 132 | \f@nch@rc#1#2\f@nch@rc{#3}\fi} 133 | \long\def\f@nch@rc#1#2#3\f@nch@rc#4{\def#1{#2}#4\f@nchf@rc#1{#3}{#4}} 134 | \newcommand{\f@nch@for}[3]{\edef\@fortmp{#2}% 135 | \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}} 136 | \newcommand\f@nch@default[3]{% 137 | \edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a \def#1{}% 138 | \f@nch@forc\tmpf@ra{#2}% 139 | {\expandafter\f@nch@ifin\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}% 140 | \ifx\@empty#1\def#1{#2}\fi} 141 | \newcommand{\f@nch@ifin}[4]{% 142 | \edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}% 143 | \expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi} 144 | \newcommand{\fancyhead}[2][]{\f@nch@fancyhf\fancyhead h[#1]{#2}}% 145 | \newcommand{\fancyfoot}[2][]{\f@nch@fancyhf\fancyfoot f[#1]{#2}}% 146 | \newcommand{\fancyhf}[2][]{\f@nch@fancyhf\fancyhf {}[#1]{#2}}% 147 | \newcommand{\fancyheadoffset}[2][]{\f@nch@fancyhfoffs\fancyheadoffset h[#1]{#2}}% 148 | \newcommand{\fancyfootoffset}[2][]{\f@nch@fancyhfoffs\fancyfootoffset f[#1]{#2}}% 149 | \newcommand{\fancyhfoffset}[2][]{\f@nch@fancyhfoffs\fancyhfoffset {}[#1]{#2}}% 150 | \def\f@nch@fancyhf@Echeck#1{% 151 | \if@twoside\else 152 | \iff@nch@twoside\else 153 | \if\f@nch@@eo e% 154 | \PackageWarning{fancyhdr} {\string#1's `E' option without twoside option is useless.\MessageBreak 155 | Please consider using the `twoside' option}% 156 | \fi\fi\fi 157 | } 158 | \long\def\f@nch@fancyhf#1#2[#3]#4{% 159 | \def\temp@c{}% 160 | \f@nch@forc\tmpf@ra{#3}% 161 | {\expandafter\f@nch@ifin\tmpf@ra{eolcrhf,EOLCRHF}% 162 | {}{\edef\temp@c{\temp@c\tmpf@ra}}}% 163 | \ifx\@empty\temp@c\else \PackageError{fancyhdr}{Illegal char `\temp@c' in 164 | \string#1 argument: [#3]}{}% 165 | \fi \f@nch@for\temp@c{#3}% 166 | {\f@nch@default\f@nch@@eo{eo}\temp@c 167 | \f@nch@fancyhf@Echeck{#1}% 168 | \f@nch@default\f@nch@@lcr{lcr}\temp@c 169 | \f@nch@default\f@nch@@hf{hf}{#2\temp@c}% 170 | \f@nch@forc\f@nch@eo\f@nch@@eo 171 | {\f@nch@forc\f@nch@lcr\f@nch@@lcr 172 | {\f@nch@forc\f@nch@hf\f@nch@@hf 173 | {\expandafter\f@nch@def\csname 174 | f@nch@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname {#4}}}}}} 175 | \def\f@nch@fancyhfoffs#1#2[#3]#4{% 176 | \def\temp@c{}% 177 | \f@nch@forc\tmpf@ra{#3}% 178 | {\expandafter\f@nch@ifin\tmpf@ra{eolrhf,EOLRHF}% 179 | {}{\edef\temp@c{\temp@c\tmpf@ra}}}% 180 | \ifx\@empty\temp@c\else \PackageError{fancyhdr}{Illegal char `\temp@c' in 181 | \string#1 argument: [#3]}{}% 182 | \fi \f@nch@for\temp@c{#3}% 183 | {\f@nch@default\f@nch@@eo{eo}\temp@c 184 | \f@nch@fancyhf@Echeck{#1}% 185 | \f@nch@default\f@nch@@lcr{lr}\temp@c 186 | \f@nch@default\f@nch@@hf{hf}{#2\temp@c}% 187 | \f@nch@forc\f@nch@eo\f@nch@@eo 188 | {\f@nch@forc\f@nch@lcr\f@nch@@lcr 189 | {\f@nch@forc\f@nch@hf\f@nch@@hf 190 | {\expandafter\setlength\csname 191 | f@nch@offset@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname {#4}}}}}% 192 | \f@nch@setoffs} 193 | \NewDocumentCommand {\fancyheadwidth}{ s O{} O{} m } 194 | {\f@nch@fancyhfwidth{#1}\fancyheadwidth h[#2][#3]{#4}}% 195 | \NewDocumentCommand {\fancyfootwidth}{ s O{} O{} m } 196 | {\f@nch@fancyhfwidth{#1}\fancyfootwidth f[#2][#3]{#4}}% 197 | \NewDocumentCommand {\fancyhfwidth} { s O{} O{} m } 198 | {\f@nch@fancyhfwidth{#1}\fancyhfwidth {}[#2][#3]{#4}}% 199 | \def\f@nch@fancyhfwidth#1#2#3[#4][#5]#6{% 200 | \setlength\@tempdima{#6}% 201 | \def\temp@c{}% 202 | \f@nch@forc\tmpf@ra{#4}% 203 | {\expandafter\f@nch@ifin\tmpf@ra{eolcrhf,EOLCRHF}% 204 | {}{\edef\temp@c{\temp@c\tmpf@ra}}}% 205 | \ifx\@empty\temp@c\else \PackageError{fancyhdr}{Illegal char `\temp@c' in 206 | \string#2 argument: [#4]}{}% 207 | \fi 208 | \f@nch@for\temp@c{#4}% 209 | {\f@nch@default\f@nch@@eo{eo}\temp@c 210 | \f@nch@fancyhf@Echeck{#2}% 211 | \f@nch@default\f@nch@@lcr{lcr}\temp@c 212 | \f@nch@default\f@nch@@hf{hf}{#3\temp@c}% 213 | \f@nch@forc\f@nch@eo\f@nch@@eo 214 | {\f@nch@forc\f@nch@lcr\f@nch@@lcr 215 | {\f@nch@forc\f@nch@hf\f@nch@@hf 216 | {% 217 | \IfBooleanTF{#1}{% 218 | \expandafter\edef\csname 219 | f@nch@width@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname{\the\@tempdima}% 220 | }% 221 | {% 222 | \expandafter\def\csname 223 | f@nch@width@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname{#6}% 224 | }% 225 | \csname f@nchdrwdt@align@v@\f@nch@hf\endcsname 226 | \edef\f@nch@align@@h{\f@nch@lcr}% 227 | \def\temp@a{#5}% 228 | \ifx\temp@a\@empty \else \f@nchdrwdt@align#5\@nil{#2}\fi 229 | \expandafter\edef\csname 230 | f@nch@align@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname 231 | {\f@nch@align@@v\f@nch@align@@h}}}}}} 232 | \def\f@nch@width@elh{\headwidth} 233 | \def\f@nch@width@ech{\headwidth} 234 | \def\f@nch@width@erh{\headwidth} 235 | \def\f@nch@width@olh{\headwidth} 236 | \def\f@nch@width@och{\headwidth} 237 | \def\f@nch@width@orh{\headwidth} 238 | \def\f@nch@width@elf{\headwidth} 239 | \def\f@nch@width@ecf{\headwidth} 240 | \def\f@nch@width@erf{\headwidth} 241 | \def\f@nch@width@olf{\headwidth} 242 | \def\f@nch@width@ocf{\headwidth} 243 | \def\f@nch@width@orf{\headwidth} 244 | \def\f@nch@align@elh{bl} 245 | \def\f@nch@align@ech{bc} 246 | \def\f@nch@align@erh{br} 247 | \def\f@nch@align@olh{bl} 248 | \def\f@nch@align@och{bc} 249 | \def\f@nch@align@orh{br} 250 | \def\f@nch@align@elf{tl} 251 | \def\f@nch@align@ecf{tc} 252 | \def\f@nch@align@erf{tr} 253 | \def\f@nch@align@olf{tl} 254 | \def\f@nch@align@ocf{tc} 255 | \def\f@nch@align@orf{tr} 256 | \def\f@nchdrwdt@align@v@h{\def\f@nch@align@@v{b}}% 257 | \def\f@nchdrwdt@align@v@f{\def\f@nch@align@@v{t}}% 258 | \long\def\f@nchdrwdt@align#1#2\@nil#3{% 259 | \f@nch@ifin{#1}{TtcbB-}{% 260 | \f@nch@ifin{#1}{-}{}{\def\f@nch@align@@v{#1}}% 261 | \def\@tempa{#2}% 262 | \ifx\@tempa\@empty \else \def\f@nch@align@@h{#2}\fi 263 | }% 264 | {\def\f@nch@align@@h{#1}}% 265 | \expandafter\f@nch@ifin\expandafter{\f@nch@align@@h}{lcrj}{}% 266 | {\PackageError{fancyhdr} 267 | {\string#3: Illegal char `\f@nch@align@@h'\MessageBreak 268 | in alignment argument}{}}% 269 | } 270 | \newcommand{\lhead}[2][\f@nch@olh]% 271 | {\f@nch@def\f@nch@olh{#2}\f@nch@def\f@nch@elh{#1}} 272 | \newcommand{\chead}[2][\f@nch@och]% 273 | {\f@nch@def\f@nch@och{#2}\f@nch@def\f@nch@ech{#1}} 274 | \newcommand{\rhead}[2][\f@nch@orh]% 275 | {\f@nch@def\f@nch@orh{#2}\f@nch@def\f@nch@erh{#1}} 276 | \newcommand{\lfoot}[2][\f@nch@olf]% 277 | {\f@nch@def\f@nch@olf{#2}\f@nch@def\f@nch@elf{#1}} 278 | \newcommand{\cfoot}[2][\f@nch@ocf]% 279 | {\f@nch@def\f@nch@ocf{#2}\f@nch@def\f@nch@ecf{#1}} 280 | \newcommand{\rfoot}[2][\f@nch@orf]% 281 | {\f@nch@def\f@nch@orf{#2}\f@nch@def\f@nch@erf{#1}} 282 | \newlength{\f@nch@headwidth} \let\headwidth\f@nch@headwidth 283 | \newlength{\f@nch@offset@elh} 284 | \newlength{\f@nch@offset@erh} 285 | \newlength{\f@nch@offset@olh} 286 | \newlength{\f@nch@offset@orh} 287 | \newlength{\f@nch@offset@elf} 288 | \newlength{\f@nch@offset@erf} 289 | \newlength{\f@nch@offset@olf} 290 | \newlength{\f@nch@offset@orf} 291 | \newcommand{\headrulewidth}{0.4pt} 292 | \newcommand{\footrulewidth}{0pt} 293 | \@ifundefined{headruleskip}% 294 | {\newcommand{\headruleskip}{0pt}}{} 295 | \@ifundefined{footruleskip}% 296 | {\newcommand{\footruleskip}{.3\normalbaselineskip}}{} 297 | \newcommand{\plainheadrulewidth}{0pt} 298 | \newcommand{\plainfootrulewidth}{0pt} 299 | \newif\if@fancyplain \@fancyplainfalse 300 | \def\fancyplain#1#2{\if@fancyplain#1\else#2\fi} 301 | \headwidth=-123456789sp 302 | \let\f@nch@raggedleft\raggedleft 303 | \let\f@nch@raggedright\raggedright 304 | \let\f@nch@centering\centering 305 | \let\f@nch@everypar\everypar 306 | \ifdefined\ExplSyntaxOn 307 | \ExplSyntaxOn 308 | \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} 309 | \IfFormatAtLeastTF{2021-06-01}{ 310 | \def\f@nch@saveclr@parhook #1{ 311 | \expandafter\let\csname f@nch@__hook~#1\expandafter\endcsname 312 | \csname __hook~#1\endcsname 313 | \expandafter\let\csname f@nch@__hook_toplevel~#1\expandafter\endcsname 314 | \csname __hook_toplevel~#1\endcsname 315 | \expandafter\let\csname f@nch@__hook_next~#1\expandafter\endcsname 316 | \csname __hook_next~#1\endcsname 317 | \expandafter\let\csname f@nch@g__hook_#1_code_prop\expandafter\endcsname 318 | \csname g__hook_#1_code_prop\endcsname 319 | \RemoveFromHook{#1}[*] 320 | \ClearHookNext{#1} 321 | } 322 | \def\f@nch@restore@parhook #1{ 323 | \global\expandafter\let\csname __hook~#1\expandafter\endcsname 324 | \csname f@nch@__hook~#1\endcsname 325 | \global\expandafter\let\csname __hook_toplevel~#1\expandafter\endcsname 326 | \csname f@nch@__hook_toplevel~#1\endcsname 327 | \global\expandafter\let\csname __hook_next~#1\expandafter\endcsname 328 | \csname f@nch@__hook_next~#1\endcsname 329 | \global\expandafter\let\csname g__hook_#1_code_prop\expandafter\endcsname 330 | \csname f@nch@g__hook_#1_code_prop\endcsname 331 | } 332 | \def\f@nch@resetpar{ 333 | \f@nch@everypar{} 334 | \f@nch@saveclr@parhook{para/before} 335 | \f@nch@saveclr@parhook{para/begin} 336 | \f@nch@saveclr@parhook{para/end} 337 | \f@nch@saveclr@parhook{para/after} 338 | } 339 | \def\f@nch@restorepar{ 340 | \f@nch@restore@parhook{para/before} 341 | \f@nch@restore@parhook{para/begin} 342 | \f@nch@restore@parhook{para/end} 343 | \f@nch@restore@parhook{para/after} 344 | } 345 | }{ 346 | \def\f@nch@resetpar{ 347 | \f@nch@everypar{} 348 | } 349 | \def\f@nch@restorepar{} 350 | } 351 | \ExplSyntaxOff 352 | \else 353 | \def\f@nch@resetpar{% 354 | \f@nch@everypar{}% 355 | } 356 | \def\f@nch@restorepar{} 357 | \fi 358 | \newcommand\f@nch@noUppercase[2][]{#2} 359 | \def\f@nch@reset{\f@nch@resetpar\restorecr\endlinechar=13 360 | \catcode`\\=0\catcode`\{=1\catcode`\}=2\catcode`\$=3\catcode`\&=4 361 | \catcode`\#=6\catcode`\^=7\catcode`\_=8\catcode`\ =10\catcode`\@=11 362 | \catcode`\:=11\catcode`\~=13\catcode`\%=14 363 | \catcode0=15 %NULL 364 | \catcode9=10 %TAB 365 | \let\\\@normalcr \let\raggedleft\f@nch@raggedleft 366 | \let\raggedright\f@nch@raggedright \let\centering\f@nch@centering 367 | \def\baselinestretch{1}% 368 | \hsize=\headwidth 369 | \def\nouppercase##1{{% 370 | \let\uppercase\relax\let\MakeUppercase\f@nch@noUppercase 371 | \expandafter\let\csname MakeUppercase \endcsname\relax 372 | \expandafter\def\csname MakeUppercase\space\space\space\endcsname 373 | [####1]####2{####2}% 374 | ##1}}% 375 | \@ifundefined{@normalsize} {\normalsize} % for ucthesis.cls 376 | {\@normalsize}% 377 | } 378 | \newcommand*{\fancycenter}[1][1em]{% 379 | \@ifnextchar[{\f@nch@center{#1}}{\f@nch@center{#1}[3]}% 380 | } 381 | \def\f@nch@center#1[#2]#3#4#5{% 382 | \def\@tempa{#4}\ifx\@tempa\@empty 383 | \hbox to\linewidth{\color@begingroup{#3}\hfil {#5}\color@endgroup}% 384 | \else 385 | \setlength\@tempdima{#1}% 386 | \setlength{\@tempdimb}{#2\@tempdima}% 387 | \@tempdimc \@tempdimb \advance\@tempdimc -\@tempdima 388 | \setlength\@tempskipa{\@tempdimb \@plus 1fil \@minus \@tempdimc}% 389 | \@tempskipb\@tempskipa 390 | \def\@tempa{#3}\ifx\@tempa\@empty 391 | \addtolength\@tempskipa{\z@ \@minus \@tempdima}% 392 | \fi 393 | \def\@tempa{#5}\ifx\@tempa\@empty % empty right 394 | \addtolength\@tempskipb{\z@ \@minus \@tempdima}% 395 | \fi 396 | \settowidth{\@tempdimb}{#3}% 397 | \settowidth{\@tempdimc}{#5}% 398 | \ifdim\@tempdimb>\@tempdimc 399 | \advance\@tempdimb -\@tempdimc 400 | \addtolength\@tempskipb{\@tempdimb \@minus \@tempdimb}% 401 | \else 402 | \advance\@tempdimc -\@tempdimb 403 | \addtolength\@tempskipa{\@tempdimc \@minus \@tempdimc}% 404 | \fi 405 | \hbox to\linewidth{\color@begingroup{#3}\hskip \@tempskipa 406 | {#4}\hskip \@tempskipb {#5}\color@endgroup}% 407 | \fi 408 | } 409 | \newcommand{\f@nch@headinit}{} 410 | \newcommand{\fancyheadinit}[1]{% 411 | \def\f@nch@headinit{#1}% 412 | } 413 | \newcommand{\f@nch@footinit}{} 414 | \newcommand{\fancyfootinit}[1]{% 415 | \def\f@nch@footinit{#1}% 416 | } 417 | \newcommand{\fancyhfinit}[1]{% 418 | \def\f@nch@headinit{#1}% 419 | \def\f@nch@footinit{#1}% 420 | } 421 | \ifdefined\NewMirroredHookPair 422 | \NewMirroredHookPair{fancyhdr/before}{fancyhdr/after} 423 | \NewMirroredHookPair{fancyhdr/head/begin}{fancyhdr/head/end} 424 | \NewMirroredHookPair{fancyhdr/foot/begin}{fancyhdr/foot/end} 425 | \fi 426 | \newlength\f@nch@height 427 | \newlength\f@nch@footalignment 428 | \newif\iff@nch@footalign\f@nch@footalignfalse 429 | \newcommand{\fancyfootalign}[1]{% 430 | \def\temp@a{#1}% 431 | \ifx\temp@a\@empty 432 | \f@nch@footalignfalse 433 | \else 434 | \f@nch@footaligntrue 435 | \setlength\f@nch@footalignment{#1}% 436 | \fi 437 | } 438 | \newcommand\fancyhdrsettoheight[2]{% 439 | \expandafter\ifx\csname f@nch@#2\endcsname\fancyhdrsettoheight 440 | \else\PackageError{fancyhdr}{Unknown parameter #2 in \string\fancyhdrsettoheight}{}\fi 441 | \setbox\@tempboxa\hbox{{\f@nch@checkfalse\csname @#2\endcsname}}% 442 | \setlength{#1}\f@nch@height 443 | \setbox\@tempboxa\box\voidb@x 444 | } 445 | \let\f@nch@oddhead\fancyhdrsettoheight 446 | \let\f@nch@evenhead\fancyhdrsettoheight 447 | \let\f@nch@oddfoot\fancyhdrsettoheight 448 | \let\f@nch@evenfoot\fancyhdrsettoheight 449 | \newcommand\f@nch@vbox[2]{% 450 | \setbox0\vbox{#2}% 451 | \global\f@nch@height=\ht0 452 | \ifdim\ht0>#1\relax 453 | \iff@nch@check 454 | \dimen0=#1\advance\dimen0-\ht0 455 | \PackageWarning{fancyhdr}{% 456 | \string#1 is too small (\the#1): \MessageBreak 457 | Make it at least \the\ht0, for example:\MessageBreak 458 | \string\setlength{\string#1}{\the\ht0}% 459 | \iff@nch@compatViii .\MessageBreak 460 | We now make it that large for the rest of the document.\MessageBreak 461 | This may cause the page layout to be inconsistent, however 462 | \fi 463 | \ifx#1\headheight .\MessageBreak 464 | You might also make \topmargin smaller:\MessageBreak 465 | \string\addtolength{\string\topmargin}{\the\dimen0}% 466 | \fi 467 | \@gobble 468 | }% 469 | \iff@nch@compatViii 470 | \dimen0=#1\relax 471 | \global#1=\ht0\relax 472 | \ht0=\dimen0 % 473 | \else 474 | \ht0=#1\relax 475 | \fi 476 | \else 477 | \ht0=#1\relax 478 | \fi 479 | \fi 480 | \box0} 481 | \newcommand\f@nch@head[6]{% 482 | \f@nch@reset 483 | \ifdefined\UseHook\UseHook{fancyhdr/before}\UseHook{fancyhdr/head/begin}\fi 484 | \f@nch@headinit\relax 485 | #1% 486 | \hbox to\headwidth{% 487 | \f@nch@vbox\headheight{% 488 | \f@nch@hfbox{#2}{#3}{#4}{#6}{h}% 489 | \vskip\headruleskip\relax 490 | \headrule 491 | }% 492 | }% 493 | #5% 494 | \ifdefined\UseHook\UseHook{fancyhdr/head/end}\UseHook{fancyhdr/after}\fi 495 | \f@nch@restorepar 496 | } 497 | \newcommand\f@nch@foot[6]{% 498 | \f@nch@reset 499 | \ifdefined\UseHook\UseHook{fancyhdr/before}\UseHook{fancyhdr/foot/begin}\fi 500 | \f@nch@footinit\relax 501 | #1% 502 | \hbox to\headwidth{% 503 | \f@nch@vbox\footskip{% 504 | \setbox0=\vbox{\footrule}\unvbox0 505 | \vskip\footruleskip 506 | \f@nch@hfbox{#2}{#3}{#4}{#6}{f}% 507 | \iff@nch@footalign \vskip\f@nch@footalignment \fi 508 | }% 509 | }% 510 | #5% 511 | \ifdefined\UseHook\UseHook{fancyhdr/foot/end}\UseHook{fancyhdr/after}\fi 512 | \f@nch@restorepar 513 | } 514 | \newlength\f@nch@widthL 515 | \newlength\f@nch@widthC 516 | \newlength\f@nch@widthR 517 | \newcommand\f@nch@hfbox[5]{% 518 | \setlength\f@nch@widthL{\csname f@nch@width@#4l#5\endcsname}% 519 | \setlength\f@nch@widthC{\csname f@nch@width@#4c#5\endcsname}% 520 | \setlength\f@nch@widthR{\csname f@nch@width@#4r#5\endcsname}% 521 | \let\@tempa\f@nch@hfbox@center 522 | \ifdim \dimexpr \f@nch@widthL+\f@nch@widthC+\f@nch@widthR>\headwidth 523 | \else 524 | \ifdim \dimexpr \f@nch@widthL+0.5\f@nch@widthC>0.5\headwidth 525 | \let \@tempa\f@nch@hfbox@fit 526 | \fi 527 | \ifdim \dimexpr \f@nch@widthR+0.5\f@nch@widthC>0.5\headwidth 528 | \let \@tempa\f@nch@hfbox@fit 529 | \fi 530 | \fi 531 | \@tempa{#1}{#2}{#3}#4#5% 532 | } 533 | \newcommand\f@nch@hfbox@center[5]{% 534 | \hbox to \headwidth{% 535 | \rlap{\f@nch@parbox{#1}\f@nch@widthL{#4}l{#5}}% 536 | \hfill 537 | \f@nch@parbox{#2}\f@nch@widthC{#4}c{#5}% 538 | \hfill 539 | \llap{\f@nch@parbox{#3}\f@nch@widthR{#4}r{#5}}% 540 | }% 541 | } 542 | \newcommand\f@nch@hfbox@fit[5]{% 543 | \hbox to \headwidth{% 544 | \f@nch@parbox{#1}\f@nch@widthL{#4}l{#5}% 545 | \hfill 546 | \f@nch@parbox{#2}\f@nch@widthC{#4}c{#5}% 547 | \hfill 548 | \f@nch@parbox{#3}\f@nch@widthR{#4}r{#5}% 549 | }% 550 | }% 551 | \newcommand\f@nch@parbox[5]{% 552 | \expandafter\expandafter\expandafter\f@nch@parbox@align 553 | \csname f@nch@align@#3#4#5\endcsname 554 | \parbox[\f@nch@align@@v]{#2}% 555 | {% 556 | \f@nch@align@@pre 557 | \f@nch@align@@h\leavevmode\ignorespaces#1% 558 | \f@nch@align@@post 559 | }% 560 | } 561 | \newcommand\f@nch@parbox@align[2]{% 562 | \def\f@nch@align@@pre{}% 563 | \def\f@nch@align@@post{}% 564 | \csname f@nch@parbox@align@v#1\endcsname 565 | \csname f@nch@parbox@align@h#2\endcsname 566 | } 567 | \def\f@nch@parbox@align@vT{\def\f@nch@align@@v{t}\def\f@nch@align@@pre{\vspace{0pt}}} 568 | \def\f@nch@parbox@align@vt{\def\f@nch@align@@v{t}} 569 | \def\f@nch@parbox@align@vc{\def\f@nch@align@@v{c}} 570 | \def\f@nch@parbox@align@vb{\def\f@nch@align@@v{b}} 571 | \def\f@nch@parbox@align@vB{\def\f@nch@align@@v{b}\def\f@nch@align@@post{\vspace{0pt}}} 572 | \def\f@nch@parbox@align@hl{\def\f@nch@align@@h{\raggedright}} 573 | \def\f@nch@parbox@align@hc{\def\f@nch@align@@h{\centering}} 574 | \def\f@nch@parbox@align@hr{\def\f@nch@align@@h{\raggedleft}} 575 | \def\f@nch@parbox@align@hj{\def\f@nch@align@@h{}} 576 | \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}% 577 | \def\f@nch@initialise{% 578 | \@ifundefined{chapter}% 579 | {\def\sectionmark##1{\markboth{\MakeUppercase{\ifnum \c@secnumdepth>\z@ 580 | \thesection\hskip 1em\relax 581 | \fi ##1}}{}}% 582 | \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne 583 | \thesubsection\hskip 1em\relax \fi ##1}}}% 584 | {\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum 585 | \c@secnumdepth>\m@ne \@chapapp\ \thechapter. \ \fi ##1}}{}}% 586 | \def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@ 587 | \thesection. \ \fi ##1}}}% 588 | }% 589 | \def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi 590 | \hrule\@height\headrulewidth\@width\headwidth 591 | \vskip-\headrulewidth}}% 592 | \def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi 593 | \hrule\@width\headwidth\@height\footrulewidth}}% 594 | \def\headrulewidth{0.4pt}% 595 | \def\footrulewidth{0pt}% 596 | \def\headruleskip{0pt}% 597 | \def\footruleskip{0.3\normalbaselineskip}% 598 | \fancyhf{}% 599 | \if@twoside 600 | \fancyhead[el,or]{\fancyplain{}{\slshape\rightmark}}% 601 | \fancyhead[er,ol]{\fancyplain{}{\slshape\leftmark}}% 602 | \else 603 | \fancyhead[l]{\fancyplain{}{\slshape\rightmark}}% 604 | \fancyhead[r]{\fancyplain{}{\slshape\leftmark}}% 605 | \fi 606 | \fancyfoot[c]{\rmfamily\thepage}% page number 607 | } 608 | \f@nch@initialise 609 | \def\ps@f@nch@fancyproto{% 610 | \ifdim\headwidth<0sp 611 | \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth 612 | \fi 613 | \gdef\ps@f@nch@fancyproto{\@fancyplainfalse\ps@f@nch@fancycore}% 614 | \@fancyplainfalse\ps@f@nch@fancycore 615 | }% 616 | \@namedef{f@nch@ps@f@nch@fancyproto-is-fancyhdr}{} 617 | \def\ps@fancy{\ps@f@nch@fancyproto} 618 | \@namedef{f@nch@ps@fancy-is-fancyhdr}{} 619 | \def\ps@fancyplain{\ps@f@nch@fancyproto \let\ps@plain\ps@plain@fancy} 620 | \def\ps@plain@fancy{\@fancyplaintrue\ps@f@nch@fancycore} 621 | \let\f@nch@ps@empty\ps@empty 622 | \def\ps@f@nch@fancycore{% 623 | \f@nch@ps@empty 624 | \def\@mkboth{\protect\markboth}% 625 | \def\f@nch@oddhead{\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh{o}}% 626 | \def\@oddhead{% 627 | \iff@nch@twoside 628 | \ifodd\c@page 629 | \f@nch@oddhead 630 | \else 631 | \@evenhead 632 | \fi 633 | \else 634 | \f@nch@oddhead 635 | \fi 636 | } 637 | \def\f@nch@oddfoot{\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf{o}}% 638 | \def\@oddfoot{% 639 | \iff@nch@twoside 640 | \ifodd\c@page 641 | \f@nch@oddfoot 642 | \else 643 | \@evenfoot 644 | \fi 645 | \else 646 | \f@nch@oddfoot 647 | \fi 648 | } 649 | \def\@evenhead{\f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh{e}}% 650 | \def\@evenfoot{\f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf{e}}% 651 | } 652 | \def\f@nch@Oolh{\if@reversemargin\hss\else\relax\fi} 653 | \def\f@nch@Oorh{\if@reversemargin\relax\else\hss\fi} 654 | \let\f@nch@Oelh\f@nch@Oorh 655 | \let\f@nch@Oerh\f@nch@Oolh 656 | \let\f@nch@Oolf\f@nch@Oolh 657 | \let\f@nch@Oorf\f@nch@Oorh 658 | \let\f@nch@Oelf\f@nch@Oelh 659 | \let\f@nch@Oerf\f@nch@Oerh 660 | \def\f@nch@offsolh{\headwidth=\textwidth\advance\headwidth\f@nch@offset@olh 661 | \advance\headwidth\f@nch@offset@orh\hskip-\f@nch@offset@olh} 662 | \def\f@nch@offselh{\headwidth=\textwidth\advance\headwidth\f@nch@offset@elh 663 | \advance\headwidth\f@nch@offset@erh\hskip-\f@nch@offset@elh} 664 | \def\f@nch@offsolf{\headwidth=\textwidth\advance\headwidth\f@nch@offset@olf 665 | \advance\headwidth\f@nch@offset@orf\hskip-\f@nch@offset@olf} 666 | \def\f@nch@offself{\headwidth=\textwidth\advance\headwidth\f@nch@offset@elf 667 | \advance\headwidth\f@nch@offset@erf\hskip-\f@nch@offset@elf} 668 | \def\f@nch@setoffs{% 669 | \f@nch@gbl\let\headwidth\f@nch@headwidth 670 | \f@nch@gbl\def\f@nch@Oolh{\f@nch@offsolh}% 671 | \f@nch@gbl\def\f@nch@Oelh{\f@nch@offselh}% 672 | \f@nch@gbl\def\f@nch@Oorh{\hss}% 673 | \f@nch@gbl\def\f@nch@Oerh{\hss}% 674 | \f@nch@gbl\def\f@nch@Oolf{\f@nch@offsolf}% 675 | \f@nch@gbl\def\f@nch@Oelf{\f@nch@offself}% 676 | \f@nch@gbl\def\f@nch@Oorf{\hss}% 677 | \f@nch@gbl\def\f@nch@Oerf{\hss}% 678 | } 679 | \newif\iff@nch@footnote 680 | \AtBeginDocument{% 681 | \let\latex@makecol\@makecol 682 | \def\@makecol{\ifvoid\footins\f@nch@footnotefalse\else\f@nch@footnotetrue\fi 683 | \let\f@nch@topfloat\@toplist\let\f@nch@botfloat\@botlist\latex@makecol}% 684 | } 685 | \newcommand\iftopfloat[2]{\ifx\f@nch@topfloat\@empty #2\else #1\fi}% 686 | \newcommand\ifbotfloat[2]{\ifx\f@nch@botfloat\@empty #2\else #1\fi}% 687 | \newcommand\iffloatpage[2]{\if@fcolmade #1\else #2\fi}% 688 | \newcommand\iffootnote[2]{\iff@nch@footnote #1\else #2\fi}% 689 | \ifx\@temptokenb\undefined \csname newtoks\endcsname\@temptokenb\fi 690 | \newif\iff@nch@pagestyle@star 691 | \newcommand\fancypagestyle{% 692 | \@ifstar{\f@nch@pagestyle@startrue\f@nch@pagestyle}% 693 | {\f@nch@pagestyle@starfalse\f@nch@pagestyle}% 694 | } 695 | \newcommand\f@nch@pagestyle[1]{% 696 | \@ifnextchar[{\f@nch@@pagestyle{#1}}{\f@nch@@pagestyle{#1}[f@nch@fancyproto]}% 697 | } 698 | \long\def\f@nch@@pagestyle#1[#2]#3{% 699 | \@ifundefined{ps@#2}{% 700 | \PackageError{fancyhdr}{\string\fancypagestyle: Unknown base page style `#2'}{}% 701 | }{% 702 | \@ifundefined{f@nch@ps@#2-is-fancyhdr}{% 703 | \PackageError{fancyhdr}{\string\fancypagestyle: Base page style `#2' is not fancyhdr-based}{}% 704 | }% 705 | {% 706 | \f@nch@pagestyle@setup 707 | \def\temp@b{\@namedef{ps@#1}}% 708 | \expandafter\temp@b\expandafter{\the\@temptokenb 709 | \let\f@nch@gbl\relax\@nameuse{ps@#2}#3\relax}% 710 | \@namedef{f@nch@ps@#1-is-fancyhdr}{}% 711 | }% 712 | }% 713 | } 714 | \newcommand\f@nch@pagestyle@setup{% 715 | \iff@nch@pagestyle@star 716 | \iff@nch@check\@temptokenb={\f@nch@checktrue}\else\@temptokenb={\f@nch@checkfalse}\fi 717 | \@tfor\temp@a:= 718 | \f@nch@olh\f@nch@och\f@nch@orh\f@nch@elh\f@nch@ech\f@nch@erh 719 | \f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@elf\f@nch@ecf\f@nch@erf 720 | \f@nch@width@elh\f@nch@width@ech\f@nch@width@erh\f@nch@width@olh 721 | \f@nch@width@och\f@nch@width@orh\f@nch@width@elf\f@nch@width@ecf 722 | \f@nch@width@erf\f@nch@width@olf\f@nch@width@ocf\f@nch@width@orf 723 | \f@nch@align@elh\f@nch@align@ech\f@nch@align@erh\f@nch@align@olh 724 | \f@nch@align@och\f@nch@align@orh\f@nch@align@elf\f@nch@align@ecf 725 | \f@nch@align@erf\f@nch@align@olf\f@nch@align@ocf\f@nch@align@orf 726 | \f@nch@Oolh\f@nch@Oorh\f@nch@Oelh\f@nch@Oerh 727 | \f@nch@Oolf\f@nch@Oorf\f@nch@Oelf\f@nch@Oerf 728 | \f@nch@headinit\f@nch@footinit 729 | \headrule\headrulewidth\footrule\footrulewidth 730 | \do {% 731 | \toks@=\expandafter\expandafter\expandafter{\temp@a}% 732 | \toks@=\expandafter\expandafter\expandafter{% 733 | \expandafter\expandafter\expandafter\def 734 | \expandafter\expandafter\temp@a\expandafter{\the\toks@}}% 735 | \edef\temp@b{\@temptokenb={\the\@temptokenb\the\toks@}}% 736 | \temp@b 737 | }% 738 | \@tfor\temp@a:= 739 | \f@nch@offset@olh\f@nch@offset@orh\f@nch@offset@elh\f@nch@offset@erh 740 | \f@nch@offset@olf\f@nch@offset@orf\f@nch@offset@elf\f@nch@offset@erf 741 | \do {% 742 | \toks@=\expandafter\expandafter\expandafter{\expandafter\the\temp@a}% 743 | \toks@=\expandafter\expandafter\expandafter{% 744 | \expandafter\expandafter\expandafter\setlength 745 | \expandafter\expandafter\temp@a\expandafter{\the\toks@}}% 746 | \edef\temp@b{\@temptokenb={\the\@temptokenb\the\toks@}}% 747 | \temp@b 748 | }% 749 | \else 750 | \@temptokenb={}% 751 | \fi 752 | } 753 | \newcommand\fancypagestyleassign[2]{% 754 | \@ifundefined{ps@#2}{% 755 | \PackageError{fancyhdr}{\string\fancypagestyleassign: Unknown page style `#2'}{}% 756 | }{% 757 | \expandafter\let 758 | \csname ps@#1\expandafter\endcsname 759 | \csname ps@#2\endcsname 760 | \@ifundefined{f@nch@ps@#2-is-fancyhdr}{% 761 | \expandafter\let\csname f@nch@ps@#1-is-fancyhdr\endcsname\@undefined 762 | }{% 763 | \@namedef{f@nch@ps@#1-is-fancyhdr}{}% 764 | }% 765 | }% 766 | } 767 | \fancypagestyle*{fancydefault}{\f@nch@initialise} 768 | \def\f@nchdrbox@topstrut{\vrule height\ht\strutbox width\z@} 769 | \def\f@nchdrbox@botstrut{\vrule depth\dp\strutbox width\z@} 770 | \def\f@nchdrbox@nostrut{\noalign{\vspace{0pt}}\let\f@nchdrbox@@crstrut\f@nchdrbox@botstrut} 771 | \NewDocumentCommand{\fancyhdrbox}{ O{cl} o m }{% 772 | \begingroup 773 | \let\f@nchdrbox@@pre\f@nchdrbox@topstrut 774 | \let\f@nchdrbox@@postx\f@nchdrbox@botstrut 775 | \let\f@nchdrbox@@posty\relax 776 | \let\f@nchdrbox@@crstrut\strut 777 | \IfNoValueTF{#2}% 778 | {\let\f@nchdrbox@@halignto\@empty}% 779 | {\setlength\@tempdima{#2}% 780 | \def\f@nchdrbox@@halignto{to\@tempdima}}% 781 | \def\@tempa{#1}% 782 | \ifx\@tempa\@empty 783 | \f@nchdrbox@align cl\@nil{#3}% 784 | \else 785 | \f@nchdrbox@align #1\@nil{#3}% 786 | \fi 787 | \endgroup 788 | } 789 | \protected\def\f@nchdrbox@cr{% 790 | {\ifnum0=`}\fi\@ifstar\@f@nchdrbox@xcr\@f@nchdrbox@xcr} 791 | 792 | \def\@f@nchdrbox@xcr{% 793 | \unskip\f@nchdrbox@@crstrut 794 | \@ifnextchar[\@f@nchdrbox@argc{\ifnum0=`{\fi}\cr}% 795 | } 796 | 797 | \def\@f@nchdrbox@argc[#1]{% 798 | \ifnum0=`{\fi}% 799 | \ifdim #1>\z@ 800 | \unskip\@f@nchdrbox@xargc{#1}% 801 | \else 802 | \@f@nchdrbox@yargc{#1}% 803 | \fi} 804 | 805 | \def\@f@nchdrbox@xargc#1{\@tempdima #1\advance\@tempdima \dp \strutbox 806 | \vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr} 807 | 808 | \def\@f@nchdrbox@yargc#1{\cr\noalign{\setlength\@tempdima{#1}\vskip\@tempdima}} 809 | \def\f@nchdrbox@T{\let\f@nchdrbox@@pre\f@nchdrbox@nostrut 810 | \f@nchdrbox@t} 811 | \def\f@nchdrbox@t{\def\f@nchdrbox@@v{t}\def\f@nchdrbox@@h{l}} 812 | \def\f@nchdrbox@c{\def\f@nchdrbox@@v{c}\def\f@nchdrbox@@h{c}} 813 | \def\f@nchdrbox@b{\def\f@nchdrbox@@v{b}\def\f@nchdrbox@@h{l}} 814 | \def\f@nchdrbox@B{\let\f@nchdrbox@@postx\relax 815 | \def\f@nchdrbox@@posty{\vspace{0pt}}% 816 | \f@nchdrbox@b} 817 | \long\def\f@nchdrbox@align#1#2\@nil#3{% 818 | \f@nch@ifin{#1}{TtcbB}{% 819 | \@nameuse{f@nchdrbox@#1}% 820 | \def\@tempa{#2}% 821 | \ifx\@tempa\@empty\else \def\f@nchdrbox@@h{#2}\fi 822 | }% 823 | {\def\f@nchdrbox@@v{c}\def\f@nchdrbox@@h{#1}}% 824 | \expandafter\f@nch@ifin\expandafter{\f@nchdrbox@@h}{lcr}{}% 825 | {\PackageError{fancyhdr}{\string\fancyhdrbox: Illegal char `\f@nchdrbox@@h'\MessageBreak 826 | in alignment argument}{}}% 827 | \let\\\f@nchdrbox@cr 828 | \setbox0=\if \f@nchdrbox@@v t\vtop 829 | \else \vbox 830 | \fi 831 | {% 832 | \ialign \f@nchdrbox@@halignto 833 | \bgroup \relax 834 | {\if \f@nchdrbox@@h l\hskip 1sp\else \hfil \fi 835 | \ignorespaces ##\unskip 836 | \if\f@nchdrbox@@h r\else \hfil \fi 837 | }% 838 | \tabskip\z@skip \cr 839 | \f@nchdrbox@@pre 840 | #3\unskip \f@nchdrbox@@postx 841 | \crcr 842 | \egroup 843 | \f@nchdrbox@@posty 844 | }% 845 | \if\f@nchdrbox@@v c\@tempdima=\ht0\advance\@tempdima\dp0% 846 | \ht0=0.5\@tempdima\dp0=0.5\@tempdima\fi 847 | \leavevmode \box0 848 | } 849 | \@ifclassloaded{newlfm} 850 | { 851 | \let\ps@@empty\f@nch@ps@empty 852 | \AtBeginDocument{% 853 | \renewcommand{\@zfancyhead}[5]{\relax\hbox to\headwidth{\f@nch@reset 854 | \@zfancyvbox\headheight{\hbox 855 | {\rlap{\parbox[b]{\headwidth}{\raggedright\f@nch@olh}}\hfill 856 | \parbox[b]{\headwidth}{\centering\f@nch@olh}\hfill 857 | \llap{\parbox[b]{\headwidth}{\raggedleft\f@nch@orh}}}% 858 | \zheadrule}}\relax}% 859 | } 860 | } 861 | {} 862 | \endinput 863 | %% 864 | %% End of file `fancyhdr.sty'. 865 | --------------------------------------------------------------------------------