texlive[71064] Master/texmf-dist: fancyhdr (24apr24)

commits+karl at tug.org commits+karl at tug.org
Wed Apr 24 22:20:23 CEST 2024


Revision: 71064
          https://tug.org/svn/texlive?view=revision&revision=71064
Author:   karl
Date:     2024-04-24 22:20:23 +0200 (Wed, 24 Apr 2024)
Log Message:
-----------
fancyhdr (24apr24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fancyhdr/README
    trunk/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf
    trunk/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx
    trunk/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty
    trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty

Modified: trunk/Master/texmf-dist/doc/latex/fancyhdr/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyhdr/README	2024-04-24 20:20:13 UTC (rev 71063)
+++ trunk/Master/texmf-dist/doc/latex/fancyhdr/README	2024-04-24 20:20:23 UTC (rev 71064)
@@ -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 @@
 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.
 

Modified: trunk/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx	2024-04-24 20:20:13 UTC (rev 71063)
+++ trunk/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx	2024-04-24 20:20:23 UTC (rev 71064)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 1994-2022 by Pieter van Oostrum <pieter at vanoostrum.org>
+% Copyright (C) 1994-2024 by Pieter van Oostrum <pieter at vanoostrum.org>
 % -------------------------------------------------------
 %
 % This file may be distributed and/or modified under the
@@ -26,11 +26,12 @@
 %<fancyhdr>\ProvidesPackage{fancyhdr}%
 %<fancyheadings>\ProvidesPackage{fancyheadings}
 %<extramarks>\ProvidesPackage{extramarks}
-%<fancyhdr|fancyheadings|extramarks>           [2022/11/09 v4.1
+%<fancyhdr|extramarks>           [2024/04/23 v4.2
 %<fancyhdr>                  Extensive control of page headers and footers]%
+%<fancyheadings>           [2022/11/09 v4.1
 %<fancyheadings>                  Legacy package to call fancyhdr]
 %<extramarks>                  Extra marks for LaTeX]
-%<fancyhdr|extramarks>% Copyright (C) 1994-2022 by Pieter van Oostrum <pieter at vanoostrum.org>
+%<fancyhdr|extramarks>% Copyright (C) 1994-2024 by Pieter van Oostrum <pieter at vanoostrum.org>
 %<fancyheadings>% 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 at nch@ifundefined}.
 % This definition is copied from the \Package{tocloft} package by Peter
 % Wilson and Will Robertson.
-% \begin{macrocode}
+%    \begin{macrocode}
 \newcommand{\f at 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 at 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 at nch@noUppercase} which copies its mandatory agument, as a
+%   replacement for \cs{MakeUppercase} while \cs{nouppercase} is active.
+%    \begin{macrocode}
+\newcommand\f at nch@noUppercase[2][]{#2}
+%    \end{macrocode}
+%
 % \begin{macro}{\f at 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 at 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 at 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 at nch@noUppercase[2][]{#2}
 \def\f at nch@reset{\f at 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 at nch@raggedleft
   \let\raggedright\f at nch@raggedright \let\centering\f at nch@centering
   \def\baselinestretch{1}%

Modified: trunk/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty	2024-04-24 20:20:13 UTC (rev 71063)
+++ trunk/Master/texmf-dist/tex/latex/fancyhdr/extramarks.sty	2024-04-24 20:20:23 UTC (rev 71064)
@@ -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 <pieter at vanoostrum.org>
+% Copyright (C) 1994-2024 by Pieter van Oostrum <pieter at vanoostrum.org>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \newtoks\@temptokenb
 \providecommand\unrestored at protected@xdef{%

Modified: trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty	2024-04-24 20:20:13 UTC (rev 71063)
+++ trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty	2024-04-24 20:20:23 UTC (rev 71064)
@@ -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 <pieter at vanoostrum.org>
+% Copyright (C) 1994-2024 by Pieter van Oostrum <pieter at vanoostrum.org>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \newcommand\if at nch@mpty[1]{\def\temp at a{#1}\ifx\temp at a\@empty}
 \newif\iff at nch@check
@@ -234,6 +234,11 @@
 \let\f at nch@everypar\everypar
 \newcommand\f at nch@noUppercase[2][]{#2}
 \def\f at nch@reset{\f at 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 at nch@raggedleft
   \let\raggedright\f at nch@raggedright \let\centering\f at nch@centering
   \def\baselinestretch{1}%



More information about the tex-live-commits mailing list.