Debian Codegraph @

texmf-dist/source/latex/icsv/icsv.dtx

raw
1 % \iffalse
2 %<*internal>
3 \iffalse
4 %</internal>
5 %<*readme>
6 ______________
7 The ICSV class
8 v0.2
9
10 This is an ad-hoc class for typesetting articles for the ICSV conference,
11 based on the previously hacked together active-conf by the same author.
12
13 Hopefully it's useful to someone. Contact me for refinements or if things
14 don't work.
15
16 ______________
17 Will Robertson
18 wspr 81 [at] gmail [dot] com
19
20 Copyright 2006
21 Distributed under the LaTeX Project Public License
22 %</readme>
23 %<*internalbatchfile>
24 \fi
25 \begingroup
26 %</internalbatchfile>
27 %<*batchfile>
28 \input docstrip.tex
29 \keepsilent
30 \preamble
31 ______________________________
32 Copyright 2006 Will Robertson
33
34 License information appended.
35
36 \endpreamble
37 \postamble
38
39 Copyright 2006 by Will Robertson <[email protected]>
40
41 Distributable under the LaTeX Project Public License,
42 version 1.3c or higher (your choice). The latest version of
43 this license is at: http://www.latex-project.org/lppl.txt
44
45 This work is "maintained" (as per LPPL maintenance status)
46 by Will Robertson.
47
48 This work consists of the file icsv.dtx
49 and the derived files icsv.cls and icsv.ins
50 and the documentation icsv.pdf.
51
52 \endpostamble
53 \askforoverwritefalse
54 \generate{\file{\jobname.cls}{\from{\jobname.dtx}{classfile}}}
55 %</batchfile>
56 %<batchfile>\endbatchfile
57 %<*internalbatchfile>
58 \generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
59 \nopreamble\nopostamble
60 \generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
61 \generate{\file{\jobname-dtx.sty}{\from{\jobname.dtx}{dtx-style}}}
62 \endgroup
63 %</internalbatchfile>
64 %
65 %<*driver>
66 \ProvidesFile{icsv.dtx}
67 %</driver>
68 %<classfile>\ProvidesClass{icsv}
69 %<*classfile>
70 [2006/07/25 v0.2 Class file for ICSV]
71 %</classfile>
72 %
73 %<*driver>
74 \documentclass{ltxdoc}
75 \EnableCrossrefs
76 \CodelineIndex
77 \RecordChanges
78 %\OnlyDescription
79 \usepackage{\jobname-dtx}
80 \begin{document}
81 \GetFileInfo{icsv.dtx}
82 \DocInput{\jobname.dtx}
83 \end{document}
84 %</driver>
85 %
86 % \fi
87 %
88 % \CheckSum{622}
89 % \errorcontextlines=20
90 %
91 % \DoNotIndex{\@tempa,\@tempb,\@temptokena}
92 % \DoNotIndex{\begin,\begingroup,\bgroup}
93 % \DoNotIndex{\def}
94 % \DoNotIndex{\edef,\egroup,\end,\endgroup,\else,\expandafter}
95 % \DoNotIndex{\fi}
96 % \DoNotIndex{\if,\ifnum,\let}
97 % \DoNotIndex{\relax,\RequirePackage}
98 % \DoNotIndex{\the,\then}
99 %
100 % \makeatletter
101 %
102 % \title{The \pkg{icsv} class}
103 % \author{Will Robertson}
104 % \date{\filedate \qquad \fileversion}
105 %
106 % \maketitle
107 %
108 % \begin{abstract}\noindent
109 % This document describes the \LaTeX\ class \pkg{icsv}, an unofficial
110 % template for typesetting papers for the International Congress on Sound and Vibration.
111 % \end{abstract}
112 %
113 % \tableofcontents
114 %
115 % \section{About this document}
116 %
117 % This document contains the usage and implementation of the \pkg{icsv} class.
118 % Users will almost certainly be interested in the former. This \textsc{pdf} contains
119 % hyperlinks within it to aid navigation (these are typeset in {\color{red}red}), and
120 % hyperlinks to internet sites to help find further information (these are typeset in
121 % {\color{blue}blue}).
122 %
123 % The source of this document, \texttt{icsv.dtx}, when run through \LaTeX,
124 % will produce both the PDF documentation (the file you are currently reading)
125 % \emph{and} the class file used to typeset your articles.
126 %
127 % \section{Description and usage}
128 % This section describes how to use the class.
129 % Please refer to the example document for context.
130 %
131 % There \emph{must} be an image called \texttt{icsv-logo} in the current
132 % directory to display the logo for the conference. This graphic should
133 % be supplied by the conference organisers.
134 %
135 % \subsection{Document preamble}
136 % \DescribeMacro{\documentclass}
137 % Use this class with standard \LaTeX\ parlance: |\documentclass{icsv}|.
138 %
139 % The document will be set up to use A4 paper with 38\,mm margins top and bottom, 32\,mm margins left and right.
140 % The body text font is 12\,pt Times.
141 % \note{That is, the nominal text font size is 12\,pt, and the distance between baselines
142 % is unchanged; if space allows, better results will be achieved with \cmd\linespread\ of 1.05 or so.}
143 % The sans serif font is Helvetica\relax
144 % \footnote{Scaled to match Times' x-height
145 % (\ie, the lowercase letters are the same height in both alphabets)}
146 % and the fixed width font (or typewriter font) is `TXTT'.
147 %
148 % The following packages are loaded either to change the formatting for this conference or for the convenience of the user:
149 % \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/amslatex/math/]{amsmath},
150 % \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/amslatex/math/]{amssymb},
151 % \pkg[http://www.ctan.org/tex-archive/macros/latex/required/tools/]{array},
152 % \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/tools/]{bm},
153 % \pkg[http://www.ctan.org/tex-archive/macros/latex/contrib/caption/]{caption},
154 % \pkg[http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/]{fancyhdr},
155 % \pkg[http://tug.ctan.org/tex-archive/macros/latex/required/graphics/]{graphicx},
156 % \pkg[http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/]{hyperref}.\relax
157 % \footnote{Look for file \texttt{amsldoc.pdf} for \pkg{amsmath} \& \pkg{amssymb}
158 % documentation; file \texttt{grfguide.pdf} for \pkg{graphicx} documentation; file \texttt{manual.pdf} in the \texttt{doc/} subdirectory for \pkg{hyperref} documentation.}
159 % Of the above, a recent version of the \pkg{caption} package is required.
160 % Other packages are required for the class but they aren't of particular interest
161 % for the purposes of the author; refer to the Implementation (\secref{packages})
162 % for more information. Extra packages may also be loaded if desired, provided that
163 % they do not change the layout or text fonts used in the document.
164 %
165 % \subsection{Frontmatter metadata}
166 % \DescribeMacro{\title}
167 % \DescribeMacro{\author}
168 % \DescribeMacro{\email}
169 % \DescribeMacro{\address}
170 % This class provides added procedures to typeset extra information in the frontmatter
171 % of the article. This information must be specified before \cmd\maketitle. \cmd\title\
172 % remains the same, but \cmd\author\ is changed and \cmd\email, and \cmd\address\
173 % are all completely new.
174 %
175 % \DescribeMacro{\maketitle}
176 % Once the metadata has been specified, the \cmd\maketitle\ command is used
177 % to create the title block containing this information. To be illustrative,
178 % an example best demonstrates the use of the new frontmatter commands.
179 % See \figref{fm} for a typical input.
180 %
181 % \begin{figure}
182 % \begin{verbatim}
183 % \author{A.\,B.~C------} \email{abc@university}
184 % \author{D.\,E.~F------}
185 % \address{University \\ City, State \\ Country}
186 % \end{verbatim}
187 % \caption{Example of the frontmatter in the \pkg{icsv} class.}
188 % \label{fig:fm}
189 % \end{figure}
190 %
191 % \begin{figure}
192 % \begin{verbatim}
193 % \showaffiliations
194 %
195 % \author[1]{A.\,B.~C------} \email{abc@university}
196 % \author[1,2]{D.\,E.~F------}
197 % \author[2]{G.\,H.~I------} \email{ghi@company}
198 %
199 % \address{University \\ City, State \\ Country}
200 % \address{Company \\ City, State \\ Country}
201 % \end{verbatim}
202 % \caption{More complicated frontmatter example.}
203 % \label{fig:fm2}
204 % \end{figure}
205 %
206 % \DescribeMacro{\showaffiliations}
207 % If the command \cmd\showaffiliations\ is placed before the author declarations,
208 % each author will reference the address to which they are associated.
209 % An argument to \cmd\author\ must now be used to specify which addresses
210 % are referenced as affiliations; for example |\author[1,3]{A.\,N.~Author}| designates
211 % an affiliation for this author with the first and third addresses.
212 % An example of this form is shown in \figref{fm2}.
213 %
214 % This functionality is slightly fragile and will hopefully receive improvement in the future.
215 % Let me know if you have troubles.
216 %
217 % \DescribeMacro{\pdfkeywords}
218 % Finally, optional, comma-separated keywords may be added to the paper with
219 % the command in the margin:
220 % \begin{verbatim}
221 % \pdfkeywords{Active noise control, Virtual microphones}
222 % \end{verbatim}
223 %
224 % \subsection{Floats: figures and tables}
225 % \DescribeEnv{figure}
226 % \DescribeEnv{table}
227 % Small enhancement has been made to using figures and
228 % tables. Both are automatically centred on the page, so no explicit commands for doing so are
229 % required. Secondly, the default float placement parameter is \texttt{[htbp]},\relax
230 %\footnote{That is, floats will be placed at the position of their definition
231 % if possible; otherwise they will be placed at the top or bottom of a
232 % subsequent text page or on a page consisting of only floats in the last resort.}
233 % so the optional argument generally won't be required. See a \LaTeX\ manual for more info.
234 %
235 %
236 %
237 %
238 % \StopEventually{}
239 %
240 % \clearpage
241 % \section{Implementation}
242 %
243 % This section contains the commented source code of this package. It is not
244 % intended to be useful or interesting to the majority of users of the class.
245 %
246 % This class was hastily converted from the pkg{active-conf} class, written
247 % by the author for another conference. Don't expect brilliance within!
248 %
249 % \iffalse
250 %<*classfile>
251 % \fi
252 %
253 % \subsection{Class and package loading}\label{sec:packages}
254 % Base everything off the eponymous \pkg{article} class. Set up the fonts\relax
255 % \footnote{Note that we need to call \cmd\normalfont\ after selecting the new fonts
256 % and before selecting the new encoding in order to ensure that \texttt{T1} `CM'
257 % fonts aren't loaded, which can cause an error in some distributions.},
258 % and load a bunch of packages first to set up the document properties and second
259 % for the convenience of the user.
260 % \begin{macrocode}
261 \LoadClass[12pt,twoside]{article}
262 \RequirePackage[a4paper,vmargin=38mm,hmargin=32mm,ignoreall]{geometry}
263 \RequirePackage{amsmath,amssymb,array,bm,calc,fancyhdr,fixltx2e,fix-cm,graphicx,hyperref,ifthen}
264 \RequirePackage{caption}[2006/01/12]
265 \hypersetup{
266 colorlinks,
267 linkcolor=black,
268 anchorcolor=black,
269 citecolor=black,
270 filecolor=black,
271 menucolor=black,
272 pagecolor=black,
273 urlcolor=black,
274 pdfstartview=FitH,
275 pdfpagelayout=SinglePage
276 }
277 % \end{macrocode}
278 % \paragraph{Fonts}
279 % 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?).
280 % \begin{macrocode}
281 \renewcommand\rmdefault{ptm}
282 \renewcommand\ttdefault{txtt}
283 \RequirePackage[scaled=0.87]{helvet}
284 \normalfont
285 \RequirePackage[T1]{fontenc}
286 \RequirePackage{textcomp}
287 % \end{macrocode}
288 % 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.
289 % \begin{macrocode}
290 \frenchspacing
291 \setlength\parindent{1.5em}
292 % \end{macrocode}
293 % \subsection{Formatting specification}
294 % Use the \pkg{caption} package to format captions, and the \pkg{fancyhdr} package for running headers.
295 % \begin{macrocode}
296 \captionsetup{labelsep=endash,font={small,it}}
297 \pagestyle{fancy}
298 \fancyhf{}
299 \fancyhead[CE]{\footnotesize \pdf@authors}
300 \fancyhead[CO]{\footnotesize ICSV13, July 2--6, Vienna, Austria}
301 % \end{macrocode}
302 % \begin{macro}{\section}\begin{macro}{\subsection}
303 % \begin{macro}{\subsubsection}\begin{macro}{\paragraph}
304 % \begin{macro}{\subparagraph}
305 % Nobody ever uses \cmd\subparagraph, so let's remove it.
306 % \begin{macrocode}
307 \setcounter{secnumdepth}{0}
308 \renewcommand\section{\@startsection{section}{1}{\z@}%
309 {-1.6\baselineskip}%
310 {0.8\baselineskip}%
311 {\centering\bfseries\MakeUppercase}}
312 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
313 {-0.8\baselineskip}%
314 {0.8\baselineskip}%
315 {\bfseries}}
316 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
317 {-0.8\baselineskip}%
318 {0.8\baselineskip}%
319 {\bfseries\itshape}}
320 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
321 {0.8\baselineskip}%
322 {-0.8\baselineskip}%
323 {\bfseries}}
324 \let\subparagraph\undefined
325 % \end{macrocode}
326 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
327 %
328 % \begin{environment}{abstract}
329 % The most important part is removing the indent that exists in \pkg{article}!
330 % \begin{macrocode}
331 \renewenvironment{abstract}
332 {\vspace{\baselineskip}\fontsize{11}{11}\selectfont
333 {\fontsize{13}{13}\bfseries\noindent Abstract\par}
334 \noindent\ignorespaces}
335 {\par}
336 % \end{macrocode}
337 % \end{environment}
338 %
339 % \begin{environment}{itemize}
340 % \begin{environment}{enumerate}
341 % 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.
342 % \begin{macrocode}
343 \def\list@spacing{%
344 \parsep 4pt
345 \itemsep 0pt
346 \topsep 6pt
347 \partopsep 0pt}
348 \def\enumerate{%
349 \ifnum \@enumdepth > \thr@@\@toodeep\else
350 \advance\@enumdepth\@ne
351 \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
352 \expandafter
353 \list
354 \csname label\@enumctr\endcsname
355 {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}%
356 \list@spacing}%
357 \fi}
358 \let\endenumerate\endlist
359 \def\itemize{%
360 \ifnum \@itemdepth > \thr@@\@toodeep\else
361 \advance\@itemdepth\@ne
362 \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
363 \expandafter
364 \list
365 \csname\@itemitem\endcsname
366 {\def\makelabel##1{\hss\llap{##1}}%
367 \list@spacing}%
368 \fi}
369 \let\enditemize\endlist
370 % \end{macrocode}
371 % \end{environment}
372 % \end{environment}
373 %
374 % \begin{environment}{itemise}
375 % Provide an environment with the correct spelling of `itemize'.
376 % \begin{macrocode}
377 \let\itemise\itemize
378 \let\enditemise\enditemize
379 % \end{macrocode}
380 % \end{environment}
381 %
382 % \begin{macro}{\descriptionlabel}
383 % Change the description label to italics instead of bold.
384 % \begin{macrocode}
385 \renewcommand*\descriptionlabel[1]{\hspace\labelsep
386 \normalfont\bfseries #1}
387 % \end{macrocode}
388 % \end{macro}
389 %
390 % \paragraph{Figures and tables}
391 %
392 % \begin{macro}{\fps@figure}
393 % \begin{macro}{\fps@table}
394 % Make the default float placement \texttt{[htbp]}; users will always do it themselves anyway\dots
395 % \begin{macrocode}
396 \def\fps@figure{htbp}
397 \def\fps@table{htbp}
398 % \end{macrocode}
399 % \end{macro}
400 % \end{macro}
401 %
402 % \begin{environment}{figure}
403 % \begin{environment}{table}
404 % Add \cmd\centering\ to the \env{figure} and \env{table} environments.
405 % This requires a trick: \cmd{\fps@...} must be expanded, so we can't just
406 % pass through |#1|. Instead, put everything, expanding all except the
407 % \cmd\@float\ command, in a temporary macro, and then use that to produce the float.
408 % \begin{macrocode}
409 \renewenvironment{figure}[1][\fps@figure]
410 {\edef\@tempa{\noexpand\@float{figure}[#1]}
411 \@tempa\centering}
412 {\end@float}
413 \renewenvironment{table}[1][\fps@table]
414 {\edef\@tempa{\noexpand\@float{table}[#1]}
415 \@tempa\centering}
416 {\end@float}
417 % \end{macrocode}
418 % \end{environment}\end{environment}
419 % With the \pkg{array} package, add more height to the table rows so that horizontal
420 % rules don't look ugly. But only if the \pkg{booktabs} package isn't loaded, since it
421 % performs similar operations itself.
422 % \begin{macrocode}
423 \AtBeginDocument{%
424 \@ifpackageloaded{booktabs}{}{\setlength\extrarowheight{2pt}}}
425 % \end{macrocode}
426 % \begin{macrocode}
427 % Better float parameters: (from the TeX FAQ)
428 \renewcommand{\topfraction}{.85}
429 \renewcommand{\bottomfraction}{.7}
430 \renewcommand{\textfraction}{.15}
431 \renewcommand{\floatpagefraction}{.66}
432 \renewcommand{\dbltopfraction}{.66}
433 \renewcommand{\dblfloatpagefraction}{.66}
434 \setcounter{topnumber}{9}
435 \setcounter{bottomnumber}{9}
436 \setcounter{totalnumber}{20}
437 \setcounter{dbltopnumber}{9}
438 % \end{macrocode}
439 %
440 % \subsection{Frontmatter}
441 % \begin{macro}{\maketitle}
442 % This is changed somewhat from the default classes.
443 % No proper documentation at the moment, I'm afraid.
444 % \begin{macrocode}
445 \renewcommand\maketitle{%
446 \thispagestyle{empty}\noindent
447 \begin{minipage}{\textwidth}
448 \renewcommand\footnoterule{\vspace{-1ex}}%
449 \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
450 \global\@topnum\z@ % Prevents figures from going at top of page.
451 \begin{center}
452 \vspace{-3cm}
453 \includegraphics[height=4cm]{icsv-logo}%
454 \end{center}
455 \vspace{1sp}%
456 \begin{center}
457 \bfseries\fontsize{15}{17}\selectfont\MakeUppercase{\@title}%
458 \end{center}
459 \vspace{-2.5ex}%
460 \def\@makefnmark{\smash{\textsuperscript{\@thefnmark}}}%
461 {\parindent\z@
462 \leftskip\@flushglue
463 \rightskip\@flushglue
464 \parfillskip\z@
465 \address@list\par}
466 \def\thempfootnote{\@fnsymbol\c@mpfootnote}
467 \after@maketitle
468 \end{minipage}
469 \hypersetup{pdfauthor={\pdf@authors},pdftitle={\@title}}%
470 \vspace{2ex}\par}
471 \let\after@maketitle\@empty
472 % \end{macrocode}
473 % \end{macro}
474 %
475 % \begin{macro}{\pdfkeywords}
476 % A hook directly into \pkg{hyperref}.
477 % \begin{macrocode}
478 \newcommand\pdfkeywords[1]{\hypersetup{pdfkeywords={#1}}}
479 % \end{macrocode}
480 % \end{macro}
481 %
482 %
483 %
484 % \begin{macro}{\author@init}
485 % \begin{macro}{\author@list}
486 % \begin{macro}{\author}
487 % \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.
488 %
489 % \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.
490 % \begin{macrocode}
491 \def\author@init{%
492 \def\@@author##1{%
493 \g@addto@macro\author@list{##1}%
494 \def\@@author####1{\g@addto@macro\author@list{\author@sep ####1}}}%
495 \let\author@list\@empty}
496 \author@init
497 \renewcommand\author[2][\c@affiliation]{%
498 \ifx\pdf@authors\@empty\else
499 \g@addto@macro\pdf@authors{, }%
500 \fi
501 \g@addto@macro\pdf@authors{#2}%
502 \g@addto@macro\author@list{\mbox\bgroup}%
503 \@@author{#2}%
504 \if@showaff
505 \@for\@@index :=#1\do{%
506 \expandafter\g@addto@macro
507 \expandafter\author@list
508 \expandafter{%
509 \expandafter\place@affiliation
510 \expandafter{%
511 \@@index}}%
512 }
513 \fi
514 \g@addto@macro\author@list{\egroup}}
515 \newcommand\place@affiliation[1]{\kern1pt\textsuperscript{#1}}
516 \let\pdf@authors\@empty
517 % \end{macrocode}
518 % \end{macro}
519 % \end{macro}
520 % \end{macro}
521 %
522 % \begin{macro}{\email}
523 % 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.
524 % \begin{macrocode}
525 \def\email#1{%
526 \g@addto@macro\author@list{\kern1pt\footnotemark}%
527 \g@addto@macro\after@maketitle{%
528 \stepcounter{footnote}%
529 \footnotetext[\the\c@footnote]{\centering\url{#1}}}}
530 \g@addto@macro\after@maketitle{\setcounter{footnote}{0}}
531 % \end{macrocode}
532 % \end{macro}
533 %
534 % \begin{macro}{\address@list}
535 % 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.
536 % \begin{macrocode}
537 \let\address@list\@empty
538 % \end{macrocode}
539 % \end{macro}
540 % \begin{macro}{\@@authorhook}
541 % \begin{macro}{\@@addresshook}
542 % 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).
543 % \begin{macrocode}
544 \providecommand\@@authorhook{}
545 \providecommand\@@addresshook{\vspace{1ex}\fontsize{11}{13}\selectfont}
546 % \end{macrocode}
547 % \end{macro} \end{macro}
548 % \begin{macro}{\address}
549 % 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.
550 %
551 % 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.
552 %
553 % 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
554 % \begin{verbatim}
555 % \address{abc \\ def \\ ghi} => \vbox{ ... \hbox{abc \\ def \\ ghi} }
556 % \\ => }\hbox{
557 % \hbox{abc \\ def \\ ghi} => \hbox{abc }\hbox{ def }\hbox{ ghi}
558 % \end{verbatim}
559 % This leaves out the details, like absorbing the leading space we don't want, and re-applying the address-block formatting hook.
560 % 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.
561 % \begin{macrocode}
562 \def\address#1{%
563 \begingroup
564 \let\footnotemark\relax
565 \def\\{\egroup\hbox\bgroup\@@addresshook\ignorespaces}
566 \sbox\tempbox{%
567 \vbox{%
568 \hbox{\strut\@@authorhook\author@list}
569 \hbox{\@@addresshook #1}}}
570 \settowidth\templength{\usebox\tempbox}
571 \ifthenelse{\lengthtest{\templength>0.49\linewidth}}{\global\boxwidth\linewidth}{%
572 \ifthenelse{\lengthtest{\templength>\boxwidth}}{\global\boxwidth\templength}{}}%
573 \expandafter\make@address@box\expandafter{\author@list}{#1}
574 \endgroup
575 \author@init}
576 \newlength\boxwidth
577 \newlength\templength
578 \newbox\tempbox
579 % \end{macrocode}
580 % \end{macro}
581 % \begin{macro}{\make@address@box}
582 % 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.
583 % \begin{macrocode}
584 \newcommand\make@address@box[2]{%
585 \g@addto@macro\address@list{%
586 \begin{minipage}[t]{\boxwidth+10pt}%
587 \centering
588 \def\@tempa{#1}%
589 \ifx\@tempa\@empty
590 \else
591 \vspace*{\medskipamount}%
592 {\@@authorhook#1\par\vspace{3pt}}
593 \fi
594 {\linespread{0.9}%
595 \@@addresshook
596 \if@showaff
597 \makebox[0pt][r]{\textsuperscript{\number\c@affiliation}}%
598 \fi
599 \ignorespaces#2\par}
600 \end{minipage}%
601 \stepcounter{affiliation}%
602 \hskip\@flushglue}}
603 % \end{macrocode}
604 % \end{macro}
605 %
606 % \begin{macrocode}
607 \newcounter{affiliation}
608 \stepcounter{affiliation}
609 \g@addto@macro\after@maketitle{\setcounter{affiliation}{1}}
610 \newif\if@showaff
611 \newcommand\showaffiliations{\@showafftrue}
612 % \end{macrocode}
613 %
614 % Don't look at the following definition! Yuck!
615 % \begin{macrocode}
616 \def\author@sep{,~\,}
617 % \end{macrocode}
618 %
619 % The following is taken from my very own \pkg{fontspec} package, and is
620 % used to change \cmd\mathrm\ to Times Roman without destroying those aspects
621 % of default Computer Modern maths that assume that \cmd\rmdefault\ is \texttt{cmr}.
622 % \begin{macrocode}
623 \let\zf@font@warning\@font@warning
624 \let\@font@warning\@font@info
625 \DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
626 \SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
627 \DeclareMathAccent{\acute} {\mathalpha}{legacymaths}{19}
628 \DeclareMathAccent{\grave} {\mathalpha}{legacymaths}{18}
629 \DeclareMathAccent{\ddot} {\mathalpha}{legacymaths}{127}
630 \DeclareMathAccent{\tilde} {\mathalpha}{legacymaths}{126}
631 \DeclareMathAccent{\bar} {\mathalpha}{legacymaths}{22}
632 \DeclareMathAccent{\breve} {\mathalpha}{legacymaths}{21}
633 \DeclareMathAccent{\check} {\mathalpha}{legacymaths}{20}
634 \DeclareMathAccent{\hat} {\mathalpha}{legacymaths}{94}
635 \DeclareMathAccent{\dot} {\mathalpha}{legacymaths}{95}
636 \DeclareMathAccent{\mathring}{\mathalpha}{legacymaths}{23}
637 \DeclareMathSymbol{!}{\mathclose}{legacymaths}{33}
638 \DeclareMathSymbol{:}{\mathrel} {legacymaths}{58}
639 \DeclareMathSymbol{;}{\mathpunct}{legacymaths}{59}
640 \DeclareMathSymbol{?}{\mathclose}{legacymaths}{63}
641 \DeclareMathSymbol{0}{\mathalpha}{legacymaths}{`0}
642 \DeclareMathSymbol{1}{\mathalpha}{legacymaths}{`1}
643 \DeclareMathSymbol{2}{\mathalpha}{legacymaths}{`2}
644 \DeclareMathSymbol{3}{\mathalpha}{legacymaths}{`3}
645 \DeclareMathSymbol{4}{\mathalpha}{legacymaths}{`4}
646 \DeclareMathSymbol{5}{\mathalpha}{legacymaths}{`5}
647 \DeclareMathSymbol{6}{\mathalpha}{legacymaths}{`6}
648 \DeclareMathSymbol{7}{\mathalpha}{legacymaths}{`7}
649 \DeclareMathSymbol{8}{\mathalpha}{legacymaths}{`8}
650 \DeclareMathSymbol{9}{\mathalpha}{legacymaths}{`9}
651 \DeclareMathSymbol{\Gamma}{\mathalpha}{legacymaths}{0}
652 \DeclareMathSymbol{\Delta}{\mathalpha}{legacymaths}{1}
653 \DeclareMathSymbol{\Theta}{\mathalpha}{legacymaths}{2}
654 \DeclareMathSymbol{\Lambda}{\mathalpha}{legacymaths}{3}
655 \DeclareMathSymbol{\Xi}{\mathalpha}{legacymaths}{4}
656 \DeclareMathSymbol{\Pi}{\mathalpha}{legacymaths}{5}
657 \DeclareMathSymbol{\Sigma}{\mathalpha}{legacymaths}{6}
658 \DeclareMathSymbol{\Upsilon}{\mathalpha}{legacymaths}{7}
659 \DeclareMathSymbol{\Phi}{\mathalpha}{legacymaths}{8}
660 \DeclareMathSymbol{\Psi}{\mathalpha}{legacymaths}{9}
661 \DeclareMathSymbol{\Omega}{\mathalpha}{legacymaths}{10}
662 \DeclareMathSymbol{+}{\mathbin}{legacymaths}{43}
663 \DeclareMathSymbol{=}{\mathrel}{legacymaths}{61}
664 \DeclareMathDelimiter{(}{\mathopen} {legacymaths}{40}{largesymbols}{0}
665 \DeclareMathDelimiter{)}{\mathclose}{legacymaths}{41}{largesymbols}{1}
666 \DeclareMathDelimiter{[}{\mathopen} {legacymaths}{91}{largesymbols}{2}
667 \DeclareMathDelimiter{]}{\mathclose}{legacymaths}{93}{largesymbols}{3}
668 \DeclareMathDelimiter{/}{\mathord}{legacymaths}{47}{largesymbols}{14}
669 \DeclareMathSymbol{\mathdollar}{\mathord}{legacymaths}{36}
670 \DeclareSymbolFont{operators}\encodingdefault\rmdefault\mddefault\updefault
671 \SetSymbolFont{operators}{normal}\encodingdefault\rmdefault\mddefault\updefault
672 \SetMathAlphabet\mathrm{normal}\encodingdefault\rmdefault\mddefault\updefault
673 \SetMathAlphabet\mathit{normal}\encodingdefault\rmdefault\mddefault\itdefault
674 \SetMathAlphabet\mathbf{normal}\encodingdefault\rmdefault\bfdefault\updefault
675 \SetMathAlphabet\mathsf{normal}\encodingdefault\sfdefault\mddefault\updefault
676 \SetMathAlphabet\mathtt{normal}\encodingdefault\ttdefault\mddefault\updefault
677 \SetSymbolFont{operators}{bold}\encodingdefault\rmdefault\bfdefault\updefault
678 \SetMathAlphabet\mathrm{bold}\encodingdefault\rmdefault\bfdefault\updefault
679 \SetMathAlphabet\mathit{bold}\encodingdefault\rmdefault\bfdefault\itdefault
680 \SetMathAlphabet\mathsf{bold}\encodingdefault\sfdefault\bfdefault\updefault
681 \SetMathAlphabet\mathtt{bold}\encodingdefault\ttdefault\bfdefault\updefault
682 \let\font@warning\zf@font@warning
683 % \end{macrocode}
684 % The end! Thanks for coming.
685 %\iffalse
686 %</classfile>
687 %\fi
688 %
689 % \clearpage
690 % \begingroup
691 % \renewenvironment{theglossary}
692 % {\small\list{}{}
693 % \item\relax
694 % \glossary@prologue\GlossaryParms
695 % \let\item\@idxitem \ignorespaces
696 % \def\pfill{\hspace*{\fill}}}
697 % {\endlist}
698 % \PrintChanges
699 % \endgroup
700 %
701 % \setcounter{IndexColumns}{2}
702 % \PrintIndex
703 %
704 % \Finale
705 %
706 %\iffalse
707 %
708 %
709 %<*dtx-style>
710 % \begin{macrocode}
711 \ProvidesPackage{icsv-dtx}
712
713 % Better float parameters: (from the TeX FAQ)
714 \renewcommand{\topfraction}{.85}
715 \renewcommand{\bottomfraction}{.7}
716 \renewcommand{\textfraction}{.15}
717 \renewcommand{\floatpagefraction}{.66}
718 \renewcommand{\dbltopfraction}{.66}
719 \renewcommand{\dblfloatpagefraction}{.66}
720 \setcounter{topnumber}{9}
721 \setcounter{bottomnumber}{9}
722 \setcounter{totalnumber}{20}
723 \setcounter{dbltopnumber}{9}
724 % Section heading customisation:
725 \renewcommand\section{\@startsection {section}{1}{\z@}%
726 {-3ex \@plus -1ex \@minus -.2ex}%
727 {2ex \@plus 0.2ex}%
728 {\centering\normalsize\scshape}}
729 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
730 {-2.5ex\@plus -1ex \@minus -.2ex}%
731 {1.5ex \@plus 0.2ex}%
732 {\centering\normalsize\itshape}}
733 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
734 {-2ex\@plus -1ex \@minus -.2ex}%
735 {1.5ex \@plus 0.2ex}%
736 {\centering\normalfont\normalsize}}
737 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
738 {3.25ex \@plus1ex \@minus.2ex}%
739 {-1em}%
740 {\normalfont\normalsize\itshape}}
741 \let\subparagraph\undefined
742 \def\@maketitle{%
743 \newpage
744 {\centering
745 {\large\@title\par}\vskip1em
746 \textsc\@author\par\vskip1em
747 \@date\par}\vskip2em}
748 % Abstract customisation:
749 \renewenvironment{abstract}{%
750 \begin{trivlist}\item[]
751 \setlength\leftskip{0.15\textwidth}
752 \setlength\rightskip{0.15\textwidth}
753 \small\textit{Abstract}\quad}{\end{trivlist}}
754 % TOC customisation: Make it two-column to save space;
755 % Remove leaders in the TOC, replace with \quad.
756 \setcounter{tocdepth}{2}
757 \renewcommand\tableofcontents{%
758 \section*{\contentsname}
759 \begin{trivlist}\item[]
760 \begin{multicols}{2}
761 \setlength\parskip{0pt}
762 \small
763 \@starttoc{toc}%
764 \end{multicols}
765 \end{trivlist}}
766 \renewcommand*\l@section[2]{%
767 \ifnum \c@tocdepth >\z@
768 \addpenalty\@secpenalty
769 \addvspace{1.0em \@plus\p@}%
770 \setlength\@tempdima{1.5em}%
771 \begingroup
772 \raggedright
773 \parindent \z@
774 \rightskip \z@
775 \parfillskip \@flushglue
776 \leavevmode
777 \advance\leftskip\@tempdima
778 \hskip -\leftskip
779 #1\quad\nobreak#2\hfil\par
780 \endgroup
781 \fi}
782 \def\@dottedtocline#1#2#3#4#5{%
783 \ifnum #1>\c@tocdepth \else
784 {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip \@flushglue
785 \parindent #2\relax\@afterindenttrue
786 \interlinepenalty\@M
787 \leavevmode
788 \raggedright
789 \@tempdima #3\relax
790 \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
791 {#4}\quad\nobreak#5\hfil\par}%
792 \fi}
793
794 % Better footnotes:
795 \let\old@makefntext\@makefntext
796 \renewcommand\@makefntext[1]{%
797 \vspace{2pt}%
798 \setlength\parindent{-1.8em}%
799 \setlength\leftskip{1.8em}%
800 \makebox[1.8em][l]{\normalfont\small\@thefnmark.}#1}
801
802 \setcounter{IndexColumns}{2}
803 \renewenvironment{theglossary}
804 {\small\list{}{}
805 \item\relax
806 \glossary@prologue\GlossaryParms
807 \let\item\@idxitem \ignorespaces
808 \def\pfill{\hspace*{\fill}}}
809 {\endlist}
810
811 \usepackage{amstext,array,booktabs,calc,color,fancyvrb,graphicx,hyperref,ifthen,longtable,refstyle,varioref}
812 \usepackage[T1]{fontenc}
813 \usepackage{lmodern}
814 \usepackage[sc,osf]{mathpazo}
815
816 \linespread{1.069} % A bit more space between lines
817 \frenchspacing % Remove ugly extra space after punctuation
818
819 \hypersetup{colorlinks, breaklinks, linktocpage,
820 linkcolor=red, citecolor=red, filecolor=blue, urlcolor=blue}
821
822 \newcommand*\setexsize[1]{\let\examplesize#1}
823 \newcommand*\setverbwidth[1]{\def\auxwidth{#1}}
824
825 \newcommand*\name[1]{{#1}}
826 \newcommand*\pkg[2][]{\relax
827 \edef\@tempa{#1}\relax
828 \ifx\@tempa\@empty
829 \textsf{\mbox{#2}}\else
830 \href{#1}{\textsf{\mbox{#2}}}\fi}
831 \newcommand*\env[1]{\textsf{#1}}
832
833 \newcommand*\note[1]{\unskip\footnote{#1}}
834
835 \let\latin\textit
836 \def\eg{\latin{e.g.}}
837 \def\Eg{\latin{E.g.}}
838 \def\ie{\latin{i.e.}}
839 \def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}}
840
841 \def\TeX{\smash{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X}\spacefactor1000\relax}
842
843 % \end{macrocode}
844 %</dtx-style>
845 %
846 %\fi
847 %
848 % \typeout{************************************************}
849 % \typeout{*}
850 % \typeout{* To finish the installation, move the following}
851 % \typeout{* file into a directory searched by TeX:}
852 % \typeout{*}
853 % \typeout{* \space\space\space icsv.cls}
854 % \typeout{*}
855 % \typeout{************************************************}
856 %
857 \endinput
858