texlive[42004] Master/texmf-dist: fancyhdr (6sep16)

commits+karl at tug.org commits+karl at tug.org
Tue Sep 6 23:31:35 CEST 2016


Revision: 42004
          http://tug.org/svn/texlive?view=revision&revision=42004
Author:   karl
Date:     2016-09-06 23:31:34 +0200 (Tue, 06 Sep 2016)
Log Message:
-----------
fancyhdr (6sep16)

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

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

Modified: trunk/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex	2016-09-06 21:31:21 UTC (rev 42003)
+++ trunk/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex	2016-09-06 21:31:34 UTC (rev 42004)
@@ -6,6 +6,7 @@
 \usepackage{array}
 \usepackage{a4wide}
 \usepackage{boxedminipage}
+\usepackage{fourier-orns}
 \makeindex
 \title{Page layout in \LaTeX}
 \author{Piet van Oostrum\thanks{A considerable part of this article was
@@ -24,9 +25,9 @@
     PSNFSS}}
 \newcommand{\bs}{\symbol{'134}}
 \newcommand{\Cmd}[1]{\texttt{\def\{{\char`\{}\def\}{\char`\}}\bs#1}}
-\newcommand{\CmdIndex}[1]{\index{#1@\texttt{\bs#1}}}
-\newcommand{\TTindex}[1]{\index{#1@\texttt{#1}}}
-\newcommand{\PSindex}[1]{\index{page style!#1@\texttt{#1}}}
+\newcommand{\CmdIndex}[1]{\index{#1@\string\texttt{\bs#1}}}
+\newcommand{\TTindex}[1]{\index{#1@\string\texttt{#1}}}
+\newcommand{\PSindex}[1]{\index{page style!#1@\string\texttt{#1}}}
 %\floatstyle{ruled}
 \restylefloat{figure}
 \renewcommand{\topfraction}{0.9}
@@ -776,6 +777,23 @@
     to\headwidth{\dotfill}\vss}}
 \end{verbatim}
 
+As an alternative to changing \Cmd{headrulewidth} to 0 to have the rule disappear, you can also make it empty with
+\begin{verbatim}
+\renewcommand{\headrule}{}
+\end{verbatim}
+Visually this make no difference, but it is more difficult to restore it later to its default value.
+
+Finally, let us make a real `decorative' line\footnote{Based upon an idea by Wayne Chan.}.
+\begin{verbatim}
+\usepackage{fourier-orns}
+...
+\renewcommand\headrule{\hrulefill
+\raisebox{-2.1pt}[10pt][10pt]{\quad\decofourleft\decotwo\decofourright\quad}\hrulefill}
+\end{verbatim}
+This gives us the following headrule:
+
+\noindent\makebox[\textwidth]{\hrulefill \raisebox{-2.1pt}[10pt][10pt]{\quad\decofourleft\decotwo\decofourright\quad}\hrulefill}
+
 \CmdIndex{footruleskip}
 There is one additional parameter that you can set: \Cmd{footruleskip}. It
 defines the distance between the decorative line in the footer and the top
@@ -942,11 +960,10 @@
 \end{verbatim}
 
 Sometimes you may want to change the layout also for pages that contain a
-float on the top of the page or a float on the bottom of the page.
+float on the top of the page, a float on the bottom of the page or a footnote on the bottom of the page.
 
-\textsf{fancyhdr} gives you the commands \Cmd{iftopfloat} and  \Cmd{ifbotfloat}
-similar to
- \Cmd{iffloatpage}.
+\textsf{fancyhdr} gives you the commands \Cmd{iftopfloat}, \Cmd{ifbotfloat} and \Cmd{iffootnote}
+similar to \Cmd{iffloatpage}.
 
 Note: Marks in floats will not be visible in \latex/'s output routine, so
 it is not useful to put marks in floats. So there is currently no way to
@@ -1165,7 +1182,7 @@
 \Cmd{lastxmark} gives you the last $m_2$ value
 of the current page.
 
-In case you want the last  $m_1$ value or the first  $m_2$ value, you can use the \Cmd{lastleftxmark} or \Cmd{firstrightxmark}, respectively. For symmetry reasons there are also commands \Cmd{firstleftxmark} (=\Cmd{firstxmark}), \Cmd{lastrightxmark} (=\Cmd{lastxmark}), \Cmd{topleftxmark} (=\Cmd{topxmark}) and \Cmd{toprightxmark}.
+In case you want the last  $m_1$ value or the first  $m_2$ value, you can use the \Cmd{lastleftxmark} or \Cmd{firstrightxmark}, respectively. For symmetry reasons there are also commands \Cmd{firstleftxmark} (=\Cmd{firstxmark}), \Cmd{lastrightxmark} (=\Cmd{lastxmark}), \Cmd{topleftxmark} (=\Cmd{topxmark}) and \Cmd{toprightxmark}. The top-marks are basically the last-marks of the previous page.
 \CmdIndex{lastleftxmark}
 \CmdIndex{firstrightxmark}
 \CmdIndex{firstleftxmark}
@@ -1671,10 +1688,18 @@
   \item Updated contact information.
   \item Added Version information. :)
   \end{itemize}
+\item Version 2.1. August 28...., 2016:
+  \begin{itemize}
+  \item Explain what the top-marks are.
+  \end{itemize}
+\item Version 2.1. Sept. 6, 2016
+  \begin{itemize}
+  \item Add \verb|\string| to special indexing commands to get a neater index file.
+  \item Add a decorative headrule example
+  \end{itemize}
 
 \end{itemize}
 
-
 \printindex
 
 \end{document}

Modified: trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty	2016-09-06 21:31:21 UTC (rev 42003)
+++ trunk/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty	2016-09-06 21:31:34 UTC (rev 42004)
@@ -1,4 +1,4 @@
-% fancyhdr.sty version 3.6
+% fancyhdr.sty version 3.8
 % Fancy headers and footers for LaTeX.
 % Piet van Oostrum, 
 % [Formerly] Dept of Computer and Information Sciences, University of Utrecht,
@@ -165,8 +165,23 @@
 % Added a \ProvidesPackage line.
 % Updated contact information.
 
+% Aug. 28, 2016
+% version 3.7
+% Removed \normalfont from default values, as every field is already
+% initialised with \normalfont.
+% Set \hsize to \headwidth in header/footer.
+
+% Sept. 6, 2016
+% version 3.8
+% Reset \\, \raggedleft, \raggedright and \centering to their default values
+%   to avoid a clash with the tabu package.
+% Move the redefinition of \@makecol to \begin{document} to avoid a clash
+%   with the footmisc package (and maybe others)
+% Define a working \iffootnote command
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \NeedsTeXFormat{LaTeX2e}[1995/06/01]%
-\ProvidesPackage{fancyhdr}[2016/08/27 3.6 Extensive control of page headers and footers]%
+\ProvidesPackage{fancyhdr}[2016/09/06 3.8 Extensive control of page headers and footers]%
 
 \def\ifancy at mpty#1{\def\temp at a{#1}\ifx\temp at a\@empty}
 
@@ -343,9 +358,20 @@
 % verbatim crosses a page boundary)
 % It also defines a \nouppercase command that disables \uppercase and
 % \Makeuppercase. It can only be used in the headers and footers.
+% \set \hsize to \headwidth (helps for multicol)
+% reset \\ \raggedleft \raggedright and \centering to their default values (for tabu)
+\let\fnch at raggedleft\raggedleft
+\let\fnch at raggedright\raggedright
+\let\fnch at centering\centering
 \let\fnch at everypar\everypar% save real \everypar because of spanish.ldf
+
 \def\fancy at reset{\fnch at everypar{}\restorecr\endlinechar=13
+ \let\\\@normalcr
+ \let\raggedleft\fnch at raggedleft
+ \let\raggedright\fnch at raggedright
+ \let\centering\fnch at centering
  \def\baselinestretch{1}%
+ \hsize=\headwidth
  \def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax
      \expandafter\let\csname MakeUppercase \endcsname\relax##1}}%
  \ifx\undefined\@newbaseline% NFSS not present; 2.09 or 2e
@@ -362,13 +388,13 @@
 % lefthead empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages
 % evenhead empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages
 \if at twoside
-  \fancyhead[el,or]{\fancyplain{}{\normalfont\slshape\rightmark}}
-  \fancyhead[er,ol]{\fancyplain{}{\normalfont\slshape\leftmark}}
+  \fancyhead[el,or]{\fancyplain{}{\slshape\rightmark}}
+  \fancyhead[er,ol]{\fancyplain{}{\slshape\leftmark}}
 \else
-  \fancyhead[l]{\fancyplain{}{\normalfont\slshape\rightmark}}
-  \fancyhead[r]{\fancyplain{}{\normalfont\slshape\leftmark}}
+  \fancyhead[l]{\fancyplain{}{\slshape\rightmark}}
+  \fancyhead[r]{\fancyplain{}{\slshape\leftmark}}
 \fi
-\fancyfoot[c]{\normalfont\rmfamily\thepage} % page number
+\fancyfoot[c]{\rmfamily\thepage} % page number
 
 % Use box 0 as a temp box and dimen 0 as temp dimen. 
 % This can be done, because this code will always
@@ -501,13 +527,20 @@
   \fancy at gbl\let\fancy at Oorf\hss
   \fancy at gbl\let\fancy at Oerf\hss}
 
-\newif\iffootnote
+% Redefine \@makecol so that we can capture if there are top/bottom floats, footnotes
+%  or if we are on a float page.
+% Because of a clash with the footmisc package we do this at \begin{document}}
+
+\newif\iffnch at footnote
+\AtBeginDocument{%
 \let\latex at makecol\@makecol
-\def\@makecol{\ifvoid\footins\footnotetrue\else\footnotefalse\fi
-\let\topfloat\@toplist\let\botfloat\@botlist\latex at makecol}
-\def\iftopfloat#1#2{\ifx\topfloat\empty #2\else #1\fi}
-\def\ifbotfloat#1#2{\ifx\botfloat\empty #2\else #1\fi}
-\def\iffloatpage#1#2{\if at fcolmade #1\else #2\fi}
+\def\@makecol{\ifvoid\footins\fnch at footnotefalse\else\fnch at footnotetrue\fi
+\let\topfloat\@toplist\let\botfloat\@botlist\latex at makecol}%
+}
+\newcommand\iftopfloat[2]{\ifx\topfloat\empty #2\else #1\fi}%
+\newcommand\ifbotfloat[2]{\ifx\botfloat\empty #2\else #1\fi}%
+\newcommand\iffloatpage[2]{\if at fcolmade #1\else #2\fi}%
+\newcommand\iffootnote[2]{\iffnch at footnote #1\else #2\fi}%
 
 \newcommand{\fancypagestyle}[2]{%
   \@namedef{ps@#1}{\let\fancy at gbl\relax#2\relax\ps at fancy}}



More information about the tex-live-commits mailing list