]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/matita/klunote.sty
- s/decompilation/cleaning/
[helm.git] / helm / papers / matita / klunote.sty
1 %
2 %
3 %
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}
13 %\CodelineIndex
14 %\newcommand{\Bs}{$\backslash$}
15 %\parindent=0pt
16 %\parskip=3pt
17 %\hfuzz=11pt
18 %\MakeShortVerb{\|} 
19 %\setlength{\marginparwidth}{0in} 
20 %\addtolength{\textwidth}{4pc}
21 %\begin{document}
22 %\begin{opening}
23 %\title{\filename}
24 %\date{\filedate}
25 %\author{T. \surname{Hoekwater}}
26 %\institute{Kluwer Academic Publishers}
27 %\begin{abstract}
28 % This internal stylefile takes care of footnotes, endnotes and marginpars.
29 %\end{abstract}                                                            
30 %\end{opening}
31 %\tableofcontents
32 %\section{Usage}
33 %
34 %
35 % Footnotes are quite normal in usage, so please see Lamport for
36 % details. 
37 %
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. 
44 %
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}
50 %    \begin{macrocode}
51 \NeedsTeXFormat{LaTeX2e}
52 \ProvidesPackage{klunote}[\filedate ]
53 %    \end{macrocode}
54
55 %
56 % \subsection{Footnotes}
57 %
58 % Most stylefiles need to redefine the following lines, but we
59 % need a default anyway... 
60 %    \begin{macrocode}
61 \def\footnoterule{\kern-3\p@
62   \hrule width 3pc
63   \kern 2.6\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$}}
67 \footnotesep 6pt
68 \skip\footins 10pt plus 4pt minus 2pt
69 %    \end{macrocode}
70 % \subsection{Endnotes}
71 % User options first. 
72 %    \begin{macrocode}
73 \newcounter{endnote}
74 \def\theendnote{\arabic{endnote}}
75 \def\@makeenmark{\hbox{$^{\@theenmark}$}}
76 \newdimen\endnotesep
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}$ }}}
83 %    \end{macrocode}
84 % User level interface: |\endnote|, |\addtoendnotes| and
85 % |\theendnotes|. 
86 %    \begin{macrocode}
87 \def\endnote{%
88    \@ifnextchar[
89       {\@xendnote}%
90       {\stepcounter{endnote}%
91           \xdef\@theenmark{\theendnote}%
92           \@endnotemark
93           \@endnotetext}}
94 \long\def\addtoendnotes#1{%
95      \if@endnotesopen \else \@openendnotes \fi
96      \begingroup
97         \newlinechar='40
98         \let\protect\string
99         \if@filesw \immediate\write\@endnotes{#1}\fi
100      \endgroup}
101 %    \end{macrocode}
102 %
103 % I can't remember what the |\makeatletter| is doing here.
104 %
105 %    \begin{macrocode}
106 \def\theendnotes{%
107   \if@filesw \immediate\closeout\@endnotes \fi
108   \global\@endnotesopenfalse
109   \begingroup
110     \makeatletter
111     \def\@doanendnote##1##2>{%
112         \def\@theenmark{##1}%
113         \par\begingroup
114         \endnoteformat}%
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>}%
122          \def\ETC.{\relax}}%
123        \IfFileExists{\jobname.ent}{%
124     \endnoteheading
125     \endnotesize
126     \@input{\jobname.ent}}{}%
127   \endgroup }
128 %    \end{macrocode}
129 % The less commonly used part of the user interface.
130 %    \begin{macrocode}
131 \def\endnotemark{%
132   \@ifnextchar[{\@xendnotemark}%
133                {\stepcounter{endnote}%
134                 \xdef\@theenmark{\theendnote}%
135                 \@endnotemark}}
136 \def\endnotetext{%
137    \@ifnextchar[{\@xendnotenext}%
138                 {\xdef\@theenmark{\theendnote}%
139                  \@endnotetext}}
140 \def\endnoteheading{\section*{\notesname
141      \imarkboth{\notesname}{\notesname}}\leavevmode\par}
142 %    \end{macrocode}
143 %
144 %    \begin{macrocode}
145 \def\@xendnote[#1]{\begingroup 
146    \c@endnote=#1\relax
147    \xdef\@theenmark{\theendnote}\endgroup
148    \@endnotemark\@endnotetext}
149 \let\@doanendnote=0
150 \let\@endanendnote=0
151 \newwrite\@endnotes
152 \newif\if@endnotesopen \@endnotesopenfalse
153 \def\@openendnotes{%
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
159      \begingroup
160         \def\next{#1}%
161         \newlinechar='40
162         \if@filesw \immediate\write\@endnotes{\meaning\next}\fi
163      \endgroup
164      \if@filesw \immediate\write\@endnotes{\@endanendnote}\fi
165      \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}}
166 \def\@xendnotemark[#1]{%
167     \begingroup 
168     \c@endnote #1\relax
169     \xdef\@theenmark{\theendnote}\endgroup 
170     \@endnotemark}
171 \def\@endnotemark{%
172    \leavevmode
173    \ifhmode \edef\@x@sf{\the\spacefactor}\fi 
174    \@makeenmark
175    \ifhmode\spacefactor\@x@sf\fi\relax}
176 \def\@xendnotenext[#1]{%
177    \begingroup \c@endnote=#1\relax
178    \xdef\@theenmark{\theendnote}\endgroup 
179    \@endnotetext}
180 %    \end{macrocode}
181
182 %
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.
186 %    \begin{macrocode}
187 %\long\def\@savemarbox#1#2{%
188 %  \global\setbox #1
189 %     \vtop{\fbox{\vtop{\hsize\marginparwidth
190 %              \@parboxrestore  
191 %              \raggedright
192 %              \footnotesize 
193 %              #2}}}}
194 \endinput
195 %    \end{macrocode}
196 % \theendnotes
197 %\PrintIndex
198 %\end{document}
199 % end of klunote.sty
200
201