diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/endheads/endheads.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/endheads/endheads.dtx | 103 |
1 files changed, 83 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/latex/endheads/endheads.dtx b/Master/texmf-dist/source/latex/endheads/endheads.dtx index 3b1006c886f..23fc0a438c4 100644 --- a/Master/texmf-dist/source/latex/endheads/endheads.dtx +++ b/Master/texmf-dist/source/latex/endheads/endheads.dtx @@ -18,7 +18,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01] %<package>\ProvidesPackage{endheads} -%<package> [2007/12/12 v1.3 endheads file] +%<package> [2008/04/12 v1.4 endheads file] % %<*driver> \documentclass{ltxdoc} @@ -32,7 +32,7 @@ %</driver> % \fi % -% \CheckSum{392} +% \CheckSum{487} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -60,6 +60,8 @@ % \changes{v1.152}{2006/11/10}{Fixed strange white space error} % \changes{v1.2}{2006/11/10}{Added commands for multilingual use} % \changes{v1.3}{2007/12/12}{Added commands for multilingual use} +% \changes{v1.4}{2008/04/12}{Added compatibility with memoir class. Added +% commands for multilingual use} % \GetFileInfo{endheads.sty} % % \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\else,\renewcommand,\makeatletter,\makeatother} @@ -95,18 +97,18 @@ % \textsc, \unskip} % \setcounter{IndexColumns}{2} % \MakeShortVerb{|} -% \def\fileversion{1.3} -% \def\filedate{12 December 2007} -% \def\docdate{12 December 2007} +% \def\fileversion{1.4} +% \def\filedate{12 April 2008} +% \def\docdate{12 April 2008} % \title{Running Headers for Endnotes\thanks{This document % corresponds to \textsf{endheads}~\fileversion, dated \filedate.}} % \author{John Burt \\ \texttt{burt@brandeis.edu}} -% \date{December 12, 2007} +% \date{April 12, 2008} % \maketitle % \begin{abstract} % \textsf{endheads} provides running headers of the form ``Notes to % pp.~xx--yy'' for endnotes. \textsf{endheads} is designed to work -% with \textsf{endnotes} and \textsf{fancyhdr}. +% with \textsf{endnotes}. % \end{abstract} % \tableofcontents % \hfuzz=50pt @@ -120,6 +122,7 @@ % the beginning of each chapter. % % \textsf{endheads} requires the following packages to work correctly: +% with the standard document classes, or the komascript classes: % \textsf{endnotes} (obviously), \textsf{fancyhdr} (also obviously), % \textsf{ifthen} (for comparing page numbers), \textsf{needspace} (to % prevent widowed chapter titles in notes sections when resetting @@ -127,6 +130,12 @@ % |\resetendnotes|), and \textsf{titleref} (to send the chapter titles % to the notes section). % +%With \textsf{memoir} class, \textsf{endheads} requires fewer packages, +% since many of the package functions are built into \textsf{memoir} and some, +% \textsf{fancyhdr} most especially, conflict with it. Minimally, you will need \textsf{endnotes} +% and \textsf{ifthen}. You might wish to call \textsf{memoir} with the oldfontcommands +% option. +% % \section{Setup} \DescribeMacro{\setupendnoteheaders} This is the % only macro you need to call to use this package. If you use % |\setupendnoteheaders| you should remember to start your endnotes on @@ -149,9 +158,11 @@ % number}\textgreater ~ \textless\emph{chapter title}\textgreater'' in the % notes at that point. If you want only the chapter number, not its % title, issue |\titleinnotesfalse| in your preamble. Please note -% that \textsf{endheads} modifies |\@chapter|, adding a few lines on +% that with the standard classes +% \textsf{endheads} modifies |\@chapter|, adding a few lines on % to the end of the command. If some other package does the same, you -% will need to reconcile them. +% may need to reconcile them. With \textsf{memoir} class, |\chapter| is modified +% only if |\notesbychapter| is issued. % % \begin{sloppypar} % \DescribeMacro{\setstyleforchapternotebegin} @@ -168,7 +179,9 @@ % |\setstyleforchapternotebegin{\bf}| in your preamble. (It's safe, % indeed required, to use the old style font commands here, since the % chapter title line in the notes is confined to a group, which -% restricts the scope of the font style command to the line.) +% restricts the scope of the font style command to the line. If you are +% using \textsf{memoir} class, you should use the oldfontcommands option if you +% plan on issuing |\setstyleforchatpernotebegin| and |\setstyleforchapternoteend|.) % Remember that if you open an environment with % |\setstyleforchapternotebegin| you must close it in % |\setstyleforchapternoteend|. So, for instance, if you wish the @@ -197,13 +210,17 @@ % As of version 1.2 these % are easily changed. \end{sloppypar} % -% \begin{sloppypar} +% % \DescribeMacro{\changenotesname} To change the name for the endnote % section for notes (the default is Notes), issue % |\changenotesname{your version}|. To change the running header (by -% default ``Notes to'') issue |\changenotesheader{your version}|. To +% default ``Notes to'') issue |\changenotesheader{your version}|. + +%To % change the name for the notes in the table of contents ( by % default ``Notes'') issue |\changenotescontentsname{your version}|. +% +% \begin{sloppypar} % \DescribeMacro{\changesinglepageabbrev} % \DescribeMacro{\changemultiplepageabbrev} Running headers refer to % single pages with the English abbreviation ``p.'' and to multiple @@ -212,7 +229,14 @@ % |\changemultiplepageabbrev{new abbrev}| respectively. The ultimate % outcome is to translate a header of the form ``Notes to % pp.~xx-yy'' to the form appropriate for your -% language.\end{sloppypar} +% language. \end{sloppypar} +% +% \begin{sloppypar} +% \DescribeMacro{\changechapternotesline}If you are using |\resetendnotes| +% or |\setnotesbychapter| you may also want to +% change the text of the line those commands add to the endnotes so as to use some +% other word than ``Chapter.'' To change this, +% issue |\changechapternotesline{your version}|.\end{sloppypar} % % \StopEventually{\PrintChanges\PrintIndex} % \section{Implementation} @@ -290,10 +314,16 @@ r@#2\endcsname{}{}\@nil \newtoks{\multiplepageabbrev} \newcommand{\changemultiplepageabbrev}[1]{\multiplepageabbrev={#1}} \multiplepageabbrev{pp.} -\newcommand{\mymarks}{% +\@ifclassloaded{memoir}{\newcommand{\mymarks}{% + \ifthenelse{\equal{\rightmark}{\leftmark}}% + {\unskip ~\the\singlepageabbrev~\rightmark}% if equal + {\unskip ~\the\multiplepageabbrev~\rightmark--\leftmark}}%if not equal +} +{\newcommand{\mymarks}{% \ifthenelse{\equal{\firstmark}{\botmark}}% {\unskip ~\the\singlepageabbrev~\firstmark}% if equal {\unskip ~\the\multiplepageabbrev~\firstmark--\botmark}}%if not equal +} % \end{macrocode} % \end{macro} % \begin{macro}{\endnotespagestyle} @@ -311,7 +341,20 @@ r@#2\endcsname{}{}\@nil \newtoks{\notescontentsname} \notescontentsname={Notes} \newcommand{\changenotescontentsname}[1]{\textnotescontentsname={#1}} -\fancypagestyle{plain}{% +\newtoks{\chapternoteslinename} +\chapternoteslinename={Chapter} +\newcommand{\changechapternotesline}[1]{\chapternoteslinename={#1}} +\@ifclassloaded{memoir}{\makepagestyle{plain} +\makeevenhead{plain}{}{}{{\small\textrm{\thepage}}} +\makeoddhead{plain}{{\small\textrm{\thepage}}}{}{} +\makeevenfoot{plain}{}{}{} +\makeoddfoot{plain}{}{}{} +\makepagestyle{endnotesstyle} +\makeevenhead{endnotesstyle}{{\small\textrm{\thepage}}}{{\small{\em \the\notesheadername~\mymarks}}}{} +\makeoddhead{endnotesstyle}{}{{\small{\em \the\notesheadername~\mymarks}}}{{\small\textrm{\thepage}}} +\makeevenfoot{}{}{} +\makeoddfoot{}{}{} +}{\fancypagestyle{plain}{% \fancyhf{} \fancyhead[RO,LE]{{\small\textrm{\thepage}}} \renewcommand{\headrulewidth}{0pt} @@ -324,7 +367,9 @@ r@#2\endcsname{}{}\@nil \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \fancyhead[RO,LE]{{\small\textrm{\thepage}}} -} +} +} + % \end{macrocode} % \end{macro} % \begin{macro}{\checknoteheaders} @@ -338,11 +383,18 @@ r@#2\endcsname{}{}\@nil % |\theendnotes|, you read in the external file for the endnotes, % |\jobname.ent|, all these tokens become a command to set the |\mark|. % \begin{macrocode} -\newcommand{\checknoteheaders}{% +\@ifclassloaded{memoir}{\newcommand{\checknoteheaders}{% +\string\setcounterfrompageref\string{notepageholder\string}% +\string{notl\theallendnotes\string}% +\string\markboth\string{\string\thenotepageholder\string}\string{\string\thenotepageholder\string}% +} +}{\newcommand{\checknoteheaders}{% \string\setcounterfrompageref\string{notepageholder\string}% \string{notl\theallendnotes\string}% \string\mark\string{\string\thenotepageholder\string}% } +} + % \end{macrocode} % \end{macro} % \subsection{User Code} @@ -396,6 +448,7 @@ r@#2\endcsname{}{}\@nil \setstyleforchapternotebegin{\begin{center}} \setstyleforchapternoteend{\end{center}} \newcommand{\resetendnotes}{% +\label{chapter\thechapter}% \setcounter{endnote}{0}% \if@enotesopen \else \@openenotes \fi \immediate\write\@enotes{\string\begingroup} @@ -404,7 +457,7 @@ r@#2\endcsname{}{}\@nil \immediate\write\@enotes{\string\styleforchapternotebegin} % \immediate\write\@enotes{\string\begin\string{center\string}} %\immediate\write\@enotes{\string{} -\immediate\write\@enotes{Chapter \thechapter\string~} +\immediate\write\@enotes{\the\chapternoteslinename\string\ \thechapter\string~} \iftitleinnotes \immediate\write\@enotes{\string\titleref\string{chapter\thechapter\string}} \fi @@ -424,7 +477,15 @@ r@#2\endcsname{}{}\@nil % \resetendnotes}% % } \newif\ifnotesbychapteron \notesbychapteronfalse -\newcommand{\notesbychapter}{\notesbychapterontrue} +\@ifclassloaded{memoir}{\newcommand{\notesbychapter}{\notesbychapterontrue +\addtoiargdef{\chapter}{}{ \iftitleinnotes% +% \label{chapter\thechapter}% + \fi% + \ifnotesbychapteron% + \relax% + \resetendnotes% + \fi}} +}{\newcommand{\notesbychapter}{\notesbychapterontrue} \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne \if@mainmatter \refstepcounter{chapter}% @@ -447,12 +508,14 @@ r@#2\endcsname{}{}\@nil \@afterheading \fi \iftitleinnotes% - \label{chapter\thechapter}% +% \label{chapter\thechapter}% \fi% \ifnotesbychapteron% \relax% \resetendnotes% \fi} +} + % \end{macrocode} % \end{macro} % \Finale |