summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/endheads
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:54:49 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:54:49 +0000
commit73127cb63001a2f07281321a3dc6ded558e64439 (patch)
tree1ba89d9877f3a0cd423608e02d6c8de7de36a829 /Master/texmf-dist/tex/latex/endheads
parentcd7896d119f6e39d9c894bdb0024afc0c8f4fef6 (diff)
endheads
git-svn-id: svn://tug.org/texlive/trunk@861 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/endheads')
-rw-r--r--Master/texmf-dist/tex/latex/endheads/endheads.sty162
1 files changed, 162 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/endheads/endheads.sty b/Master/texmf-dist/tex/latex/endheads/endheads.sty
new file mode 100644
index 00000000000..0dd4ebbf637
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/endheads/endheads.sty
@@ -0,0 +1,162 @@
+%%
+%% This is file `endheads.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% endheads.dtx (with options: `package')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from endheads.sty.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file endheads.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+\ProvidesPackage{endheads}
+ [2005/09/26 v1.15 endheads file]
+\providecommand*{\ifrefundefined}[1]{%
+ \expandafter\ifx\csname r@#1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+\providecommand*{\@extract@ref}[2]{%
+ \expandafter\expandafter\expandafter#1\csname
+r@#2\endcsname{}{}\@nil
+}
+
+\providecommand*{\@extractref}{%
+ \@extract@ref\@car
+}
+
+\providecommand*{\@extractpageref}{%
+ \@extract@ref\@secondcar
+}
+
+\long\def\@secondcar#1#2#3\@nil{#2}
+
+\providecommand*{\setcounterfromref}[2]{%
+ \ifrefundefined{#2}{%
+ \protect\G@refundefinedtrue
+ \@latex@warning{Reference `#2' on page \thepage \space
+ undefined}%
+ \setcounter{#1}{0}%
+ }{%
+ \setcounter{#1}{\@extractref{#2}}%
+ }%
+}
+\providecommand*{\setcounterfrompageref}[2]{%
+ \ifrefundefined{#2}{%
+ \protect\G@refundefinedtrue
+ \@latex@warning{Reference `#2' on page \thepage \space
+ undefined}%
+ \setcounter{#1}{0}%
+ }{%
+ \setcounter{#1}{\@extractpageref{#2}}%
+ }%
+}
+\long\def\appendtomacro#1#2{%
+\begingroup
+ \toks@\expandafter{#1#2}%
+ \xdef#1{\the\toks@}%
+ \endgroup}
+\newcounter{allendnotes}
+\setcounter{allendnotes}{1}
+\newcounter{notepageholder}
+\newcommand{\mymarks}{%
+ \ifthenelse{\equal{\firstmark}{\botmark}}
+ {to p.~\firstmark} % if equal
+ {to pp.~\firstmark--\botmark}}%if not equal
+\fancypagestyle{plain}{%
+\fancyhf{}
+\fancyhead[RO,LE]{{\small\textrm{\thepage}}}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+}
+\fancypagestyle{endnotesstyle}{%
+\fancyhf{}
+\fancyhead[CO]{{\small{\em Notes~\mymarks}}}
+\fancyhead[CE]{{\small{\em Notes~\mymarks}}}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+\fancyhead[RO,LE]{{\small\textrm{\thepage}}}
+}
+\newcommand{\checknoteheaders}{%
+\string\setcounterfrompageref\string{notepageholder\string}%
+\string{notl\theallendnotes\string}%
+\string\mark\string{\string\thenotepageholder\string}%
+}
+\newif\ifendnoteheaderson \endnoteheadersonfalse
+\newcommand{\setupendnoteheaders}{%
+\endnoteheadersontrue
+\if@enotesopen \else \@openenotes \fi
+\immediate\write\@enotes{%
+\string\thispagestyle\string{empty\string}
+\string\pagestyle\string{endnotesstyle\string}}
+\def\endnote{\@ifnextchar[\@xendnote{\stepcounter{endnote}%
+ \stepcounter{allendnotes}\label{notl\theallendnotes}
+ \immediate\write\@enotes{\checknoteheaders}
+ \protected@xdef\@theenmark{\theendnote}%
+ \@endnotemark\@endnotetext}}
+\let\oldtheendnotes=\theendnotes
+\renewcommand{\theendnotes}{%
+\immediate\write\@enotes{\string\thispagestyle\string{endnotesstyle\string}}
+\oldtheendnotes}
+}
+\newif\iftitleinnotes \titleinnotestrue
+\newcommand{\resetendnotes}{%
+\setcounter{endnote}{0}%
+\if@enotesopen \else \@openenotes \fi
+\immediate\write\@enotes{\string\goodbreak}
+\immediate\write\@enotes{\string\Needspace\string{5\string\baselineskip\string}}
+\immediate\write\@enotes{\string\begin\string{center\string}}
+\immediate\write\@enotes{Chapter \thechapter\string~}
+\iftitleinnotes
+\immediate\write\@enotes{\string\titleref\string{chapter\thechapter\string}}
+\fi
+\immediate\write\@enotes{\string\end\string{center\string}}
+\immediate\write\@enotes{\string\nopagebreak}
+}
+\newif\ifnotesbychapteron \notesbychapteronfalse
+\newcommand{\notesbychapter}{\notesbychapterontrue}
+\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi
+ \iftitleinnotes%
+ \label{chapter\thechapter}%
+ \fi%
+ \ifnotesbychapteron%
+ \relax%
+ \resetendnotes%
+ \fi}
+\endinput
+%%
+%% End of file `endheads.sty'.