summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-09-06 21:31:34 +0000
committerKarl Berry <karl@freefriends.org>2016-09-06 21:31:34 +0000
commit327ccdda521fd51f95fc32ad7f01789a5a278f5d (patch)
tree4a3ee83b2cdbeda34b729c4b5bc250227d5cd955
parent47962829fa9ae2e9127ec987e6428fcf34da7578 (diff)
fancyhdr (6sep16)
git-svn-id: svn://tug.org/texlive/trunk@42004 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdfbin378142 -> 383113 bytes
-rw-r--r--Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex43
-rw-r--r--Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty59
3 files changed, 80 insertions, 22 deletions
diff --git a/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf b/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf
index 49b2aef326c..b765f8720bf 100644
--- a/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf
+++ b/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex b/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex
index 910136ece15..0b4c0527a5f 100644
--- a/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex
+++ b/Master/texmf-dist/doc/latex/fancyhdr/fancyhdr.tex
@@ -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 @@ redefine the command \Cmd{headrule}:
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 @@ by defining:
\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 @@ package: If commands of the form
\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 @@ WWW: http://www.pietvanoostrum.com
\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}
diff --git a/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty b/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
index 11b894e713d..9af920b8a71 100644
--- a/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
+++ b/Master/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
@@ -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@mpty#1{\def\temp@a{#1}\ifx\temp@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@raggedleft\raggedleft
+\let\fnch@raggedright\raggedright
+\let\fnch@centering\centering
\let\fnch@everypar\everypar% save real \everypar because of spanish.ldf
+
\def\fancy@reset{\fnch@everypar{}\restorecr\endlinechar=13
+ \let\\\@normalcr
+ \let\raggedleft\fnch@raggedleft
+ \let\raggedright\fnch@raggedright
+ \let\centering\fnch@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@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@gbl\let\fancy@Oorf\hss
\fancy@gbl\let\fancy@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@footnote
+\AtBeginDocument{%
\let\latex@makecol\@makecol
-\def\@makecol{\ifvoid\footins\footnotetrue\else\footnotefalse\fi
-\let\topfloat\@toplist\let\botfloat\@botlist\latex@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@fcolmade #1\else #2\fi}
+\def\@makecol{\ifvoid\footins\fnch@footnotefalse\else\fnch@footnotetrue\fi
+\let\topfloat\@toplist\let\botfloat\@botlist\latex@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@fcolmade #1\else #2\fi}%
+\newcommand\iffootnote[2]{\iffnch@footnote #1\else #2\fi}%
\newcommand{\fancypagestyle}[2]{%
\@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}}