summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/icsv/icsv.dtx
blob: 633c818b304d77a357e968b56149860a45adb76c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
% \iffalse 
%<*internal>
\iffalse
%</internal>
%<*readme>
______________
The ICSV class
v0.2

This is an ad-hoc class for typesetting articles for the ICSV conference, 
based on the previously hacked together active-conf by the same author.

Hopefully it's useful to someone. Contact me for refinements or if things 
don't work.

______________
Will Robertson
wspr 81 [at] gmail [dot] com

Copyright 2006
Distributed under the LaTeX Project Public License
%</readme>
%<*internalbatchfile>
\fi
\begingroup
%</internalbatchfile>
%<*batchfile>
\input docstrip.tex
\keepsilent
\preamble
  ______________________________
  Copyright 2006  Will Robertson

  License information appended.

\endpreamble
\postamble

Copyright 2006 by Will Robertson <wspr81@gmail.com>

Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
this license is at: http://www.latex-project.org/lppl.txt

This work is "maintained" (as per LPPL maintenance status) 
by Will Robertson.

This work consists of the file  icsv.dtx
          and the derived files icsv.cls and icsv.ins
          and the documentation icsv.pdf.

\endpostamble
\askforoverwritefalse
\generate{\file{\jobname.cls}{\from{\jobname.dtx}{classfile}}}
%</batchfile>
%<batchfile>\endbatchfile
%<*internalbatchfile>
\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
\nopreamble\nopostamble
\generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
\generate{\file{\jobname-dtx.sty}{\from{\jobname.dtx}{dtx-style}}}
\endgroup
%</internalbatchfile>
%
%<*driver>
\ProvidesFile{icsv.dtx}
%</driver>
%<classfile>\ProvidesClass{icsv}
%<*classfile>
  [2006/07/25 v0.2 Class file for ICSV]
