3 \ifcat a\noexpand @\let\next\relax\else \def\next{%
4 \documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
5 \NeedsTeXFormat{LaTeX2e}
7 % \changes{1997/07/10}{bugfix in title@thanks: move thanks into ititle@.}
8 % \changes{1997/07/10}{bugfix in opening: inserted hsize == textwidth. This
9 % to enforce double width in abstract (twocolumn layouts)}
10 % \changes{1997/07/10}{changes in ititle@ to correct spacing of thanks. This
11 % removed the need for title@@ and title@thanks: both removed}
12 % \changes{1997/07/10}{speccright etc. removed (never used)}
13 % \changes{1997/07/10}{crude vertical spacing fix for @arttype if copyrighthead}
14 % \changes{1998/01/06}{fix thispagestyle (crt. endup on 2nd page if abstract too long)}
15 % \changes{1998/02/04}{added new hooks: "beforeartskip", "titlebaselinefactor"}
16 % \changes{1998/02/04}{made "classification", "keywords", "abbreviations" and "nomenclature" long}
17 % \changes{1998/02/06}{force "email" lowercase}
18 % \changes{1998/02/06}{removed () around defaulted dates}
19 \def\filedate{1998/02/11}
20 \def\filename{kluopen.sty}
21 %\DoNotIndex{\@M,\def,\c@secnumdepth,\baselineskip,\@pnumwidth,\else,\fi}
22 %\DoNotIndex{\newcommand,\z@,\relax,\renewcommand,\ifnum,\csname,\endcsname}
23 %\DoNotIndex{\baselineskip,\vskip,\hskip,\relax,\secdef,\refstepcounter}
24 %\DoNotIndex{\normalsize,\numberline,\protect,\endinput,\hfill}
25 %\DoNotIndex{\@compare,\ifx,\global,\gdef,\def,\let,\hbox,\par,\typeout}
27 %\newcommand{\Bs}{$\backslash$}
32 %\setlength{\marginparwidth}{0in}
33 %\addtolength{\textwidth}{4pc}
38 %\author{Kluwer Academic Publishers\surname{}}
40 %\runningtitle{\filename\ -- \filedate}
41 %\runningauthor{Kluwer Academic Publishers}
45 % This internal stylefile defines most of the special kluwer
50 %\newpage\section{Implementation}
52 \ProvidesPackage{kluopen}[\filedate ]
54 % \subsection{The opening environment}
55 % The beginning of this environment is rather empty, there is not much
56 % need to do anything here. All definitions inside the `opening' have
57 % to be indirect |\def|s anyway, so we will start worrying about
58 % typesetting things at the end of the environment.
61 \gdef\title#1{\title@{#1}}
62 \gdef\author#1{\author@{#1}}
63 \gdef\date#1{\date@{#1}}
68 \let\arttype=\arttype@
69 \let\subtitle=\subtitle@
70 \let\dedication=\dedication@
71 \let\translation=\translation@
72 \let\received=\received@
74 \let\accepted=\accepted@
75 \let\revised=\revised@
76 \let\institute=\institute@
80 % Since |\listfiles| is a definite `preambleonly' command, we can test
81 % for that. IF |\listfiles| = |\@notprerr| typeset opening, ELSE
82 % typeset opening at begin document.
84 % If new commands are added to this list, don't forget to add them
85 % above too. Also, please gobble all arguments carefully. Als note
86 % that these redefinitions only take place if there is an |opening|
89 % The new syntax for |opening| is to use it {\it after\/}
90 % |\begin{document}| and/or |\begin{article}|, but we still honour the
91 % old syntax. Also, because I wanted to support |\maketitle| the
92 % ordinary way, |\maketitle| is |\let| to |\endopening|.
94 \gdef\maketitle{\endopening}
96 \ifx\listfiles\@notprerr \maketitle@@ \else
97 \AtBeginDocument{\maketitle@@}\fi
98 \gdef\title##1{\opening@only\title}
99 \gdef\subtitle##1{\opening@only\subtitle}
100 \gdef\orf##1{\opening@only\orf}
101 \gdef\dedication##1{\opening@only\dedication}
102 \gdef\translation##1{\opening@only\translation}
103 \gdef\received##1{\opening@only\received}
104 \gdef\revised##1{\opening@only\revised}
105 \gdef\author##1{\opening@only\author}
106 \gdef\institute##1{\opening@only\institute}
107 \gdef\date##1{\opening@only\date}%
108 \gdef\arttype##1{\opening@only\arttype}
111 % Let `opening only' == warning.
113 \def\opening@only#1{\PackageWarning{kluopen}{\string#1\space
114 effective only inside opening environment.}}
116 % \subsection{Internal Author and institute commands}
117 % author and institute commands are seriously intertwined. Too bad
118 % about the relocation that used to happen in |humnkap|, because has
119 % been sacrificed again. It turned out be more of a fuzz than it was
122 % The general idea is to keep four different command lists that stack
123 % the authors and institutes.
125 % Let's do the easy thing first. These are the `user' changeable
126 % parameters for authors and institutes.
128 \def\authorsize{\normalsize \raggedright}
129 \def\authorcase#1{#1}
130 \def\authorindent{0pt}
131 \def\afterallauthorsskip{1em\relax}
132 \def\afterauthorskip{0pt}
133 \def\institutesize{\footnotesize\it}
134 \def\institutecase#1{#1}
135 \def\instituteindent{0pt}
136 \def\institutesep{.4\baselineskip}
139 % This is a hook for klups.sty (oldstyle numerals)
144 % We only need |\@temptokenb|, because |\@temptokena| is a \LaTeX\
149 % The list will, for example, look like this:
151 %\@authors == {\@k@p {A. \surname{Thor}}\@k@p {B. \surname{Thor}}}
154 \long\def\append@item#1\to#2{%
155 \@temptokena={\@k@p{#1}}%
156 \@temptokenb=\expandafter{#2}%
157 \xdef#2{\the\@temptokenb\the\@temptokena}}
159 % Extraction macros. Typical usage:
162 %\get@left\@instituteauthors\to\@curauths
165 % This will expand into:
168 %\g@l\@k@p \ITEM1\@k@p \ITEM2 ...\g@l \@instituteauthors \@curauths
171 % And from there into
174 %\def\@curauths \ITEM1 \def\@institeauthors{\ITEM2 ...}
177 % Gee, this looks so easy if you write it out :-).
179 \def\get@left#1\to#2{\expandafter\g@l#1\g@l#1#2}
180 \long\def\g@l\@k@p#1#2\g@l#3#4{\def#4{#1}\def#3{#2}}
182 % This will contain the authors for the current institute.
186 % This will contain all authors.
190 % This will contain all institutes.
194 % This will contain items containing all of the authors that are
195 % tied up to one institute.
197 \def\@instituteauthors{}%
199 % These two are temporaries that need to be initialized.
204 % These are the insertion macros. |\author@| is the internal version
205 % of |\author|, and just adds to the two author lists.
207 % |\institute@| is a bit trickier, it has to store the institute
208 % itself for later retrieval, but it also has to clear |\@authors|, so
209 % it can be used again for the next institute. It does this by moving
210 % all of the collected authors in the |\@authors| list as one item
211 % into the |\authors@institute| list.
213 % Because |\@institutes| and |\@instituteauthors| are parallel, there
214 % will be an error condition if there are authors after the last
215 % institute. The |\expandafter|'s are needed to get |\@authors| folded
218 \def\author@#1{\append@item#1\to\@authors
219 \append@item#1\to\@allauthors }
220 \def\institute@#1{\append@item#1\to\@institutes
221 \expandafter\append@item\expandafter{\@authors}\to\@instituteauthors
226 % The box in the first part is needed because we have to typeset once
227 % in order to get the |\thanks|.
229 % The |\expandafter|'s in the second part bypass grouping. Param \#2
230 % is either a comma or nothing. The italic correction is needed if
231 % authors are typeset in Italics, or the thankssymbol will come out to
234 % \changes{1997/08/13}{Removed null box for thankssymbol and switched
235 % places with comma (hor. spacing bugs)}
239 \def\@formatname#1#2{\begingroup
240 \def\thanks##1{\global\thankstrue}\setbox0\vbox{#1}%
244 \edef\fn##1\thanks##2{\authorcase{##1}\/%
245 \noexpand\thanks{##2}#2}\expandafter\fn#1
247 \edef\fn##1{{\authorcase{##1}}#2}%
248 \expandafter\fn\expandafter{#1}%
250 \endgroup\global\thanksfalse }
253 % Format authors presently in |\@curauths| (These are the ones belonging
254 % to one specific institute).
256 % First, loop over |\@curauths| counting the number of authors. Then
257 % we know how many, so loop over again, typesetting all. The |,| needs
258 % to be given separately to make sure |\thanks| works inside an
261 % It there are 0 authors, nothing will happen at all.
263 \newcount\cnt@authors
264 \def\@formatauthors{\begingroup
267 \gdef\surname##1{##1}%
268 \gdef\email##1{ \hbox{({\tt \lowercase{##1}})}}%
270 \def\@k@p##1{\advance\cnt@authors by 1}\@curauths
271 \def\@k@p##1{\advance\cnt@authors by -1
273 \@formatname{##1}{,}\penalty0\ \fi % signif. space
274 \ifnum\cnt@authors=1 % before \fi's !!
275 \@formatname{##1}{} \authorand \penalty0\ \fi
277 \@formatname{##1}{}\par\fi}\@curauths
278 \vskip \afterauthorskip
281 % Format one institute.
283 \def\@formatinstitute{{\institutesize \institutecase{\@curinst}\par}}
285 % Format all authors and all institutes. Indentation is done through
286 % parindent and hangindent instead of rightskip, because otherwise a
287 % |\centering| would fail.
289 % There is a space of |\institutesep| + |\parskip| between every
290 % author\,/\,institute block, and double that space between the last
291 % two (don't understand that).
293 % This macro also takes care of the case that there is no institute at
294 % all given, which is likely to happen in the \LaTeX\ compatibility
295 % mode. {\it This does not allow you to have only the last author without
298 % The |\relax| after |\@institutes| is absolutely necessary, or the
299 % author will be set twice!
301 \newcount\cnt@institutes
302 \def\@authorsandinstitutes{\begingroup
305 \def\@k@p##1{\advance\cnt@authors by 1}\@allauthors
307 \def\@k@p##1{\advance\cnt@institutes by 1}\@institutes\relax
308 \ifnum\cnt@institutes=0
309 \let\@curauths\@allauthors
310 \parindent=\authorindent
311 \hangindent=\authorindent
314 \loop\ifnum\cnt@institutes>0
315 \get@left\@instituteauthors\to\@curauths
316 \parindent=\authorindent
317 \hangindent=\authorindent
319 \get@left\@institutes\to\@curinst
320 \parindent=\instituteindent
321 \hangindent=\instituteindent
323 \ifnum\cnt@institutes=2 \vskip \institutesep\relax \fi
324 \ifnum\cnt@institutes>1 \vskip \institutesep\relax \fi
325 \advance\cnt@institutes by -1
327 \vskip \afterallauthorsskip
331 \gdef\@instituteauthors{}%
336 % \subsection{Typesetting the title and subtitle}
337 % First, here are the user settings again:
339 \def\titleflushstyle{}
340 \def\titlefont{\Large\rm}
342 \def\titleindent{0pt}
343 \def\aftertitleskip{1.8pc }
344 \def\presubtitleskip{-1.4pc }
345 \def\aftersubtitleskip{1pc }
346 \def\subtitlefont{\large\it}
347 \def\subtitleflushstyle{}
349 % Internal commands. |\@maketitle| will call |\@title|. |\title@| is
350 % just an internal for |\title|.
352 \def\title@#1{\gdef\@title{%
353 \@formattitle{#1}\par \vskip \aftertitleskip }}
356 % The trick with the vbox is the same as above, to get |\thanks|.
358 \def\@formattitle#1{\begingroup
359 \def\thanks##1{\global\thankstrue}%
360 \setbox\@tempboxa\vbox{#1}\endgroup
364 \def\fn##1\thanks##2{\ititle@{##1}{\,\thanks{##2}}}%
367 \def\fn##1{\ititle@{##1}{}}\expandafter\fn\expandafter{#1}%
369 \endgroup\global\thanksfalse }
371 % Not much left to do here. The flush style has been set by
372 % |\@formattitle|, skips before and after by |\@title|.
374 \def\titlebaselinefactor{1.05}
375 \def\ititle@#1#2{\begingroup
376 \parindent \titleindent
377 \hangindent \titleindent
379 {\titlefont\titlecase{#1}#2%
380 \baselineskip=\titlebaselinefactor\baselineskip
384 % Basically, this is just an echo of title.
387 \def\subtitle@#1{\gdef\@subtitle{\vskip \presubtitleskip
388 \@formatsubtitle{#1}\par \vskip \aftersubtitleskip }}
389 \def\@formatsubtitle#1{\begingroup
390 \def\thanks##1{\global\thankstrue}\setbox0\vbox{#1}\endgroup
391 \begingroup \subtitleflushstyle
393 \def\fn##1\thanks##2{\subtitle@thanks{##1}{##2}}\expandafter\fn#1
395 \def\fn##1{\subtitle@@{##1}}\expandafter\fn\expandafter{#1}\fi
397 \par\global\thanksfalse}
398 \def\subtitle@thanks#1#2{\isubtitle@{#1}\thanks{#2}\par
400 \def\subtitle@@#1{\isubtitle@{#1}\par\ignorespaces}
401 \def\isubtitle@#1{{\subtitlefont #1}}
403 % \subsection{Date, article type, dedication and translation.}
404 % These are all fairly straightforward, so I will not pay too much
405 % attention to these commands.
407 \def\afterdateskip{.7\baselineskip}
408 \def\datesize{\footnotesize}
409 \def\@date{{\i@oldseries\datesize Received: \@received ;
410 Accepted\@accepted}\vskip \afterdateskip
411 \gdef\@received{\ldots\ldots}%
412 \gdef\@accepted{\ldots\ldots}}
413 \def\date@#1{\gdef\@date{{\i@oldseries\datesize #1\par}\vskip \afterdateskip
414 \gdef\@received{\ldots\ldots}%
415 \gdef\@accepted{\ldots\ldots}}}
416 \def\@received{\ldots\ldots}
417 \def\@accepted{: \ldots\ldots}
418 \def\revised@#1{\gdef\@accepted{ in revised form: #1}}
419 \def\received@#1{\gdef\@received{#1}}
420 \def\accepted@#1{\gdef\@accepted{ in final form: #1}}
424 \def\artsize{\normalsize\it}
425 \def\afterartskip{1.5pc}
426 \def\beforeartskip{0pc}
428 \def\arttype@#1{\gdef\@arttype{\vskip\beforeartskip\noindent
429 {\artsize #1\vskip\afterartskip}}}
434 \def\dedicationsize{\normalsize\it\raggedright}
435 \def\prededicationskip{18pt}
436 \def\afterdedicationskip{18pt}
437 \def\dedication@#1{\gdef\@dedication{%
438 \unskip\vskip \prededicationskip
439 {\dedicationsize #1\par}%
440 \vskip \afterdedicationskip}}
445 \def\translationsize{\normalsize\it\raggedright}
446 \def\pretranslationskip{18pt}
447 \def\aftertranslationskip{18pt}
448 \def\translation@#1{\gdef\@translation{%
449 \unskip\vskip \pretranslationskip
450 {\translationsize #1\par}%
451 \vskip \aftertranslationskip}}
453 % \subsection{Abstract, keywords, abbreviations, classification
455 % All of these are suppposed to have the same size. The only one with
456 % a flexible before/after skip is |abstract|, but they all have their
457 % own font defined for the name.
459 \providecommand{\abstractname}{Abstract}
460 \providecommand{\keywordsname}{Keywords}
461 \providecommand{\abbreviationsname}{Abbreviations}
462 \providecommand{\nomenclaturename}{Nomenclature}
463 \def\abstractsize{\footnotesize}
464 \def\abstractnamefont{\bf}
466 \def\keynamefont{\bf}
467 \def\nomennamefont{\bf}
468 \def\abbrevnamefont{\bf}
469 \def\classnamefont{\bf}
470 \def\afterabstractskip{.7\baselineskip\relax}
471 \def\preabstractskip{0pt\relax}
473 % Abstract is a box, because we still want to support the opening
474 % environment before |\begin{document}|.
476 %{\it Note that the stylefile is resposible for making sure that these
477 %are typeset at all}.
481 \newenvironment{abstract}{%
482 \gdef\@abstract{\message{\abstractname}%
483 {\vskip\preabstractskip
486 \vskip\afterabstractskip }}%
487 \global\setbox\@abstractbox\vbox\bgroup \abstractsize \noindent
488 {\abstractnamefont\abstractname\abstractdot}}{\par\egroup }
490 \long\def\keywords#1{%
491 \gdef\@keywords{\message{\keywordsname}%
492 {\abstractsize\noindent{\keynamefont
493 \keywordsname:~}#1\par \vskip.7\baselineskip}}}
494 \def\@abbreviations{}
495 \def\abbrev#1#2{#1 -- #2}
496 \long\def\abbreviations#1{%
497 \gdef\@abbreviations{\message{\abbreviationsname}%
498 {\abstractsize\noindent{\abbrevnamefont \abbreviationsname:~}%
499 #1\par \vskip.7\baselineskip}}}
501 \def\nomen#1#2{#1 -- #2}
502 \long\def\nomenclature#1{%
503 \gdef\@nomenclature{\message{\nomenclaturename}%
504 {\abstractsize\noindent{\nomennamefont
505 \nomenclaturename:\par}\noindent #1\par \vskip.7\baselineskip}}}
506 \def\@classification{}
507 \long\def\classification#1#2{%
508 \gdef\@classification{\message{Classification}%
509 {\abstractsize\noindent{\classnamefont #1: }%
510 #2\par \vskip.7\baselineskip}}}
511 \def\motto{\@ifnextchar[{\prosemotto}{\poemmotto}}
514 \long\def\poemmotto{\global\setbox\mottobox\vbox \bgroup
516 \hbox to\hsize\bgroup\begingroup
517 \hfill\vbox\bgroup\hsize =15pc
518 \footnotesize \raggedright \noindent
520 \long\def\prosemotto[#1]{\global\setbox\mottobox\vbox \bgroup
522 \hbox to\hsize\bgroup \begingroup
523 \hfill\vbox\bgroup\hsize =15pc
524 \raggedright \footnotesize \noindent
526 \def\endmotto{\par \egroup \endgroup \egroup
527 \vspace{1\baselineskip}\egroup
528 \gdef\@motto{\par\message{Motto}\box\mottobox \gdef\@motto{}}}
530 % \subsection{@maketitle}
531 % Internal commands for typesetting of the front part. |\@maketitle|
532 % has been kept as simple as possible, making it easy to redefine the
533 % order inside a stylefile. For twocolumn output, everything that is
534 % done inside |\@maketitle| is typeset over two columns.
536 % As noted above, if the stylefile feels like removing some of these
537 % commands, it also has to find a way to have them typeset, because
538 % that will no longer be automatic.
541 \@arttype \@title \@subtitle \@authorsandinstitutes \@date
542 \@abstract \@keywords \@abbreviations \@classification
543 \@nomenclature \@translation \@dedication \@motto}
545 % This command is called by |\endopening| and |\maketitle|.
547 \def\openingflushstyle{}
550 \setcounter{footnote}{0}%
551 \def\thefootnote{\fnsymbol{footnote}}%
553 \twocolumn[{\openingflushstyle
556 \thispagestyle{opening}%
559 \newpage\global\@topnum\z@
560 \thispagestyle{opening}%
561 {\openingflushstyle \parindent 0pt \@maketitle}%
563 \markboth{\@runningauthor}{\@runningtitle}%
566 \setcounter{footnote}{0}%
567 \let\@maketitle\relax
573 \def\runningtitle#1{\gdef\@runningtitle{#1}}
574 \gdef\@runningtitle{}
575 \def\runningauthor#1{\gdef\@runningauthor{#1}}
576 \gdef\@runningauthor{}