mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 09:29:13 +02:00
Initial import
This commit is contained in:
parent
a8e778f685
commit
b3e1b84cbc
56
docs/packages/fancyhdr/extramar.sty
Normal file
56
docs/packages/fancyhdr/extramar.sty
Normal file
@ -0,0 +1,56 @@
|
||||
% extra marks for latex.
|
||||
% This gives you two additional marks. \extramarks{m1}{m2} define two extra
|
||||
% marks for headers/footers (especially for use with fancyheadings), which
|
||||
% can be retrieved by \firstxmark and \lastxmark resp. Usually m1 is what
|
||||
% would appear at the top of the page, m2 at the bottom of the page.
|
||||
% Typical usage:
|
||||
% \pagestyle{fancy}
|
||||
% \lhead{\firstxmark}
|
||||
% \rfoot{\lastxmark}
|
||||
%
|
||||
% \extramarks{}{Continued on next page...}
|
||||
% text text text text text text text text text text text text text text text
|
||||
% text text text text text text text text text text text text text text text
|
||||
% text text text text text text text text text text text text text text text
|
||||
% text text text text text text text text text text text text text text text
|
||||
% text text text text text text text text text text text text text text text
|
||||
% \extramarks{Continued}{}
|
||||
% This package also provides two extra handles to the standard LaTeX marks,
|
||||
% namely \firstleftmark and \lastrightmark (the standard \leftmark and
|
||||
% \rightmark of LaTeX always give you the last and first, respectively.
|
||||
% These are the complementary values).
|
||||
|
||||
% Note: there is an extra command \topxmark, but this doesn't work properly
|
||||
% if marginpars or floats are used, as LaTeX clobbers TeX's topmark in this
|
||||
% case.
|
||||
|
||||
\def\@leftmark#1#2#3#4{#1}
|
||||
\def\@rightmark#1#2#3#4{#2}
|
||||
|
||||
\def\markboth#1#2{{\def\protect{\noexpand\protect\noexpand}
|
||||
\let\label\relax \let\index\relax \let\glossary\relax
|
||||
\expandafter\@markboth\@themark{#1}{#2}
|
||||
\mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}
|
||||
\def\markright#1{{\def\protect{\noexpand\protect\noexpand}
|
||||
\let\label\relax \let\index\relax \let\glossary\relax
|
||||
\expandafter\@markright\@themark{#1}
|
||||
\mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}
|
||||
\def\@markright#1#2#3#4#5{\gdef\@themark{{#1}{#5}{#3}{#4}}}
|
||||
\def\@markboth#1#2#3#4#5#6{\gdef\@themark{{#5}{#6}{#3}{#4}}}
|
||||
\def\leftmark{\expandafter\@leftmark\botmark{}{}{}{}}
|
||||
\def\rightmark{\expandafter\@rightmark\firstmark{}{}{}{}}
|
||||
\def\firstleftmark{\expandafter\@leftmark\firstmark{}{}{}{}}
|
||||
\def\lastrightmark{\expandafter\@rightmark\botmark{}{}{}{}}
|
||||
|
||||
\def\@themark{{}{}{}{}}
|
||||
|
||||
\def\extramarks#1#2{{\let\protect\@unexpandable@protect
|
||||
\let\label\relax \let\index\relax \let\glossary\relax
|
||||
\expandafter\@markextra\@themark{#1}{#2}
|
||||
\mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}
|
||||
\def\@markextra#1#2#3#4#5#6{\gdef\@themark{{#1}{#2}{#5}{#6}}}
|
||||
\def\firstxmark{\expandafter\@firstxmark\firstmark{}{}{}{}}
|
||||
\def\topxmark{\expandafter\@firstxmark\topmark{}{}{}{}}
|
||||
\def\lastxmark{\expandafter\@lastxmark\botmark{}{}{}{}}
|
||||
\def\@firstxmark#1#2#3#4{#3}
|
||||
\def\@lastxmark#1#2#3#4{#4}
|
313
docs/packages/fancyhdr/fancyhdr.sty
Normal file
313
docs/packages/fancyhdr/fancyhdr.sty
Normal file
@ -0,0 +1,313 @@
|
||||
% fancyhdr.sty version 1.99c
|
||||
% Fancy headers and footers.
|
||||
% Piet van Oostrum, Dept of Computer Science, University of Utrecht
|
||||
% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
|
||||
% Telephone: +31 30 2532180. Email: piet@cs.ruu.nl
|
||||
% Sep 16, 1994
|
||||
% version 1.4: Correction for use with \reversemargin
|
||||
% Sep 29, 1994:
|
||||
% version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands
|
||||
% Oct 4, 1994:
|
||||
% version 1.6: Reset single spacing in headers/footers for use with
|
||||
% setspace.sty or doublespace.sty
|
||||
% Oct 4, 1994:
|
||||
% version 1.7: changed \let\@mkboth\markboth to
|
||||
% \def\@mkboth{\protect\markboth} to make it more robust
|
||||
% Dec 5, 1994:
|
||||
% version 1.8: corrections for amsbook/amsart: define \@chapapp and (more
|
||||
% importantly) use the \chapter/sectionmark definitions from ps@headings if
|
||||
% they exist (which should be true for all standard classes).
|
||||
% May 31, 1995:
|
||||
% version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage...
|
||||
% construction in the doc did not work properly with the fancyplain style.
|
||||
% June 1, 1995:
|
||||
% version 1.91: The definition of \@mkboth wasn't restored on subsequent
|
||||
% \pagestyle{fancy}'s.
|
||||
% June 1, 1995:
|
||||
% version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain}
|
||||
% \pagestyle{fancy} would erroneously select the plain version.
|
||||
% June 1, 1995:
|
||||
% version 1.93: \fancypagestyle command added.
|
||||
% Dec 11, 1995:
|
||||
% version 1.94: suggested by Conrad Hughes <chughes@maths.tcd.ie>
|
||||
% CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule
|
||||
% position (old hardcoded value of .3\normalbaselineskip is far too high
|
||||
% when used with very small footer fonts).
|
||||
% Jan 31, 1996:
|
||||
% version 1.95: call \@normalsize in the reset code if that is defined,
|
||||
% otherwise \normalsize.
|
||||
% this is to solve a problem with ucthesis.cls, as this doesn't
|
||||
% define \@currsize. Unfortunately for latex209 calling \normalsize doesn't
|
||||
% work as this is optimized to do very little, so there \@normalsize should
|
||||
% be called. Hopefully this code works for all versions of LaTeX known to
|
||||
% mankind.
|
||||
% April 25, 1996:
|
||||
% version 1.96: initialize \headwidth to a magic (negative) value to catch
|
||||
% most common cases that people change it before calling \pagestyle{fancy}.
|
||||
% Note it can't be initialized when reading in this file, because
|
||||
% \textwidth could be changed afterwards. This is quite probable.
|
||||
% We also switch to \MakeUppercase rather than \uppercase and introduce a
|
||||
% \nouppercase command for use in headers. and footers.
|
||||
% May 3, 1996:
|
||||
% version 1.97: Two changes:
|
||||
% 1. Undo the change in version 1.8 (using the pagestyle{headings} defaults
|
||||
% for the chapter and section marks. The current version of amsbook and
|
||||
% amsart classes don't seem to need them anymore. Moreover the standard
|
||||
% latex classes don't use \markboth if twoside isn't selected, and this is
|
||||
% confusing as \leftmark doesn't work as expected.
|
||||
% 2. include a call to \ps@empty in ps@@fancy. This is to solve a problem
|
||||
% in the amsbook and amsart classes, that make global changes to \topskip,
|
||||
% which are reset in \ps@empty. Hopefully this doesn't break other things.
|
||||
% May 7, 1996:
|
||||
% version 1.98:
|
||||
% Added % after the line \def\nouppercase
|
||||
% May 7, 1996:
|
||||
% version 1.99: This is the alpha version of fancyhdr 2.0
|
||||
% Introduced the new commands \fancyhead, \fancyfoot, and \fancyhf.
|
||||
% Changed \headrulewidth, \footrulewidth, \footruleskip to
|
||||
% macros rather than length parameters, In this way they can be
|
||||
% 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 \setlength or \xxxx=)
|
||||
% May 10, 1996:
|
||||
% version 1.99a:
|
||||
% Added a few more % signs
|
||||
% May 10, 1996:
|
||||
% version 1.99b:
|
||||
% Changed the syntax of \f@nfor to be resistent to catcode changes of :=
|
||||
% Removed the [1] from the defs of \lhead etc. because the parameter is
|
||||
% consumed by the \@[xy]lhead etc. macros.
|
||||
% June 24, 1997:
|
||||
% version 1.99c:
|
||||
% corrected \nouppercase to also include the protected form of \MakeUppercase
|
||||
% \global added to manipulation of \headwidth.
|
||||
% \iffootnote command added.
|
||||
% Some comments added about \@fancyhead and \@fancyfoot.
|
||||
|
||||
\let\fancy@def\gdef
|
||||
|
||||
\def\if@mpty#1#2#3{\def\temp@ty{#1}\ifx\@empty\temp@ty #2\else#3\fi}
|
||||
|
||||
% Usage: \@forc \var{charstring}{command to be executed for each char}
|
||||
% This is similar to LaTeX's \@tfor, but expands the charstring.
|
||||
|
||||
\def\@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}}
|
||||
\def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else
|
||||
\f@@rc#1#2\f@@rc{#3}\fi}
|
||||
\def\f@@rc#1#2#3\f@@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}}
|
||||
|
||||
% Usage: \f@nfor\name:=list\do{body}
|
||||
% Like LaTeX's \@for but an empty list is treated as a list with an empty
|
||||
% element
|
||||
|
||||
\newcommand{\f@nfor}[3]{\edef\@fortmp{#2}%
|
||||
\expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}}
|
||||
|
||||
% Usage: \def@ult \cs{defaults}{argument}
|
||||
% sets \cs to the characters from defaults appearing in argument
|
||||
% or defaults if it would be empty. All characters are lowercased.
|
||||
|
||||
\newcommand\def@ult[3]{%
|
||||
\edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a
|
||||
\def#1{}%
|
||||
\@forc\tmpf@ra{#2}%
|
||||
{\expandafter\if@in\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}%
|
||||
\ifx\@empty#1\def#1{#2}\fi}
|
||||
%
|
||||
% \if@in <char><set><truecase><falsecase>
|
||||
%
|
||||
\newcommand{\if@in}[4]{%
|
||||
\edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}%
|
||||
\expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi}
|
||||
|
||||
\newcommand{\fancyhead}{\@ifnextchar[{\f@ncyhf h}{\f@ncyhf h[]}}
|
||||
\newcommand{\fancyfoot}{\@ifnextchar[{\f@ncyhf f}{\f@ncyhf f[]}}
|
||||
\newcommand{\fancyhf}{\@ifnextchar[{\f@ncyhf {}}{\f@ncyhf {}[]}}
|
||||
|
||||
% The header and footer fields are stored in command sequences with
|
||||
% names of the form: \f@ncy<x><y><z> with <x> for [eo], <y> form [lcr]
|
||||
% and <z> from [hf].
|
||||
|
||||
\def\f@ncyhf#1[#2]#3{%
|
||||
\def\temp@c{}%
|
||||
\@forc\tmpf@ra{#2}%
|
||||
{\expandafter\if@in\tmpf@ra{eolcrhf,EOLCRHF}%
|
||||
{}{\edef\temp@c{\temp@c\tmpf@ra}}}%
|
||||
\ifx\@empty\temp@c\else
|
||||
\ifx\PackageError\undefined
|
||||
\errmessage{Illegal char `\temp@c' in fancyhdr argument:
|
||||
[#2]}\else
|
||||
\PackageError{Fancyhdr}{Illegal char `\temp@c' in fancyhdr argument:
|
||||
[#2]}{}\fi
|
||||
\fi
|
||||
\f@nfor\temp@c{#2}%
|
||||
{\def@ult\f@@@eo{eo}\temp@c
|
||||
\def@ult\f@@@lcr{lcr}\temp@c
|
||||
\def@ult\f@@@hf{hf}{#1\temp@c}%
|
||||
\@forc\f@@eo\f@@@eo
|
||||
{\@forc\f@@lcr\f@@@lcr
|
||||
{\@forc\f@@hf\f@@@hf
|
||||
{\expandafter\fancy@def\csname
|
||||
f@ncy\f@@eo\f@@lcr\f@@hf\endcsname
|
||||
{#3}}}}}}
|
||||
|
||||
% Fancyheadings version 1 commands. These are more or less depracated,
|
||||
% but they continue to work.
|
||||
|
||||
\newcommand{\lhead}{\@ifnextchar[{\@xlhead}{\@ylhead}}
|
||||
\def\@xlhead[#1]#2{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#2}}
|
||||
\def\@ylhead#1{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#1}}
|
||||
|
||||
\newcommand{\chead}{\@ifnextchar[{\@xchead}{\@ychead}}
|
||||
\def\@xchead[#1]#2{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#2}}
|
||||
\def\@ychead#1{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#1}}
|
||||
|
||||
\newcommand{\rhead}{\@ifnextchar[{\@xrhead}{\@yrhead}}
|
||||
\def\@xrhead[#1]#2{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#2}}
|
||||
\def\@yrhead#1{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#1}}
|
||||
|
||||
\newcommand{\lfoot}{\@ifnextchar[{\@xlfoot}{\@ylfoot}}
|
||||
\def\@xlfoot[#1]#2{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#2}}
|
||||
\def\@ylfoot#1{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#1}}
|
||||
|
||||
\newcommand{\cfoot}{\@ifnextchar[{\@xcfoot}{\@ycfoot}}
|
||||
\def\@xcfoot[#1]#2{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#2}}
|
||||
\def\@ycfoot#1{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#1}}
|
||||
|
||||
\newcommand{\rfoot}{\@ifnextchar[{\@xrfoot}{\@yrfoot}}
|
||||
\def\@xrfoot[#1]#2{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#2}}
|
||||
\def\@yrfoot#1{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#1}}
|
||||
|
||||
\newdimen\headwidth
|
||||
\newcommand{\headrulewidth}{0.4pt}
|
||||
\newcommand{\footrulewidth}{\z@skip}
|
||||
\newcommand{\footruleskip}{.3\normalbaselineskip}
|
||||
|
||||
% Fancyplain stuff shouldn't be used anymore (rather
|
||||
% \fancypagestyle{plain} should be used), but it must be present for
|
||||
% compatibility reasons.
|
||||
|
||||
\newcommand{\plainheadrulewidth}{\z@skip}
|
||||
\newcommand{\plainfootrulewidth}{\z@skip}
|
||||
\newif\if@fancyplain \@fancyplainfalse
|
||||
\def\fancyplain#1#2{\if@fancyplain#1\else#2\fi}
|
||||
|
||||
\headwidth=-123456789sp %magic constant
|
||||
|
||||
% Command to reset various things in the headers:
|
||||
% a.o. single spacing (taken from setspace.sty)
|
||||
% and the catcode of ^^M (so that epsf files in the header work if a
|
||||
% 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.
|
||||
\def\fancy@reset{\restorecr
|
||||
\def\baselinestretch{1}%
|
||||
\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
|
||||
\ifx\@normalsize\undefined \normalsize % for ucthesis.cls
|
||||
\else \@normalsize \fi
|
||||
\else% NFSS (2.09) present
|
||||
\@newbaseline%
|
||||
\fi}
|
||||
|
||||
% Initialization of the head and foot text.
|
||||
|
||||
% The default values still contain \fancyplain for compatibility.
|
||||
\fancyhf{} % clear all
|
||||
% lefthead empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages
|
||||
% evenhead empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages
|
||||
\fancyhead[el,or]{\fancyplain{}{\sl\rightmark}}
|
||||
\fancyhead[er,ol]{\fancyplain{}{\sl\leftmark}}
|
||||
\fancyfoot[c]{\rm\thepage} % page number
|
||||
|
||||
% Put together a header or footer given the left, center and
|
||||
% right text, fillers at left and right and a rule.
|
||||
% The \lap commands put the text into an hbox of zero size,
|
||||
% so overlapping text does not generate an errormessage.
|
||||
% These macros have 5 parameters:
|
||||
% 1. \@lodd or \@rodd % This determines at which side the header will stick
|
||||
% out.
|
||||
% 2. \f@ncyolh, \f@ncyelh, \f@ncyolf or \f@ncyelf. This is the left component.
|
||||
% 3. \f@ncyoch, \f@ncyech, \f@ncyocf or \f@ncyecf. This is the middle comp.
|
||||
% 4. \f@ncyorh, \f@ncyerh, \f@ncyorf or \f@ncyerf. This is the right component.
|
||||
% 5. \@lodd or \@rodd % This determines at which side the header will stick
|
||||
% out. This is the reverse of parameter nr. 1. One of them is always
|
||||
% \relax and the other one is \hss (after expansion).
|
||||
|
||||
\def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset\vbox{\hbox
|
||||
{\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill
|
||||
\parbox[b]{\headwidth}{\centering#3\strut}\hfill
|
||||
\llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5}
|
||||
|
||||
\def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset\vbox{\footrule
|
||||
\hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2\strut}}\hfill
|
||||
\parbox[t]{\headwidth}{\centering#3\strut}\hfill
|
||||
\llap{\parbox[t]{\headwidth}{\raggedleft#4\strut}}}}}#5}
|
||||
|
||||
\def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
|
||||
\hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}}
|
||||
|
||||
\def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
|
||||
\vskip-\footruleskip\vskip-\footrulewidth
|
||||
\hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}}
|
||||
|
||||
\def\ps@fancy{%
|
||||
\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook
|
||||
%
|
||||
% Define \MakeUppercase for old LaTeXen.
|
||||
% Note: we used \def rather than \let, so that \let\uppercase\relax (from
|
||||
% the version 1 documentation) will still work.
|
||||
%
|
||||
\@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
|
||||
\@ifundefined{chapter}{\def\sectionmark##1{\markboth
|
||||
{\MakeUppercase{\ifnum \c@secnumdepth>\z@
|
||||
\thesection\hskip 1em\relax \fi ##1}}{}}%
|
||||
\def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
|
||||
\thesubsection\hskip 1em\relax \fi ##1}}}%
|
||||
{\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne
|
||||
\@chapapp\ \thechapter. \ \fi ##1}}{}}%
|
||||
\def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@
|
||||
\thesection. \ \fi ##1}}}}%
|
||||
%\csname ps@headings\endcsname % use \ps@headings defaults if they exist
|
||||
\ps@@fancy
|
||||
\gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
|
||||
% Initialize \headwidth if the user didn't
|
||||
%
|
||||
\ifdim\headwidth<0sp
|
||||
%
|
||||
% This catches the case that \headwidth hasn't been initialized and the
|
||||
% case that the user added something to \headwidth in the expectation that
|
||||
% it was initialized to \textwidth. We compensate this now. This loses if
|
||||
% the user intended to multiply it by a factor. But that case is more
|
||||
% likely done by saying something like \headwidth=1.2\textwidth.
|
||||
% The doc says you have to change \headwidth after the first call to
|
||||
% \pagestyle{fancy}. This code is just to catch the most common cases were
|
||||
% that requirement is violated.
|
||||
%
|
||||
\global\advance\headwidth123456789sp\global\advance\headwidth\textwidth
|
||||
\fi}
|
||||
\def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy}
|
||||
\def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy}
|
||||
\def\ps@@fancy{%
|
||||
\ps@empty % This is for amsbook/amsart, which do strange things with \topskip
|
||||
\def\@mkboth{\protect\markboth}%
|
||||
\def\@oddhead{\@fancyhead\@lodd\f@ncyolh\f@ncyoch\f@ncyorh\@rodd}%
|
||||
\def\@oddfoot{\@fancyfoot\@lodd\f@ncyolf\f@ncyocf\f@ncyorf\@rodd}%
|
||||
\def\@evenhead{\@fancyhead\@rodd\f@ncyelh\f@ncyech\f@ncyerh\@lodd}%
|
||||
\def\@evenfoot{\@fancyfoot\@rodd\f@ncyelf\f@ncyecf\f@ncyerf\@lodd}%
|
||||
}
|
||||
\def\@lodd{\if@reversemargin\hss\else\relax\fi}
|
||||
\def\@rodd{\if@reversemargin\relax\else\hss\fi}
|
||||
|
||||
\newif\iffootnote
|
||||
\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}
|
||||
|
||||
\newcommand{\fancypagestyle}[2]{%
|
||||
\@namedef{ps@#1}{\let\fancy@def\def#2\relax\ps@fancy}}
|
1762
docs/packages/fancyhdr/fancyhdr.tex
Normal file
1762
docs/packages/fancyhdr/fancyhdr.tex
Normal file
File diff suppressed because it is too large
Load Diff
76
docs/packages/fancyhdr/fixmarks.sty
Normal file
76
docs/packages/fancyhdr/fixmarks.sty
Normal file
@ -0,0 +1,76 @@
|
||||
% Patch LaTeX's output routine to handle marks correctly with two columns.
|
||||
% Version 1.0
|
||||
% Joe Pallas <pallas@edu.stanford.neon>
|
||||
|
||||
% Version 1.1
|
||||
% Corrected by Piet van Oostrum <piet@cs.ruu.nl> on Feb 5, 1993
|
||||
% Originally this file was called "fixhead.sty" which doesn't make sense.
|
||||
% The original version of this file used a comparison between \firstmark
|
||||
% and \topmark to check if a mark was given in the first column. However
|
||||
% this fails in the case that a mark is given that is identical to the one
|
||||
% on the previous page. Although this can be considered a pathological case
|
||||
% I didn't want it. The use of the \vsplit should solve this. The only case
|
||||
% that it doesn't solve is if the user inserts empty marks, but LaTeX marks
|
||||
% are always of the form {}{}.
|
||||
% Note: the \topmarks are generally useless in LaTeX because they are
|
||||
% destroyed by the float mechanism.
|
||||
% The above comment added Oct 3, 1994.
|
||||
|
||||
% Version 1.2
|
||||
% Oct 5, 1994: replaced \expandafter's by \xdef, which does the same but
|
||||
% looks less complicated.
|
||||
|
||||
% Version 1.3
|
||||
% Oct 6, 1994: replaced "\global\setbox\@leftcolumn\vsplit\@outputbox
|
||||
% to\ht\@outputbox" by the two \setbox's below. This ensures that no
|
||||
% anomalies may occur in pathological cases. These can occur if there are
|
||||
% large negative glues near the end of the box.
|
||||
% Oct 6, 1994: save and restore \split*mark just in case someone was going
|
||||
% to use it and got interrupted by us. The code doesn't make a difference
|
||||
% between no marks and empty marks, but that difference isn't visible at
|
||||
% the user level. The strange way to do this is necessary as the marks
|
||||
% don't obey grouping rules. (Actually also \clearpage processing destroys
|
||||
% these marks, so the saving/restoring may be of limited value)
|
||||
|
||||
% Version 1.4
|
||||
% Oct 7, 1994: saving of the \split*marks now done by putting them directly
|
||||
% in a box. Added \vbadness=10000 to get rid of underfull vbox warning.
|
||||
% Note: we rely on the grouping mechanism to reset various things, as this
|
||||
% is about the last thing to happen in the output routine.
|
||||
|
||||
% Version 1.5
|
||||
% Oct 11, 1994: suppressed unwanted expansion of the marks. This includes
|
||||
% undoing the change mentioned in version 1.2.
|
||||
|
||||
\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse
|
||||
% save the left column
|
||||
\global\setbox\@leftcolumn\copy\@outputbox
|
||||
% save the \split*marks
|
||||
\setbox\@tempboxa\vbox{
|
||||
\toks@\expandafter{\splitfirstmark}
|
||||
\mark{\the\toks@}
|
||||
\toks@\expandafter{\splitbotmark} % we don't use \splitbotmark but
|
||||
\mark{\the\toks@}} % it gets clobbered by the \vsplit below
|
||||
% Remember the marks from the first column
|
||||
\splitmaxdepth=\maxdimen \vbadness=10000
|
||||
\setbox\@outputbox\vsplit\@outputbox to\maxdimen
|
||||
\expandafter\gdef\expandafter\@firstcoltopmark\expandafter{\topmark}%
|
||||
\expandafter\gdef\expandafter\@firstcolfirstmark
|
||||
\expandafter{\splitfirstmark}%
|
||||
\ifx\@firstcolfirstmark\empty\global\let\@setmarks\relax\else
|
||||
\gdef\@setmarks{\let\firstmark\@firstcolfirstmark
|
||||
\let\topmark\@firstcoltopmark}%
|
||||
\fi
|
||||
% Restore the \split*marks
|
||||
\setbox\@tempboxa\vsplit\@tempboxa to 0pt % this resets the \split*marks
|
||||
% End of change
|
||||
\else \global\@firstcolumntrue
|
||||
\setbox\@outputbox\vbox{\hbox to\textwidth{\hbox to\columnwidth
|
||||
{\box\@leftcolumn \hss}\hfil \vrule width\columnseprule\hfil
|
||||
\hbox to\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
|
||||
% Override current first and top with those of first column if necessary
|
||||
\@setmarks
|
||||
% End of change
|
||||
\@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
|
||||
\@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
|
||||
\fi}
|
Loading…
Reference in New Issue
Block a user