From 892a35d802c0f8440e326b50aae63c728895bb2d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 24 Apr 2024 20:20:23 +0000 Subject: fancyhdr (24apr24) git-svn-id: svn://tug.org/texlive/trunk@71064 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/fancyhdr/README | 8 +- Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf | Bin 870150 -> 875225 bytes .../texmf-dist/source/latex/fancyhdr/fancyhdr.dtx | 90 ++++++++++++++------- .../texmf-dist/tex/latex/fancyhdr/extramarks.sty | 4 +- Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty | 9 ++- 5 files changed, 77 insertions(+), 34 deletions(-) diff --git a/Master/texmf-dist/doc/latex/fancyhdr/README b/Master/texmf-dist/doc/latex/fancyhdr/README index e03540dec74..4a7d219fdc0 100644 --- a/Master/texmf-dist/doc/latex/fancyhdr/README +++ b/Master/texmf-dist/doc/latex/fancyhdr/README @@ -1,6 +1,8 @@ fancyhdr – Extensive control of page headers and footers in LaTeX2ε -The package provides extensive facilities, both for constructing headers and footers, and for controlling their use (for example, at times when LaTeX would automatically change the heading style in use). +The package provides extensive facilities, both for constructing headers +and footers, and for controlling their use (for example, at times when +LaTeX would automatically change the heading style in use). The distribution package consists of the following files: @@ -25,8 +27,8 @@ In order to latex the documentation you need to have a copy of boxedminipage.sty (CTAN:/macros/latex/contrib/boxedminipage) and refcount.sty (CTAN:/macros/latex/contrib/oberdiek/) installed. -This is version 4.1 of fancyhdr.sty and extramarks.sty. They are -described in the forthcoming third edition of The LaTeX Companion. +This is version 4.2 of fancyhdr.sty and extramarks.sty. They are +described in the third edition of The LaTeX Companion. Extramarks.sty has not been changed, except for the version and copyright information. diff --git a/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf b/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf index b9302285cc1..9f781dad3ba 100644 Binary files a/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf and b/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf differ diff --git a/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx b/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx index 2995092da6a..43c6631bba5 100644 --- a/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx +++ b/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1994-2022 by Pieter van Oostrum +% Copyright (C) 1994-2024 by Pieter van Oostrum % ------------------------------------------------------- % % This file may be distributed and/or modified under the @@ -26,11 +26,12 @@ %\ProvidesPackage{fancyhdr}% %\ProvidesPackage{fancyheadings} %\ProvidesPackage{extramarks} -% [2022/11/09 v4.1 +% [2024/04/23 v4.2 % Extensive control of page headers and footers]% +% [2022/11/09 v4.1 % Legacy package to call fancyhdr] % Extra marks for LaTeX] -%% Copyright (C) 1994-2022 by Pieter van Oostrum +%% Copyright (C) 1994-2024 by Pieter van Oostrum %% Public domain %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \end{macrocode} @@ -641,7 +642,7 @@ % \renewcommand{\footrulewidth}{2pt} % \end{verbatim} % (The \cs{thepage} macro displays the current page number. -% \cs{textbf} puts it in bold face.) +% \cs{textbf} puts its argument in bold face.) % % This is now fine, except that the first page does not need % all these headers and footers. To eliminate all but the @@ -847,14 +848,14 @@ % redefine existing page styles (like \texttt{plain}) or to define new ones, % e.g. if part of your document needs a different page style. This command % has two mandatory parameters: the first one is the name of the page style to be defined, the -% second consists of commands that change the headers and/or footers, i.e. -% \verb|fancyhead| etc. Also allowed are changes to \cs{headrulewidth} and +% second consists of commands that change the headers and/or footers, i.e., +% \verb|\fancyhead| etc. Also allowed are changes to \cs{headrulewidth} and % \cs{footrulewidth} or even \cs{headrule} and \cs{footrule}. % The (re)defined page style uses the standard % \texttt{fancy} definitions, amended by the definitions in the second % parameter. In other words, those parts that are not redefined in the % second parameter get their value from the \texttt{fancy} definition that -% is current. In particular, if the second parameter is empty, i.e. given +% is current. In particular, if the second parameter is empty, i.e., given % as \verb+{}+, then the new page style is equal to page style % \texttt{fancy}. % @@ -1051,7 +1052,7 @@ % before, we get a layout that is very similar to the page style \texttt{headings}. % % On the pages where new chapters start, we get a centered page number -% in the footer; there is no header, and there are no decorative lines. +% in the footer; there is nothing in the header, and there are no decorative lines. % % On an even page, we get the layout: % @@ -1617,6 +1618,15 @@ % \fancyheadoffset[LE,RO]{\marginparsep+\marginparwidth} % \end{verbatim} % +% \textbf{NOTE:} If you change the \cs{textwidth} in the middle of your +% document, for example by using the \Package{geometry}\TTindex{geometry} package, +% by default the \cs{headwidth} will not change, as it picks up the value +% of \cs{textwidth} at the beginning of the document. If you want it to track +% the changes to \cs{textwidth}, you should use the command \verb|\fancyhfoffset{0pt}| +% in the neighborhood of your header/footer definitions, unless you +% already use such an \texttt{\ldots offset} command, of course. +% \vspace{\baselineskip} +% % For the second example, we take the \amslatex/ book\footnote{George Gratzer, % \textit{Math into LaTeX, An Introduction to \LaTeX{} and \amslatex/}, Birkhauser, Boston.}. % @@ -2303,9 +2313,9 @@ % \cs{firstxmark} will be `Continued\ldots'; (2) the block ends at a % later page, therefore it does not contribute any marks to that page, % and the marks are `inherited' from the last values of the previous page, -% i.e. those from \texttt{\%~2}. +% i.e., those from \texttt{\%~2}. % On all of the pages after the block the values of \texttt{\%~4} will be used, -% i.e. empty ones. +% i.e., empty ones. % This final \verb+\extramarks{}{}+ is to prevent the `Continued\ldots' % header to spill over to the following pages. % Of course in real life you would leave out the numbers. @@ -2391,11 +2401,16 @@ % \extramarks{}{}% % \extramarks{(Continued\ldots)}{Continued on next page\ldots}% % \afterpage{\noindent\firstxmark\vspace{1ex}}% -% }{\extramarks{(Continued\ldots)}{}% +% \ignorespaces +% }{% +% \unskip\extramarks{(Continued\ldots)}{}% % \extramarks{}{}\par % } % \end{verbatim} % +% Note how we use \cs{ignorespaces}, \cs{unskip} and \texttt{\%} to +% prevent unwanted spaces to creep into the text. +% % It is a bit dangerous to use \cs{firstxmark} outside the page layout % routine, but apparently with \cs{afterpage} this works. If you would % need the information further on in the page you must remember the state of @@ -2409,7 +2424,9 @@ % \newenvironment{continued}{\par % \extramarks{}{}% % \extramarks{(Continued\ldots)}{Continued on next page\ldots}% -% }{\extramarks{(Continued\ldots)}{}% +% \ignorespaces +% }{% +% \unskip\extramarks{(Continued\ldots)}{}% % \extramarks{}{}\par\vspace{1ex}\mysaved}% % } % \fancyhead[L]{\leftmark} @@ -2475,7 +2492,7 @@ % requires some hand-tuning to get the blobs nicely spaced out vertically. % For the application that I originally designed this for, there were 12 sections, % so I made the blobs -% 18 mm apart, i.e. 9~mm blob separated by 9~mm whitespace. In order to avoid +% 18 mm apart, i.e., 9~mm blob separated by 9~mm whitespace. In order to avoid % calculations they are set in a \texttt{picture} environment with the % \cs{unitlength} set to 18~mm. Page numbers are set in the headers at the % outer sides, and the blobs are attached to these. In this example the @@ -2585,7 +2602,7 @@ % % In the first two cases you must first check if you have given the correct % ``placement'' parameter to you float, e.g. \Cmd{begin\{figure\}[htp]} -% specifies that your figure may be placed either: Here (i.e. in the text +% specifies that your figure may be placed either: Here (i.e., in the text % position where the command is given), on the Top of a page (which may be % the page where you put the command), or on a separate Page of floats. You % could also have specified ``\texttt{b}'' for Bottom of the page. The order of the @@ -2701,7 +2718,7 @@ % in the preamble. Now you will be able to % specify \texttt{[H]} as the position parameter, which will mean ``HERE % and only HERE''. This may cause an unwanted page break however. -% If you want to avoid the unwanted pagebreak, i.e. let +% If you want to avoid the unwanted pagebreak, i.e., let % \LaTeX{} move the float only if it doesn't fit on the page, then use the % \Package{afterpage} package with: % \TTindex{afterpage}\CmdIndex{afterpage}\CmdIndex{clearpage}% @@ -2781,7 +2798,7 @@ % There isn't an equivalent ``\texttt{longfigure}'' solution, so for figures you % will have to split yourself. In general this is less of a % problem. However, the problem you get now is how to keep them together, -% i.e. how to get the parts on subsequent pages, and how to get a single +% i.e., how to get the parts on subsequent pages, and how to get a single % entry in the list of figures. % % You will have to split the figure into pieces and put each part @@ -3031,6 +3048,12 @@ % \item Make \Package{fancyhdr} compatible with the document class \Package{newlfm}. % \item Make \cs{nouppercase} compatible with newer definitions of \cs{MakeUppercase}. % \end{itemize} +% \item Version 4.2, April 19-23, 2024 +% \begin{itemize} +% \item Reset catcodes to their default values in order to facilitate +% \cs{input} in headers/footers when \texttt{verbatim} is active. +% (Issue \# 8 \url{https://github.com/pietvo/fancyhdr/issues/8}.) +% \end{itemize} % \end{itemize} % % @@ -3315,7 +3338,7 @@ % conditionalized and they don't consume length registers. There is no need % to have them as length registers unless you want to do calculations with % them, which is unlikely. Note that this may make some uses of them -% incompatible (i.e. if you have a file that uses \cs{setlength} or \cs{xxxx}!=)} +% incompatible (i.e., if you have a file that uses \cs{setlength} or \cs{xxxx}!=)} % % \changes{fancyhdr v1.99a}{1996/05/10}{Added a few more \% signs.} % @@ -3485,7 +3508,7 @@ % \cs{f@nch@ifundefined}. % This definition is copied from the \Package{tocloft} package by Peter % Wilson and Will Robertson. -% \begin{macrocode} +% \begin{macrocode} \newcommand{\f@nch@ifundefined}[1]{% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname #1\endcsname\relax @@ -3493,7 +3516,7 @@ \else \expandafter\@secondoftwo \fi} -% \end{macrocode} +% \end{macrocode} % \end{macro} % % \changes{fancyhdr v4.0}{2019/03/17}{Added \texttt{headings} and @@ -3992,11 +4015,23 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\f@nch@noUppercase} +% We want \cs{nouppercase} to work with the various evolutionary stages of +% \cs{MakeUppercase}. The current version (2022/11/09) accepts an optional +% argument with a language specification. Therefore we define a dummy macro +% \cs{f@nch@noUppercase} which copies its mandatory agument, as a +% replacement for \cs{MakeUppercase} while \cs{nouppercase} is active. +% \begin{macrocode} +\newcommand\f@nch@noUppercase[2][]{#2} +% \end{macrocode} +% % \begin{macro}{\f@nch@reset} % Command to reset various things in the headers: a.o. single spacing % (taken from setspace.sty) and the catcode of ^^M and % \cs{endlinechar} (so that epsf files -% in the header work if a verbatim crosses a page boundary) It also +% in the header work if a verbatim crosses a page boundary). +% Also reset the catcodes that are changed in verbatim environments, +% \cs{makeatother} and \cs{ExplSyntaxOn}. It also % defines a \cs{nouppercase} command that disables \cs{uppercase} and % \cs{Makeuppercase}. It can only be used in the headers and footers. Set % \cs{hsize} to \cs{headwidth} (this helps for multicol); reset @@ -4006,15 +4041,16 @@ % \LaTeX{} output routine, so we don't have to do it here. % \changes{fancyhdr v4.1}{2022/11/09}{Change \cs{nouppercase} to work with % new definition of \cs{MakeUppercase}.} -% \begin{macro}{\f@nch@noUppercase} -% We want \cs{nouppercase} to work with the various evolutionary stages of -% \cs{MakeUppercase}. The current version (2022/11/09) accepts an optional -% argument with a language specification. Therefore we define a dummy macro -% \cs{f@nch@noUppercase} which copies its mandatory agument, as a -% replacement for \cs{MakeUppercase} while \cs{nouppercase} is active. +% \changes{fancyhdr v4.2}{2024/04/19}{Reset catcodes to their default +% values in order to facilitate \cs{input} in headers/footers when \texttt{verbatim} +% is active. (Issue \# 8 \url{https://github.com/pietvo/fancyhdr/issues/8}.)} % \begin{macrocode} -\newcommand\f@nch@noUppercase[2][]{#2} \def\f@nch@reset{\f@nch@everypar{}\restorecr\endlinechar=13 + \catcode`\\=0\catcode`\{=1\catcode`\}=2\catcode`\$=3\catcode`\&=4 + \catcode`\#=6\catcode`\^=7\catcode`\_=8\catcode`\ =10\catcode`\@=11 + \catcode`\:=11\catcode`\~=13\catcode`\%=14 + \catcode0=15 %NULL + \catcode9=10 %TAB \let\\\@normalcr \let\raggedleft\f@nch@raggedleft \let\raggedright\f@nch@raggedright \let\centering\f@nch@centering \def\baselinestretch{1}% diff --git a/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty b/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty index f5727c48fec..f42afc04fbd 100644 --- a/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty +++ b/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty @@ -21,9 +21,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{extramarks} - [2022/11/09 v4.1 + [2024/04/23 v4.2 Extra marks for LaTeX] -% Copyright (C) 1994-2022 by Pieter van Oostrum +% Copyright (C) 1994-2024 by Pieter van Oostrum %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newtoks\@temptokenb \providecommand\unrestored@protected@xdef{% diff --git a/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty b/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty index 2291cf32fa8..f6ef0762fcd 100644 --- a/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty +++ b/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty @@ -21,9 +21,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{fancyhdr}% - [2022/11/09 v4.1 + [2024/04/23 v4.2 Extensive control of page headers and footers]% -% Copyright (C) 1994-2022 by Pieter van Oostrum +% Copyright (C) 1994-2024 by Pieter van Oostrum %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand\if@nch@mpty[1]{\def\temp@a{#1}\ifx\temp@a\@empty} \newif\iff@nch@check @@ -234,6 +234,11 @@ \let\f@nch@everypar\everypar \newcommand\f@nch@noUppercase[2][]{#2} \def\f@nch@reset{\f@nch@everypar{}\restorecr\endlinechar=13 + \catcode`\\=0\catcode`\{=1\catcode`\}=2\catcode`\$=3\catcode`\&=4 + \catcode`\#=6\catcode`\^=7\catcode`\_=8\catcode`\ =10\catcode`\@=11 + \catcode`\:=11\catcode`\~=13\catcode`\%=14 + \catcode0=15 %NULL + \catcode9=10 %TAB \let\\\@normalcr \let\raggedleft\f@nch@raggedleft \let\raggedright\f@nch@raggedright \let\centering\f@nch@centering \def\baselinestretch{1}% -- cgit v1.2.3