%</classfile>
%
%<*driver>
\documentclass{ltxdoc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
%\OnlyDescription
\usepackage{\jobname-dtx}
\begin{document}
  \GetFileInfo{icsv.dtx}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
%
% \fi
%
% \CheckSum{622}
% \errorcontextlines=20
%
% \DoNotIndex{\@tempa,\@tempb,\@temptokena}
% \DoNotIndex{\begin,\begingroup,\bgroup}
% \DoNotIndex{\def}
% \DoNotIndex{\edef,\egroup,\end,\endgroup,\else,\expandafter}
% \DoNotIndex{\fi}
% \DoNotIndex{\if,\ifnum,\let}
% \DoNotIndex{\relax,\RequirePackage}
% \DoNotIndex{\the,\then}
%
% \makeatletter
%
% \title{The \pkg{icsv} class}
% \author{Will Robertson}
% \date{\filedate \qquad \fileversion}
%
% \maketitle
%
% \begin{abstract}\noindent
% This document describes the \LaTeX\ class \pkg{icsv}, an unofficial
% template for typesetting papers for the International Congress on Sound and Vibration.
% \end{abstract}
%
% \tableofcontents
%
% \section{About this document}
%
% This document contains the usage and implementation of the \pkg{icsv} class. 
% Users will almost certainly be interested in the former. This \textsc{pdf} contains
% hyperlinks within it to aid navigation (these are typeset in {\color{red}red}), and 
% hyperlinks to internet sites to help find further information (these are typeset in 
% {\color{blue}blue}).
%
% The source of this document, \texttt{icsv.dtx}, when run through \LaTeX, 
% will produce both the PDF documentation (the file you are currently reading) 
% \emph{and} the class file used to typeset your articles.
%
% \section{Description and usage}
% This section describes how to use the class.
% Please refer to the example document for context.
%
% There \emph{must} be an image called \texttt{icsv-logo} in the current
% directory to display the logo for the conference. This graphic should
% be supplied by the conference organisers.
%
% \subsection{Document preamble}
% \DescribeMacro{\documentclass}
% Use this class with standard \LaTeX\ parlance: |\documentclass{icsv}|.
%
% The document will be set up to use A4 paper with 38\,mm margins top and bottom, 32\,mm margins left and right. 
% The body text font is 12\,pt Times.
% \note{That is, the nominal text font size is 12\,pt, and the distance between baselines
%       is unchanged; if space allows, better results will be achieved with \cmd\linespread\ of 1.05 or so.}
% The sans serif font is Helvetica\relax
% \footnote{Scaled to match Times' x-height 
%   (\ie, the lowercase letters are the same height in both alphabets)} 
% and the fixed width font (or typewriter font) is `TXTT'.
%
% The following packages are loaded either to change the formatting for this conference or for the convenience of the user: 
%  \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/amslatex/math/]{amsmath}, 
%  \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/amslatex/math/]{amssymb}, 
%  \pkg[http://www.ctan.org/tex-archive/macros/latex/required/tools/]{array}, 
%  \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/tools/]{bm}, 
%  \pkg[http://www.ctan.org/tex-archive/macros/latex/contrib/caption/]{caption},
%  \pkg[http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/]{fancyhdr},
%  \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/graphics/]{graphicx},
%  \pkg[http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/]{hyperref}.\relax
% \footnote{Look for file \texttt{amsldoc.pdf} for \pkg{amsmath} \& \pkg{amssymb}
%   documentation; file \texttt{grfguide.pdf} for \pkg{graphicx} documentation; file \texttt{manual.pdf} in the \texttt{doc/} subdirectory for \pkg{hyperref} documentation.} 
% Of the above, a recent version of the \pkg{caption} package is required.
% Other packages are required for the class but they aren't of particular interest 
% for the purposes of the author; refer to the Implementation (\secref{packages}) 
% for more information. Extra packages may also be loaded if desired, provided that 
% they do not change the layout or text fonts used in the document.
%
% \subsection{Frontmatter metadata}
% \DescribeMacro{\title}
% \DescribeMacro{\author}
% \DescribeMacro{\email}
% \DescribeMacro{\address}
% This class provides added procedures to typeset extra information in the frontmatter 
% of the article. This information must be specified before \cmd\maketitle. \cmd\title\
% remains the same, but \cmd\author\ is changed and \cmd\email, and \cmd\address\
% are all completely new. 
%
% \DescribeMacro{\maketitle}
% Once the metadata has been specified, the \cmd\maketitle\ command is used
% to create the title block containing this information. To be illustrative, 
% an example best demonstrates the use of the new frontmatter commands. 
% See \figref{fm} for a typical input. 
%
% \begin{figure}
% \begin{verbatim}
% \author{A.\,B.~C------} \email{abc@university}
% \author{D.\,E.~F------}
% \address{University \\ City, State \\ Country}
% \end{verbatim}
% \caption{Example of the frontmatter in the \pkg{icsv} class.}
% \label{fig:fm}
% \end{figure}
%
% \begin{figure}
% \begin{verbatim}
% \showaffiliations
%
% \author[1]{A.\,B.~C------} \email{abc@university}
% \author[1,2]{D.\,E.~F------}
% \author[2]{G.\,H.~I------} \email{ghi@company}
%
% \address{University \\ City, State \\ Country}
% \address{Company \\ City, State \\ Country}
% \end{verbatim}
% \caption{More complicated frontmatter example.}
% \label{fig:fm2}
% \end{figure}
%
% \DescribeMacro{\showaffiliations}
% If the command \cmd\showaffiliations\ is placed before the author declarations,
% each author will reference the address to which they are associated.
% An argument to \cmd\author\ must now be used to specify which addresses
% are referenced as affiliations; for example |\author[1,3]{A.\,N.~Author}| designates
% an affiliation for this author with the first and third addresses.
% An example of this form is shown in \figref{fm2}.
%
% This functionality is slightly fragile and will hopefully receive improvement in the future.
% Let me know if you have troubles.
%
% \DescribeMacro{\pdfkeywords}
% Finally, optional, comma-separated keywords may be added to the paper with
% the command in the margin:
% \begin{verbatim}
%   \pdfkeywords{Active noise control, Virtual microphones}
% \end{verbatim}
%
% \subsection{Floats: figures and tables}
% \DescribeEnv{figure}
% \DescribeEnv{table}
% Small enhancement has been made to using figures and 
% tables. Both are automatically centred on the page, so no explicit commands for doing so are 
% required. Secondly, the default float placement parameter is \texttt{[htbp]},\relax
%\footnote{That is, floats will be placed at the position of their definition 
%   if possible; otherwise they will be placed at the top or bottom of a 
%   subsequent text page or on a page consisting of only floats in the last resort.} 
% so the optional argument generally won't be required. See a \LaTeX\ manual for more info.
%
% 
%
%
% \StopEventually{}
%
% \clearpage
% \section{Implementation}
%
% This section contains the commented source code of this package. It is not
% intended to be useful or interesting to the majority of users of the class.
%
% This class was hastily converted from the pkg{active-conf} class, written
% by the author for another conference. Don't expect brilliance within!
%
% \iffalse
%<*classfile>
% \fi
%
% \subsection{Class and package loading}\label{sec:packages}
% Base everything off the eponymous \pkg{article} class. Set up the fonts\relax
% \footnote{Note that we need to call \cmd\normalfont\ after selecting the new fonts
%   and before selecting the new encoding in order to ensure that \texttt{T1} `CM' 
%   fonts aren't loaded, which can cause an error in some distributions.}, 
% and load a bunch of packages first to set up the document properties and second 
% for the convenience of the user.
%    \begin{macrocode}
\LoadClass[12pt,twoside]{article}
\RequirePackage[a4paper,vmargin=38mm,hmargin=32mm,ignoreall]{geometry}
\RequirePackage{amsmath,amssymb,array,bm,calc,fancyhdr,fixltx2e,fix-cm,graphicx,hyperref,ifthen}
\RequirePackage{caption}[2006/01/12]
\hypersetup{
  colorlinks,
  linkcolor=black,
  anchorcolor=black,
  citecolor=black,
  filecolor=black,
  menucolor=black,
  pagecolor=black,
  urlcolor=black,
  pdfstartview=FitH,
  pdfpagelayout=SinglePage
  }
%    \end{macrocode}
% \paragraph{Fonts}
% Note that I \emph{have not} taken the liberty of using the Times maths fonts\footnote{Either via the \pkg{mathptm} or \pkg{mathptmx} packages.} as well, since Computer Modern maths does the job quite nicely (and moreover, contains bold Greek symbols~--~how can there be no bold maths in the Times maths fonts?).
%    \begin{macrocode}
\renewcommand\rmdefault{ptm}
\renewcommand\ttdefault{txtt}
\RequirePackage[scaled=0.87]{helvet}
\normalfont
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
%    \end{macrocode}
% Finally, get rid of extra space after punctuation (it's old-fashioned) and increase the leading between the lines; we need this due to such long lines with so many characters in each. We also want no page numbers, since numbers will be added after all the papers are collated into the proceedings.
%    \begin{macrocode}
\frenchspacing
\setlength\parindent{1.5em}
%    \end{macrocode}
% \subsection{Formatting specification}
% Use the \pkg{caption} package to format captions, and the \pkg{fancyhdr} package for running headers.
%    \begin{macrocode}
\captionsetup{labelsep=endash,font={small,it}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[CE]{\footnotesize \pdf@authors}
\fancyhead[CO]{\footnotesize ICSV13, July 2--6, Vienna, Austria} 
%    \end{macrocode}
% \begin{macro}{\section}\begin{macro}{\subsection}
% \begin{macro}{\subsubsection}\begin{macro}{\paragraph}
% \begin{macro}{\subparagraph}
% Nobody ever uses \cmd\subparagraph, so let's remove it. 
%    \begin{macrocode}
\setcounter{secnumdepth}{0}
\renewcommand\section{\@startsection{section}{1}{\z@}%
                                   {-1.6\baselineskip}%
                                   {0.8\baselineskip}%
                                   {\centering\bfseries\MakeUppercase}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-0.8\baselineskip}%
                                     {0.8\baselineskip}%
                                     {\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                    {-0.8\baselineskip}%
                                    {0.8\baselineskip}%
                                    {\bfseries\itshape}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {0.8\baselineskip}%
                                    {-0.8\baselineskip}%
                                    {\bfseries}}
\let\subparagraph\undefined
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{environment}{abstract}
% The most important part is removing the indent that exists in \pkg{article}!
%    \begin{macrocode}
\renewenvironment{abstract}
  {\vspace{\baselineskip}\fontsize{11}{11}\selectfont
   {\fontsize{13}{13}\bfseries\noindent Abstract\par}
   \noindent\ignorespaces}
  {\par}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{itemize}
% \begin{environment}{enumerate}
% Decrease the amount of vertical space between items in the \env{itemize} and \env{enumerate} environments. Renew the \LaTeX-defined ones in order to adjust all necessary bits and pieces.
%    \begin{macrocode}
\def\list@spacing{%
  \parsep    4pt
  \itemsep   0pt
  \topsep    6pt
  \partopsep 0pt}
\def\enumerate{% 
  \ifnum \@enumdepth > \thr@@\@toodeep\else 
    \advance\@enumdepth\@ne 
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}% 
      \expandafter 
      \list 
        \csname label\@enumctr\endcsname 
        {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}%
         \list@spacing}% 
  \fi} 
\let\endenumerate\endlist  
\def\itemize{% 
  \ifnum \@itemdepth > \thr@@\@toodeep\else 
    \advance\@itemdepth\@ne 
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% 
    \expandafter 
    \list 
      \csname\@itemitem\endcsname 
      {\def\makelabel##1{\hss\llap{##1}}%
       \list@spacing}% 
  \fi} 
\let\enditemize\endlist
%    \end{macrocode}
% \end{environment}
% \end{environment}
%
% \begin{environment}{itemise}
% Provide an environment with the correct spelling of `itemize'.
%    \begin{macrocode}
\let\itemise\itemize     
\let\enditemise\enditemize   
%    \end{macrocode}
% \end{environment}
%
% \begin{macro}{\descriptionlabel}
% Change the description label to italics instead of bold.
%    \begin{macrocode}
\renewcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries #1}
%    \end{macrocode}
% \end{macro}
%
% \paragraph{Figures and tables}
%
% \begin{macro}{\fps@figure}
% \begin{macro}{\fps@table}
% Make the default float placement \texttt{[htbp]}; users will always do it themselves anyway\dots
%    \begin{macrocode}
\def\fps@figure{htbp}
\def\fps@table{htbp}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{environment}{figure}
% \begin{environment}{table}
% Add \cmd\centering\ to the \env{figure} and \env{table} environments.
% This requires a trick: \cmd{\fps@...} must be expanded, so we can't just
% pass through |#1|. Instead, put everything, expanding all except the 
% \cmd\@float\ command, in a temporary macro, and then use that to produce the float.
%    \begin{macrocode}
\renewenvironment{figure}[1][\fps@figure]
                 {\edef\@tempa{\noexpand\@float{figure}[#1]}
                  \@tempa\centering}
                 {\end@float}
\renewenvironment{table}[1][\fps@table]
                 {\edef\@tempa{\noexpand\@float{table}[#1]}
                  \@tempa\centering}
                 {\end@float}
%    \end{macrocode}
% \end{environment}\end{environment}
% With the \pkg{array} package, add more height to the table rows so that horizontal
% rules don't look ugly. But only if the \pkg{booktabs} package isn't loaded, since it
% performs similar operations itself.
%    \begin{macrocode}
\AtBeginDocument{%
  \@ifpackageloaded{booktabs}{}{\setlength\extrarowheight{2pt}}}
%    \end{macrocode}
%    \begin{macrocode}
% Better float parameters: (from the TeX FAQ)
\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.66}
\renewcommand{\dbltopfraction}{.66}
\renewcommand{\dblfloatpagefraction}{.66}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
%    \end{macrocode}
%
% \subsection{Frontmatter}
% \begin{macro}{\maketitle}
% This is changed somewhat from the default classes.
% No proper documentation at the moment, I'm afraid.
%    \begin{macrocode}
\renewcommand\maketitle{%
  \thispagestyle{empty}\noindent
  \begin{minipage}{\textwidth}
    \renewcommand\footnoterule{\vspace{-1ex}}%
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \global\@topnum\z@   % Prevents figures from going at top of page.
    \begin{center}
      \vspace{-3cm}
      \includegraphics[height=4cm]{icsv-logo}%
    \end{center}
    \vspace{1sp}%
    \begin{center}
      \bfseries\fontsize{15}{17}\selectfont\MakeUppercase{\@title}%
    \end{center}
    \vspace{-2.5ex}%
    \def\@makefnmark{\smash{\textsuperscript{\@thefnmark}}}%
    {\parindent\z@
     \leftskip\@flushglue
     \rightskip\@flushglue
     \parfillskip\z@
     \address@list\par}
     \def\thempfootnote{\@fnsymbol\c@mpfootnote}
    \after@maketitle
  \end{minipage}
  \hypersetup{pdfauthor={\pdf@authors},pdftitle={\@title}}%
  \vspace{2ex}\par}
\let\after@maketitle\@empty
%    \end{macrocode}
% \end{macro}
%
%  \begin{macro}{\pdfkeywords}
% A hook directly into \pkg{hyperref}.
%    \begin{macrocode}
\newcommand\pdfkeywords[1]{\hypersetup{pdfkeywords={#1}}}
%    \end{macrocode}
%  \end{macro}
%
% 
%
% \begin{macro}{\author@init}
% \begin{macro}{\author@list}
% \begin{macro}{\author}
% \cmd{\author@init} is the top-level macro that creates a `fresh' definition of \cmd\author\ and initialises the \cmd{\author@list} macro. \cmd\author\ simply populates \cmd{\author@list} with a list of authors, separated by the macro \cmd{\author@sep}. The definition is set up to redefine itself the first time it is called so that \cmd{\author@sep} is only inserted \emph{after} this first time.
%
% \cmd{\author@list} is used as the first line in every address block, so once \cmd\address\ is called, \cmd{\author@init} is called again for the next list of authors that happen to work at a different address.
%    \begin{macrocode}
\def\author@init{%
  \def\@@author##1{%
    \g@addto@macro\author@list{##1}%
    \def\@@author####1{\g@addto@macro\author@list{\author@sep ####1}}}%
  \let\author@list\@empty}
\author@init
\renewcommand\author[2][\c@affiliation]{%
  \ifx\pdf@authors\@empty\else
    \g@addto@macro\pdf@authors{, }%
  \fi
  \g@addto@macro\pdf@authors{#2}%
  \g@addto@macro\author@list{\mbox\bgroup}%
  \@@author{#2}%
  \if@showaff
    \@for\@@index :=#1\do{%
      \expandafter\g@addto@macro
      \expandafter\author@list
      \expandafter{%
      \expandafter\place@affiliation
      \expandafter{%
                   \@@index}}%
    }
  \fi
  \g@addto@macro\author@list{\egroup}}
\newcommand\place@affiliation[1]{\kern1pt\textsuperscript{#1}}
\let\pdf@authors\@empty
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\email}
% This macro is intended to be used immediately after an \cmd\author\ declaration, and it simply appends a footnote to the current author detailing their email address. Because we aren't evaluating these things until the end, we regrettably need to spend some effect to replicate the effect that \cmd\footnotemark\ has on \cs{c@footnote}. This could almost certainly be more elegant.
%    \begin{macrocode}
\def\email#1{%
  \g@addto@macro\author@list{\kern1pt\footnotemark}%
  \g@addto@macro\after@maketitle{%
    \stepcounter{footnote}%
    \footnotetext[\the\c@footnote]{\centering\url{#1}}}}
\g@addto@macro\after@maketitle{\setcounter{footnote}{0}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\address@list}
% This is the macro used to hold all of the address blocks. Some of its contents is \emph{unexpanded} until \cmd\maketitle, notably the width of the minipages used to typeset the blocks.
%    \begin{macrocode}
\let\address@list\@empty
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@authorhook}
% \begin{macro}{\@@addresshook}
% And these are the macros used to format the text in the address blocks. They're enclosed in a group so don't worry about having to confine state. Unfortunately, it's \emph{not} set up to take an argument, state-changing arguments must be used (\eg, \cmd\sffamily, \cmd\itshape, \cmd\small).
%    \begin{macrocode}
\providecommand\@@authorhook{}
\providecommand\@@addresshook{\vspace{1ex}\fontsize{11}{13}\selectfont}
%    \end{macrocode}
% \end{macro} \end{macro}
% \begin{macro}{\address}
% This macro is used after any number of \cmd\author\ declarations. It takes the list of authors and typesets them in a box above the specified address. Everything is measured and later put into boxes of equal width so that spacing with several address blocks looks okay.
%
% The trick is to use one of \TeX's vertical boxes, and populate it with restricted-mode horizontal boxes---this makes the \cmd\vbox\ behave ``as expected'' and stretch to exactly the width it requires to typeset everything. The downside to this method is that restricted-mode \cmd\hbox's are required. What does this mean? `Normal' things like paragraph breaks and literal newlines aren't allowed, since we're typesetting in one long horizontal box.
%
% Obviously, people will want to write multi-line addresses, so we can get around the horiz.\ box problem by defining \cmd{\\} to end the current \cmd\hbox\ and start another. The following verbatim sketches the idea\dots
% \begin{verbatim}
% \address{abc \\ def \\ ghi} => \vbox{ ... \hbox{abc \\ def \\ ghi} }
%                          \\ => }\hbox{
%    \hbox{abc \\ def \\ ghi} => \hbox{abc }\hbox{ def }\hbox{ ghi}
% \end{verbatim}
% This leaves out the details, like absorbing the leading space we don't want, and re-applying the address-block formatting hook.
% Finally, at the end of the address, we need to initialise the various author macros so that a fresh lot of authors can be defined for their own subsequent address block.
%    \begin{macrocode}
\def\address#1{%
  \begingroup
    \let\footnotemark\relax
    \def\\{\egroup\hbox\bgroup\@@addresshook\ignorespaces}
    \sbox\tempbox{%
      \vbox{%
        \hbox{\strut\@@authorhook\author@list}
        \hbox{\@@addresshook #1}}}
    \settowidth\templength{\usebox\tempbox}
    \ifthenelse{\lengthtest{\templength>0.49\linewidth}}{\global\boxwidth\linewidth}{%
      \ifthenelse{\lengthtest{\templength>\boxwidth}}{\global\boxwidth\templength}{}}%
    \expandafter\make@address@box\expandafter{\author@list}{#1}
  \endgroup
  \author@init}
\newlength\boxwidth
\newlength\templength
\newbox\tempbox
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\make@address@box}
% This macro is broken out for easy of supplying an expanded \cmd{\author@list} to the middle of a \cmd{\g@addto@macro} declaration. Note well that \cmd\boxwidth\ isn't evaluated until \cmd{\address@list} is expanded in \cmd\maketitle.
%    \begin{macrocode}
\newcommand\make@address@box[2]{%
  \g@addto@macro\address@list{%
    \begin{minipage}[t]{\boxwidth+10pt}%
      \centering
      \def\@tempa{#1}%
      \ifx\@tempa\@empty
      \else
        \vspace*{\medskipamount}%
        {\@@authorhook#1\par\vspace{3pt}}
      \fi
      {\linespread{0.9}%
       \@@addresshook
       \if@showaff
         \makebox[0pt][r]{\textsuperscript{\number\c@affiliation}}%
       \fi
       \ignorespaces#2\par}
    \end{minipage}%
    \stepcounter{affiliation}%
    \hskip\@flushglue}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\newcounter{affiliation}
\stepcounter{affiliation}
\g@addto@macro\after@maketitle{\setcounter{affiliation}{1}}
\newif\if@showaff   
\newcommand\showaffiliations{\@showafftrue} 
%    \end{macrocode}
%
% Don't look at the following definition! Yuck!
%    \begin{macrocode}
\def\author@sep{,~\,}
%    \end{macrocode}
%
% The following is taken from my very own \pkg{fontspec} package, and is
% used to change \cmd\mathrm\ to Times Roman without destroying those aspects
% of default Computer Modern maths that assume that \cmd\rmdefault\ is \texttt{cmr}.
%    \begin{macrocode}
\let\zf@font@warning\@font@warning
\let\@font@warning\@font@info
\DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
\SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
\DeclareMathAccent{\acute}   {\mathalpha}{legacymaths}{19}
\DeclareMathAccent{\grave}   {\mathalpha}{legacymaths}{18}
\DeclareMathAccent{\ddot}    {\mathalpha}{legacymaths}{127}
\DeclareMathAccent{\tilde}   {\mathalpha}{legacymaths}{126}
\DeclareMathAccent{\bar}     {\mathalpha}{legacymaths}{22}
\DeclareMathAccent{\breve}   {\mathalpha}{legacymaths}{21}
\DeclareMathAccent{\check}   {\mathalpha}{legacymaths}{20}
\DeclareMathAccent{\hat}     {\mathalpha}{legacymaths}{94}
\DeclareMathAccent{\dot}     {\mathalpha}{legacymaths}{95}  
\DeclareMathAccent{\mathring}{\mathalpha}{legacymaths}{23}
\DeclareMathSymbol{!}{\mathclose}{legacymaths}{33}
\DeclareMathSymbol{:}{\mathrel}  {legacymaths}{58}
\DeclareMathSymbol{;}{\mathpunct}{legacymaths}{59}
\DeclareMathSymbol{?}{\mathclose}{legacymaths}{63}
\DeclareMathSymbol{0}{\mathalpha}{legacymaths}{`0}
\DeclareMathSymbol{1}{\mathalpha}{legacymaths}{`1}
\DeclareMathSymbol{2}{\mathalpha}{legacymaths}{`2}
\DeclareMathSymbol{3}{\mathalpha}{legacymaths}{`3}
\DeclareMathSymbol{4}{\mathalpha}{legacymaths}{`4}
\DeclareMathSymbol{5}{\mathalpha}{legacymaths}{`5}
\DeclareMathSymbol{6}{\mathalpha}{legacymaths}{`6}
\DeclareMathSymbol{7}{\mathalpha}{legacymaths}{`7}
\DeclareMathSymbol{8}{\mathalpha}{legacymaths}{`8}
\DeclareMathSymbol{9}{\mathalpha}{legacymaths}{`9}
\DeclareMathSymbol{\Gamma}{\mathalpha}{legacymaths}{0}
\DeclareMathSymbol{\Delta}{\mathalpha}{legacymaths}{1}
\DeclareMathSymbol{\Theta}{\mathalpha}{legacymaths}{2}
\DeclareMathSymbol{\Lambda}{\mathalpha}{legacymaths}{3}
\DeclareMathSymbol{\Xi}{\mathalpha}{legacymaths}{4}
\DeclareMathSymbol{\Pi}{\mathalpha}{legacymaths}{5}
\DeclareMathSymbol{\Sigma}{\mathalpha}{legacymaths}{6}
\DeclareMathSymbol{\Upsilon}{\mathalpha}{legacymaths}{7}
\DeclareMathSymbol{\Phi}{\mathalpha}{legacymaths}{8}
\DeclareMathSymbol{\Psi}{\mathalpha}{legacymaths}{9}
\DeclareMathSymbol{\Omega}{\mathalpha}{legacymaths}{10}
\DeclareMathSymbol{+}{\mathbin}{legacymaths}{43}
\DeclareMathSymbol{=}{\mathrel}{legacymaths}{61}
\DeclareMathDelimiter{(}{\mathopen} {legacymaths}{40}{largesymbols}{0}
\DeclareMathDelimiter{)}{\mathclose}{legacymaths}{41}{largesymbols}{1}
\DeclareMathDelimiter{[}{\mathopen} {legacymaths}{91}{largesymbols}{2}
\DeclareMathDelimiter{]}{\mathclose}{legacymaths}{93}{largesymbols}{3}
\DeclareMathDelimiter{/}{\mathord}{legacymaths}{47}{largesymbols}{14}
\DeclareMathSymbol{\mathdollar}{\mathord}{legacymaths}{36}
\DeclareSymbolFont{operators}\encodingdefault\rmdefault\mddefault\updefault
\SetSymbolFont{operators}{normal}\encodingdefault\rmdefault\mddefault\updefault
\SetMathAlphabet\mathrm{normal}\encodingdefault\rmdefault\mddefault\updefault
\SetMathAlphabet\mathit{normal}\encodingdefault\rmdefault\mddefault\itdefault
\SetMathAlphabet\mathbf{normal}\encodingdefault\rmdefault\bfdefault\updefault
\SetMathAlphabet\mathsf{normal}\encodingdefault\sfdefault\mddefault\updefault
\SetMathAlphabet\mathtt{normal}\encodingdefault\ttdefault\mddefault\updefault
\SetSymbolFont{operators}{bold}\encodingdefault\rmdefault\bfdefault\updefault
\SetMathAlphabet\mathrm{bold}\encodingdefault\rmdefault\bfdefault\updefault
\SetMathAlphabet\mathit{bold}\encodingdefault\rmdefault\bfdefault\itdefault
\SetMathAlphabet\mathsf{bold}\encodingdefault\sfdefault\bfdefault\updefault
\SetMathAlphabet\mathtt{bold}\encodingdefault\ttdefault\bfdefault\updefault
\let\font@warning\zf@font@warning
%    \end{macrocode}
% The end! Thanks for coming.
%\iffalse
%</classfile>
%\fi
%
% \clearpage
% \begingroup
% \renewenvironment{theglossary}
%   {\small\list{}{}
%      \item\relax
%      \glossary@prologue\GlossaryParms 
%      \let\item\@idxitem \ignorespaces 
%      \def\pfill{\hspace*{\fill}}}
%   {\endlist}
% \PrintChanges
% \endgroup
%
% \setcounter{IndexColumns}{2}
% \PrintIndex
%
% \Finale
%
%\iffalse
%
%
%<*dtx-style>
%    \begin{macrocode}
\ProvidesPackage{icsv-dtx}

% Better float parameters: (from the TeX FAQ)
\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.66}
\renewcommand{\dbltopfraction}{.66}
\renewcommand{\dblfloatpagefraction}{.66}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
% Section heading customisation:
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3ex \@plus -1ex \@minus -.2ex}%
                                   {2ex \@plus 0.2ex}%
                                   {\centering\normalsize\scshape}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-2.5ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus 0.2ex}%
                                     {\centering\normalsize\itshape}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-2ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus 0.2ex}%
                                     {\centering\normalfont\normalsize}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {-1em}%
                                    {\normalfont\normalsize\itshape}}
\let\subparagraph\undefined
\def\@maketitle{%
  \newpage
  {\centering
   {\large\@title\par}\vskip1em
   \textsc\@author\par\vskip1em
   \@date\par}\vskip2em}
% Abstract customisation:
\renewenvironment{abstract}{%
  \begin{trivlist}\item[]
    \setlength\leftskip{0.15\textwidth}
    \setlength\rightskip{0.15\textwidth}
    \small\textit{Abstract}\quad}{\end{trivlist}}                                      
% TOC customisation: Make it two-column to save space;
%   Remove leaders in the TOC, replace with \quad.
\setcounter{tocdepth}{2}
\renewcommand\tableofcontents{%
  \section*{\contentsname}
  \begin{trivlist}\item[]
    \begin{multicols}{2}
      \setlength\parskip{0pt}
      \small
      \@starttoc{toc}%
    \end{multicols}
  \end{trivlist}}
\renewcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{1.5em}%
    \begingroup
      \raggedright
      \parindent \z@ 
      \rightskip \z@
      \parfillskip \@flushglue
      \leavevmode
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\quad\nobreak#2\hfil\par
    \endgroup
  \fi}
\def\@dottedtocline#1#2#3#4#5{% 
  \ifnum #1>\c@tocdepth \else 
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip \@flushglue
     \parindent #2\relax\@afterindenttrue 
     \interlinepenalty\@M 
     \leavevmode 
     \raggedright
     \@tempdima #3\relax 
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip 
     {#4}\quad\nobreak#5\hfil\par}% 
  \fi}
  
% Better footnotes:
\let\old@makefntext\@makefntext
\renewcommand\@makefntext[1]{%
  \vspace{2pt}%
  \setlength\parindent{-1.8em}%
  \setlength\leftskip{1.8em}%
  \makebox[1.8em][l]{\normalfont\small\@thefnmark.}#1}

\setcounter{IndexColumns}{2}
\renewenvironment{theglossary}
  {\small\list{}{}
     \item\relax
     \glossary@prologue\GlossaryParms 
     \let\item\@idxitem \ignorespaces 
     \def\pfill{\hspace*{\fill}}}
  {\endlist}

\usepackage{amstext,array,booktabs,calc,color,fancyvrb,graphicx,hyperref,ifthen,longtable,refstyle,varioref}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[sc,osf]{mathpazo}

\linespread{1.069}      % A bit more space between lines
\frenchspacing         % Remove ugly extra space after punctuation
  
\hypersetup{colorlinks, breaklinks, linktocpage,
  linkcolor=red, citecolor=red, filecolor=blue, urlcolor=blue}

\newcommand*\setexsize[1]{\let\examplesize#1}
\newcommand*\setverbwidth[1]{\def\auxwidth{#1}}

\newcommand*\name[1]{{#1}}
\newcommand*\pkg[2][]{\relax
  \edef\@tempa{#1}\relax
  \ifx\@tempa\@empty
    \textsf{\mbox{#2}}\else
    \href{#1}{\textsf{\mbox{#2}}}\fi}
\newcommand*\env[1]{\textsf{#1}}

\newcommand*\note[1]{\unskip\footnote{#1}}

\let\latin\textit
\def\eg{\latin{e.g.}}
\def\Eg{\latin{E.g.}}
\def\ie{\latin{i.e.}}
\def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}}

\def\TeX{\smash{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X}\spacefactor1000\relax}

%    \end{macrocode}
%</dtx-style>
%
%\fi
%
% \typeout{************************************************}
% \typeout{*}
% \typeout{* To finish the installation, move the following}
% \typeout{* file into a directory searched by TeX:}
% \typeout{*}
% \typeout{* \space\space\space icsv.cls}
% \typeout{*}
% \typeout{************************************************}
%
\endinput