summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-11-09 21:07:39 +0000
committerKarl Berry <karl@freefriends.org>2022-11-09 21:07:39 +0000
commit1b3a0d2fd41be6da2783900f7e03472c9f8f6c1e (patch)
tree3ef6ddfbb7cbf73b6944087e2b2868f376861e79 /Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
parent291f1dfac56e765919ed452957bc93af5e83fcd3 (diff)
fancyhdr (9nov22)
git-svn-id: svn://tug.org/texlive/trunk@64977 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty75
1 files changed, 64 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty b/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
index 7d0fb439081..2291cf32fa8 100644
--- a/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
+++ b/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
@@ -21,7 +21,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{fancyhdr}%
- [2022/05/18 v4.0.3
+ [2022/11/09 v4.1
Extensive control of page headers and footers]%
% Copyright (C) 1994-2022 by Pieter van Oostrum <pieter@vanoostrum.org>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -37,6 +37,11 @@
\let\f@nch@gbl\global
\f@nch@compatViiitrue
}
+\newif\iff@nch@twoside
+\f@nch@twosidefalse
+\DeclareOption{twoside}{%
+ \if@twoside\else\f@nch@twosidetrue\fi
+}
\newcommand\f@nch@def[2]{\if@nch@mpty{#2}\f@nch@gbl\def#1{\leavevmode}\else
\f@nch@gbl\def#1{#2\strut}\fi}
\newcommand{\f@nch@ifundefined}[1]{%
@@ -148,6 +153,14 @@
\newcommand{\fancyheadoffset}[2][]{\f@nch@fancyhfoffs\fancyheadoffset h[#1]{#2}}%
\newcommand{\fancyfootoffset}[2][]{\f@nch@fancyhfoffs\fancyfootoffset f[#1]{#2}}%
\newcommand{\fancyhfoffset}[2][]{\f@nch@fancyhfoffs\fancyhfoffset {}[#1]{#2}}%
+\def\f@nch@fancyhf@Echeck#1{%
+ \if@twoside\else
+ \iff@nch@twoside\else
+ \if\f@nch@@eo e%
+ \f@nch@warning {\string#1's `E' option without twoside option is useless.\MessageBreak
+ Please consider using the `twoside' option}%
+ \fi\fi\fi
+}
\long\def\f@nch@fancyhf#1#2[#3]#4{%
\def\temp@c{}%
\f@nch@forc\tmpf@ra{#3}%
@@ -156,9 +169,9 @@
\ifx\@empty\temp@c\else \f@nch@errmsg{Illegal char `\temp@c' in
\string#1 argument: [#3]}%
\fi \f@nch@for\temp@c{#3}%
- {\f@nch@default\f@nch@@eo{eo}\temp@c \if@twoside\else \if\f@nch@@eo
- e\f@nch@warning {\string#1's `E' option without twoside option is
- useless}\fi\fi \f@nch@default\f@nch@@lcr{lcr}\temp@c
+ {\f@nch@default\f@nch@@eo{eo}\temp@c
+ \f@nch@fancyhf@Echeck{#1}%
+ \f@nch@default\f@nch@@lcr{lcr}\temp@c
\f@nch@default\f@nch@@hf{hf}{#2\temp@c}%
\f@nch@forc\f@nch@eo\f@nch@@eo
{\f@nch@forc\f@nch@lcr\f@nch@@lcr
@@ -173,9 +186,9 @@
\ifx\@empty\temp@c\else \f@nch@errmsg{Illegal char `\temp@c' in
\string#1 argument: [#3]}%
\fi \f@nch@for\temp@c{#3}%
- {\f@nch@default\f@nch@@eo{eo}\temp@c \if@twoside\else \if\f@nch@@eo
- e\f@nch@warning {\string#1's `E' option without twoside option is
- useless}\fi\fi \f@nch@default\f@nch@@lcr{lr}\temp@c
+ {\f@nch@default\f@nch@@eo{eo}\temp@c
+ \f@nch@fancyhf@Echeck{#1}%
+ \f@nch@default\f@nch@@lcr{lr}\temp@c
\f@nch@default\f@nch@@hf{hf}{#2\temp@c}%
\f@nch@forc\f@nch@eo\f@nch@@eo
{\f@nch@forc\f@nch@lcr\f@nch@@lcr
@@ -219,13 +232,18 @@
\let\f@nch@raggedright\raggedright
\let\f@nch@centering\centering
\let\f@nch@everypar\everypar
+\newcommand\f@nch@noUppercase[2][]{#2}
\def\f@nch@reset{\f@nch@everypar{}\restorecr\endlinechar=13
\let\\\@normalcr \let\raggedleft\f@nch@raggedleft
\let\raggedright\f@nch@raggedright \let\centering\f@nch@centering
\def\baselinestretch{1}%
\hsize=\headwidth
- \def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax
- \expandafter\let\csname MakeUppercase \endcsname\relax##1}}%
+ \def\nouppercase##1{{%
+ \let\uppercase\relax\let\MakeUppercase\f@nch@noUppercase
+ \expandafter\let\csname MakeUppercase \endcsname\relax
+ \expandafter\def\csname MakeUppercase\space\space\space\endcsname
+ [####1]####2{####2}%
+ ##1}}%
\f@nch@ifundefined{@newbaseline} % NFSS not present; 2.09 or 2e
{\f@nch@ifundefined{@normalsize} {\normalsize} % for ucthesis.cls
{\@normalsize}}%
@@ -391,8 +409,30 @@
\def\ps@f@nch@fancycore{%
\f@nch@ps@empty
\def\@mkboth{\protect\markboth}%
- \def\@oddhead{\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh}%
- \def\@oddfoot{\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf}%
+ \def\f@nch@oddhead{\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh}%
+ \def\@oddhead{%
+ \iff@nch@twoside
+ \ifodd\c@page
+ \f@nch@oddhead
+ \else
+ \@evenhead
+ \fi
+ \else
+ \f@nch@oddhead
+ \fi
+ }
+ \def\f@nch@oddfoot{\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf}%
+ \def\@oddfoot{%
+ \iff@nch@twoside
+ \ifodd\c@page
+ \f@nch@oddfoot
+ \else
+ \@evenfoot
+ \fi
+ \else
+ \f@nch@oddfoot
+ \fi
+ }
\def\@evenhead{\f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh}%
\def\@evenfoot{\f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf}%
}
@@ -451,6 +491,19 @@
}%
}%
}%
+\@ifclassloaded{newlfm}
+{
+ \let\ps@@empty\f@nch@ps@empty
+ \AtBeginDocument{%
+ \renewcommand{\@zfancyhead}[5]{\relax\hbox to\headwidth{\f@nch@reset
+ \@zfancyvbox\headheight{\hbox
+ {\rlap{\parbox[b]{\headwidth}{\raggedright\f@nch@olh}}\hfill
+ \parbox[b]{\headwidth}{\centering\f@nch@olh}\hfill
+ \llap{\parbox[b]{\headwidth}{\raggedleft\f@nch@orh}}}%
+ \zheadrule}}\relax}%
+ }
+}
+{}
\endinput
%%
%% End of file `fancyhdr.sty'.