4 \ifcat a\noexpand @\let\next\relax\else \def\next{%
5 \documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
6 \def\filedate{1998/02/11}
7 \def\filename{klunote.sty}
8 %\DoNotIndex{\@M,\def,\c@secnumdepth,\baselineskip,\@pnumwidth,\else,\fi}
9 %\DoNotIndex{\newcommand,\z@,\relax,\renewcommand,\ifnum,\csname,\endcsname}
10 %\DoNotIndex{\baselineskip,\vskip,\hskip,\relax,\secdef,\gdef,\@cla,\@clb}
11 %\DoNotIndex{\normalsize,\protect,\global,\setbox,\hbox,\vbox,\endinput}
12 %\DoNotIndex{\egroup,\endgroup,\bgroup,\begingroup,\let}
14 %\newcommand{\Bs}{$\backslash$}
19 %\setlength{\marginparwidth}{0in}
20 %\addtolength{\textwidth}{4pc}
25 %\author{T. \surname{Hoekwater}}
26 %\institute{Kluwer Academic Publishers}
28 % This internal stylefile takes care of footnotes, endnotes and marginpars.
35 % Footnotes are quite normal in usage, so please see Lamport for
38 % Endnotes were originally code from |endnotes.sty| (\LaTeX 2.09
39 % package), with some minor adjustments to aid\endnote{Example}
40 % kluwer layout. Endnotes can be used just as |\footnote|s, with the
41 % command |\endnote| and family. Say |\theendnotes| where you
42 % want\endnote{another}.
43 % them to appear in your document.
45 % This endnote code {\it does\/} obey |\nofiles|, but will not work
46 % then (prevents an NFS error i've had). This means: any
47 % writing command will be ignored, but the file will be read if
48 % available. Note that this might mean that the endnotes are incorrect!
49 %\newpage\section{Implementation}
51 \NeedsTeXFormat{LaTeX2e}
52 \ProvidesPackage{klunote}[\filedate ]
56 % \subsection{Footnotes}
58 % Most stylefiles need to redefine the following lines, but we
59 % need a default anyway...
61 \def\footnoterule{\kern-3\p@
64 \long\def\@makefntext#1{\parindent 1em\noindent
65 \hbox to 1.5em{\hss$^{\@thefnmark}$}\hskip0.5em\footnotesize#1}
66 \def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}}
68 \skip\footins 10pt plus 4pt minus 2pt
70 % \subsection{Endnotes}
74 \def\theendnote{\arabic{endnote}}
75 \def\@makeenmark{\hbox{$^{\@theenmark}$}}
77 \setlength\endnotesep{1pt}
78 \def\notesname{Notes}% <------ JK
79 \def\endnotesize{\footnotesize}
80 \def\endnoteformat{\vskip\endnotesep
81 \rightskip\z@ \leftskip\z@
82 \parindent=1.8em\leavevmode\llap{\hbox{$^{\@theenmark}$ }}}
84 % User level interface: |\endnote|, |\addtoendnotes| and
90 {\stepcounter{endnote}%
91 \xdef\@theenmark{\theendnote}%
94 \long\def\addtoendnotes#1{%
95 \if@endnotesopen \else \@openendnotes \fi
99 \if@filesw \immediate\write\@endnotes{#1}\fi
103 % I can't remember what the |\makeatletter| is doing here.
107 \if@filesw \immediate\closeout\@endnotes \fi
108 \global\@endnotesopenfalse
111 \def\@doanendnote##1##2>{%
112 \def\@theenmark{##1}%
115 \def\@endanendnote{\par\endgroup}%
116 \def\ETC.{\PackageError{klunote}{%
117 Some endnotes will be truncated}{%
118 Because of memory constraints, LaTeX truncated some\MessageBreak
119 long endnotes while writing the auxiliary file.\MessageBreak
120 Use a bigger TeX main memory size to avoid this,\MessageBreak
121 It is save to continue by pressing <enter>}%
123 \IfFileExists{\jobname.ent}{%
126 \@input{\jobname.ent}}{}%
129 % The less commonly used part of the user interface.
132 \@ifnextchar[{\@xendnotemark}%
133 {\stepcounter{endnote}%
134 \xdef\@theenmark{\theendnote}%
137 \@ifnextchar[{\@xendnotenext}%
138 {\xdef\@theenmark{\theendnote}%
140 \def\endnoteheading{\section*{\notesname
141 \imarkboth{\notesname}{\notesname}}\leavevmode\par}
145 \def\@xendnote[#1]{\begingroup
147 \xdef\@theenmark{\theendnote}\endgroup
148 \@endnotemark\@endnotetext}
152 \newif\if@endnotesopen \@endnotesopenfalse
154 \if@filesw \immediate\openout\@endnotes=\jobname.ent\relax
155 \global\@endnotesopentrue \fi}
156 \long\def\@endnotetext#1{%
157 \if@endnotesopen \else \@openendnotes \fi
158 \if@filesw \immediate\write\@endnotes{\@doanendnote{\@theenmark}}\fi
162 \if@filesw \immediate\write\@endnotes{\meaning\next}\fi
164 \if@filesw \immediate\write\@endnotes{\@endanendnote}\fi
165 \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}}
166 \def\@xendnotemark[#1]{%
169 \xdef\@theenmark{\theendnote}\endgroup
173 \ifhmode \edef\@x@sf{\the\spacefactor}\fi
175 \ifhmode\spacefactor\@x@sf\fi\relax}
176 \def\@xendnotenext[#1]{%
177 \begingroup \c@endnote=#1\relax
178 \xdef\@theenmark{\theendnote}\endgroup
183 % \subsection{marginparbox}
184 % This redefinition puts a |\marginparbox| in a |\fbox|. I am not sure
185 % whether we want this, because it is quite hard to restore if needed.
187 %\long\def\@savemarbox#1#2{%
189 % \vtop{\fbox{\vtop{\hsize\marginparwidth