summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/endheads
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-03-12 23:56:18 +0000
committerKarl Berry <karl@freefriends.org>2009-03-12 23:56:18 +0000
commitacc836880ba7376f28c11c51041a9602b55d6a72 (patch)
tree27a6b4cbf050034b40cfc5378f54afa623a6f30c /Master/texmf-dist/tex/latex/endheads
parent30349c5a4c71130214ebd146f4dfc3b51c543d8d (diff)
endheads 1.52 (11mar09)
git-svn-id: svn://tug.org/texlive/trunk@12374 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/endheads')
-rw-r--r--Master/texmf-dist/tex/latex/endheads/endheads.sty38
1 files changed, 28 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/endheads/endheads.sty b/Master/texmf-dist/tex/latex/endheads/endheads.sty
index 5cefa929b09..24139d6601d 100644
--- a/Master/texmf-dist/tex/latex/endheads/endheads.sty
+++ b/Master/texmf-dist/tex/latex/endheads/endheads.sty
@@ -22,7 +22,7 @@
%% in the same archive or directory.)
\NeedsTeXFormat{LaTeX2e}[1997/12/01]
\ProvidesPackage{endheads}
- [2008/04/14 v1.45 endheads file]
+ [2009/03/12 v1.53 endheads file]
\providecommand*{\ifrefundefined}[1]{%
\expandafter\ifx\csname r@#1\endcsname\relax
\expandafter\@firstoftwo
@@ -65,11 +65,13 @@ r@#2\endcsname{}{}\@nil
\setcounter{#1}{\@extractpageref{#2}}%
}%
}
-\long\def\appendtomacro#1#2{%
+\newtoks\romannumeralholder
+\long\def\localappendtomacro#1#2{%
\begingroup
- \toks@\expandafter{#1#2}%
- \xdef#1{\the\toks@}%
- \endgroup}
+\toks@{\endgroup\def#1}%
+\the\expandafter\toks@
+ \expandafter{#1#2}%
+}%
\newcounter{allendnotes}
\setcounter{allendnotes}{1}
\newcounter{notepageholder}
@@ -140,6 +142,13 @@ r@#2\endcsname{}{}\@nil
}
}
+\@ifclassloaded{memoir}{\newcommand{\checknoteheadersroman}{%
+\string\romannumeralholder={\@extractpageref{notl\theallendnotes}}
+\string\markboth\string{\string\the\string\romannumeralholder\string}\string{\string\the\string\romannumeralholder\string}%
+}}{\newcommand{\checknoteheadersroman}{%
+\string\romannumeralholder={\@extractpageref{notl\theallendnotes}}
+\string\mark\string{\string\the\string\romannumeralholder\string}%
+}}
\newif\ifnotesincontentson \notesincontentsonfalse
\newcommand{\notesincontents}{\notesincontentsontrue}
\newif\ifendnoteheaderson \endnoteheadersonfalse
@@ -154,8 +163,12 @@ r@#2\endcsname{}{}\@nil
\string{chapter\string}\string{\string\the\string\notescontentsname\string}}%
\immediate\write\@enotes{\string\fi}
\def\endnote{\@ifnextchar[\@xendnote{\stepcounter{endnote}%
- \stepcounter{allendnotes}\label{notl\theallendnotes}%
+ \stepcounter{allendnotes}\label{notl\theallendnotes}%
+\if@mainmatter
\immediate\write\@enotes{\checknoteheaders}%
+\else
+ \immediate\write\@enotes{\checknoteheadersroman}%
+\fi
\protected@xdef\@theenmark{\theendnote}%
\@endnotemark\@endnotetext}}
\let\oldtheendnotes=\theendnotes
@@ -183,6 +196,7 @@ r@#2\endcsname{}{}\@nil
\renewcommand{\styleforchapternoteend}{#1}}%
\setstyleforchapternotebegin{\begin{center}}
\setstyleforchapternoteend{\end{center}}
+
\newcommand{\resetendnotes}{%
\label{chapter\thechapter}%
\setcounter{endnote}{0}%
@@ -191,10 +205,14 @@ r@#2\endcsname{}{}\@nil
\immediate\write\@enotes{\string\goodbreak}
\immediate\write\@enotes{\string\Needspace\string{5\string\baselineskip\string}}
\immediate\write\@enotes{\string\styleforchapternotebegin}
-\immediate\write\@enotes{\the\chapternoteslinename\string\ \thechapter\string~}
-\iftitleinnotes
-\immediate\write\@enotes{\string\titleref\string{chapter\thechapter\string}}
-\fi
+\ifthenelse{\equal{\thechapter}{0}}{%
+\immediate\write\@enotes{\string\titleref\string{chapter\thechapter\string}}%
+}{%
+\immediate\write\@enotes{\the\chapternoteslinename\string\ \thechapter\string~}%
+\iftitleinnotes%
+\immediate\write\@enotes{\string\titleref\string{chapter\thechapter\string}}%
+\fi%
+}%
\immediate\write\@enotes{\string\styleforchapternoteend}
\immediate\write\@enotes{\string\nopagebreak}
\immediate\write\@enotes{\string\endgroup}