% \iffalse
%   (This is a META-COMMENT.)
%
%   This is file `cdpbundl.dtx'.
%
%   This file is part of a work named "C.D.P. Bundle".
%
%   Copyright (C) 1999-2005 by Gustavo MEZZETTI <mezzetti@math.unipd.it>.
%
%   The C.D.P. Bundle may be distributed and/or modified under the
%   conditions of the LaTeX Project Public License, either version 1.3
%   of this license or (at your option) any later version.
%   The latest version of this license is in
%     http://www.latex-project.org/lppl.txt
%   and version 1.3 or later is part of all distributions of LaTeX
%   version 2003/12/01 or later.
%
%   The C.D.P. Bundle has the LPPL maintenance status
%     "author-maintained".
%
%   The file `manifest.txt' that comes along with this file specifies
%   what the C.D.P. Bundle consists of; more precisely, it explains how
%   the locutions "Work" and "Compiled Work", used in the LaTeX Project
%   Public License, are to be interpreted in the case of this work.
%
%   Note that the distribution of this file alone is "distribution of
%   only part of the Work" in the sense of the LaTeX Project Public
%   License, and is not allowed.
%
%   (End of the META-COMMENT.)
% \fi
%
% \def\filename{cdpbundl.dtx}
% \def\fileversion{0.33}
% \def\filedate{2005/01/01}
% \def\docdate {2005/01/01}
% \def\doclongdate{January~1, 2005}
%
% \changes{0.30}{2001 Jul 01}{First release of the C.D.P. Bundle}
% \changes{0.31}{2001 Dec 01}{Added support for the \protect\opz{usePS}
%   option in the \protect\packlass{\protect\cdpaddon} package}
% \changes{0.32}{2002 Jul 01}{Removed support for the \protect\opz{usePS}
%   option in the \protect\packlass{\protect\cdpaddon} package}
% \changes{0.33}{2005 Jan 01}{Reorganized code of the
%   \protect\packlass{\protect\articoletteracdp} class and of the
%   \protect\packlass{\protect\cdpaddon} package to make it compatible
%   with the \protect\packlass{\protect\hyperref} package}
%
% \CheckSum{4756}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
% \MakeShortVerb{\"}
% \DeleteShortVerb{\|}
%
% \DoNotIndex{\begin,\end,\def,\let,\else,\fi,\@ifdefinable,\@empty}
% \DoNotIndex{\newcommand,\renewcommand}
% \DoNotIndex{\newenvironment,\renewenvironment}
% \DoNotIndex{\z@,\z@skip,\p@,\@ne,\tw@,\thr@@,\@m,\@M,\m@ne}
% \DoNotIndex{\setlength,\setcounter,\addtolength}
% \DoNotIndex{\expandafter,\do,\relax,\advance,\multiply,\divide}
% \DoNotIndex{\DeclareOption,\ExecuteOptions,\ProcessOptions}
% \DoNotIndex{\",\.\@}
%
% \IndexPrologue{
%   \section{\indexname}
%   Numbers in italics refer to the page where the corresponding entry
%   is described, the ones underlined to the code line of the
%   definition, the rest to the code lines where the entry is used.
% }
%
% \GlossaryPrologue{\section{Change History}}
%
% \setcounter{StandardModuleDepth}{1}
%
% \newcommand*{\DS}{\textsf{DocStrip}}
% \renewcommand*{\partname}{Part}
% \newcommand*{\cdpbundl}{cdpbundl}
% \newcommand*{\letteracdp}{letteracdp}
% \newcommand*{\articoletteracdp}{articoletteracdp}
% \newcommand*{\adiseal}{adiseal}
% \newcommand*{\lettcdpadi}{lettcdpadi}
% \newcommand*{\cdpaddon}{cdpaddon}
% \newcommand*{\hyperref}{hyperref}
% \newcommand*{\epsfig}{epsfig}
% \newcommand*{\example}{cdpshues-example.def}
% \newcommand*{\epson}{epson-stylus-740.def}
% \newcommand*{\hplj}{hp-laserjet-4500.def}
% \newcommand*{\cdpshues}{cdpshues.cfg}
% \newcommand*{\textoken}[1]{\( \langle\mbox{\normalfont #1}\rangle \)}
% \makeatletter
% \newcommand*{\myspecialindex}[2]
%    {\special@index{#1\actualchar#2\encapchar main}}
% \makeatother
% \newcommand*{\counterindex}[1]{\myspecialindex{#1}{{\string\ttfamily
%    \space #1} (counter)}\index{counters:\levelchar{\protect\ttfamily
%    #1}\encapchar usage}}
% \newcommand*{\optuseindex}[1]{\SortIndex{#1}{\protect\opz{#1}
%    (option)\encapchar usage}\index{options:\levelchar
%    \protect\opz{#1}\encapchar usage}}
% \newcommand*{\opz}[1]{{\normalfont\ttfamily #1}}
% \newcommand*{\iopz}[1]{$\mbox{\opz{#1}}\optuseindex{#1}}
% \newcommand*{\eopz}[1]{\mathbin{|}\mbox{\opz{#1}}\optuseindex{#1}}
% \newcommand*{\fopz}{$}
% \newcommand*{\packlass}[1]{{\normalfont\ttfamily #1}}
% \newcommand*{\filedir}[1]{{\normalfont\ttfamily #1}}
% \newcommand*{\eqref}[1]{(\ref{#1})}
%
% \DeclareFixedFont{\lhnss}{OT1}{cmss}{m}{n} {12}
% \DeclareFixedFont{\lhbss}{OT1}{cmss}{m}{n} {17}
% \DeclareFixedFont{\lhrm} {OT1}{cmr} {m}{n} {9}
% \DeclareFixedFont{\lhit} {OT1}{cmr} {m}{it}{9}
% \DeclareFixedFont{\lhtt} {OT1}{cmtt}{m}{n} {9}
%
%
%
% \title{
%    The C.D.P.~Bundle\thanks{This file has version
%    \fileversion, release date \filedate;
%    last documentation update: \docdate.
%    Copyright \copyright~1999--2005 by G.~Mezzetti
%    (see page~\pageref{S:Copy}).}
% }
% \author{G. Mezzetti}
% \date{\doclongdate}
%
% \maketitle
%
% \begin{abstract}
%    A bundle of \LaTeX\ (former \LaTeXe) classes and packages is
%    described, which is used by the \emph{Coordinamento dei Dottorandi e
%    dei Dottori di Ricerca dell'Universit\`{a} di Padova} (a free and
%    informal association of Ph.D.  students and Ph.D.'s at the
%    university of Padua, Italy) to write its ``official'' letters.
%    These classes and packages take care of formatting the letters as
%    required by the standards of this association; in particular, they
%    make it very easy to include its seal, both in black-and-white and
%    in color, at the top of pages.
% \end{abstract}
%
% \tableofcontents
% \listoffigures
%
% \clearpage
% \begingroup
%
%    \setlength{\parskip}{\medskipamount}
%    \setlength{\parindent}{0pt}
%
% \section*{Copyright notice}
%    \label{S:Copy}
%    \vspace{-\parskip}
%
%    Copyright \copyright~1999--2005 by Gustavo \textsc{Mezzetti}.  All
%    rights are reserved, except as noted below.
%
%    This document has been produced by feeding to a \LaTeX\ typesetting
%    engine the file \filedir{\filename} version \fileversion\ (\docdate).
%    This file is part of a work named ``C.D.P.  Bundle''.
%
%    The C.D.P. Bundle may be distributed and/or modified under the
%    conditions of the \LaTeX\ Project Public License, either version~1.3
%    of this license or (at your option) any later version.  The latest
%    version of this license is in
%    \begin{list}{\setlength{\topsep}{0pt}}\item\relax
%      \ttfamily
%      http://www.latex-project.org/lppl.txt
%    \end{list}
%    and version~1.3 or later is part of all distributions of \LaTeX\
%    version 2003/12/01 or later.
%
%    The C.D.P. Bundle has the LPPL maintenance status ``author-maintained''.
%
%    The file \filedir{manifest.txt} included in the C.D.P. Bundle
%    specifies what the C.D.P. Bundle consists of; more precisely,
%    it explains how the locutions ``Work'' and ``Compiled Work'',
%    used in the \LaTeX\ Project Public License, are to be interpreted
%    in the case of this work.
%
%    Permission is granted to make new printed copies of this document,
%    by any means (\emph{e.g.}, photocopying, direct printing from the
%    electronic version, and so on).
%
%    Note, anyway, that the distribution of the file \filedir{\filename}
%    alone is ``distribution of only part of the Work'' in the sense of
%    the \LaTeX\ Project Public License, and is not allowed: you must
%    distribute it together with all other files in the C.D.P. Bundle
%    (see the file \filedir{manifest.txt}).
%
%    See Subsection~\ref{sS:License} on page~\pageref{sS:License} for
%    more information.
%
% \section*{Author's addresses}
%    \vspace{-\parskip}
%
%    The recommended way to contact the author is by e-mail; his address is:
%
%    \begin{list}{\setlength{\topsep}{0pt}}\item\relax
%      \ttfamily
%      mezzetti@math.unipd.it
%    \end{list}
%
%    Please include the \emph{exact} phrase \verb*|C.D.P. Bundle| in the
%    \emph{subject} of your message; otherwise, your message could be
%    thrown away by a mail filter.  In this regard, the weakness of the
%    laws concerning the protection of privacy forces me to explicitly
%    forbid the use of the above address for any kind of advertising,
%    marketing, polling, or similar commercial or statistical contact.
%
%    If you have no e-mail access, write to:
%
%    \begin{list}{\setlength{\topsep}{0pt}}\item\relax
%      Gustavo \textsc{Mezzetti}\\
%      Dip.\ di Matematica Pura e Applicata\\
%      Via G.~Belzoni, 7\\
%      I--35128\quad PADOVA\\
%      Italy
%    \end{list}
%
% \endgroup
%
%
%
% \setcounter{secnumdepth}{0}
%
%
%
% \clearpage
% \section{Introduction}
%
%    The \emph{Coordinamento dei Dottorandi e dei Dottori di Ricerca
%    dell'Universit\`a di Padova} (henceforth simply referred to as
%    ``\emph{Coordinamento}'') is a free association of Ph.D.'s and Ph.D.
%    students who took their degree, or are still studying, at the
%    University of Padova (Padua), Italy.  Discussing its precise nature is
%    completely outside the scope of this document;\footnote{Readers who
%    are interested in learning precisely what the \emph{Coordinamento}
%    is should refer to the following web page:
%    \texttt{http://www.dei.unipd.it/\~{}assdott/}.} the only thing that
%    concerns us here is that it writes letters of a somewhat
%    ``official'' kind, which, for this reason, must bear its letterhead
%    on the top of their first page.  These classes and packages serve to
%    prepare this kind of letters: they can print the letterhead, both in
%    black-and-white and in color, depending on what the user requires,
%    but they can do many, many other things too.
%
%    \subsection{Credits and disclaimer}
%
%    The \packlass{\letteracdp} document class was originally based on
%    the \packlass{letter} standard \LaTeX\ class.  During the time, it
%    went through so many deep revisions, that by now it bears
%    practically no relation with the original \packlass{letter} class;
%    but we want to acknowledge the ``historical'' source anyway.  The
%    \packlass{\articoletteracdp} document class uses some ideas borrowed
%    from the \packlass{article} standard \LaTeX\ class.
%
%    The author thanks heartfully Alessandro Ambrosi and Roberto
%    Strepparava, who tested the software and constantly stimulated
%    improvements and refinements, and Paolo Cojazzi, who, besides this,
%    also helped with the compression tools.
%
%    As usual with computer software, no warranty is given that
%    this code will work properly, or even that it will work at all.
%    Using this code can even result in loss of data and/or damages
%    to your disks and your storage media.
%    If you use this code, you do so exclusively at your own risk!
%
%    See Subsection~\ref{sS:License} and the \LaTeX\ Project Public
%    License for more information.
%
%    \subsection{About this document}
%
%    This document, like many documentation files distributed for
%    \LaTeX, is divided into two parts.
%
%    The first part, \emph{User's Manual}, should contain all the
%    documentation you need to succesfully \emph{use} the classes and
%    packages that this document presents; but unfortunately (for you!),
%    this document is still unfinished, so this information is \emph{not}
%    given here; instead, you are referred to some other sources (all
%    available through the world-wide web).  The only pieces of
%    information you will find in this part are how to install those
%    classes and packages and how to generate this documentation.  This
%    part, however, specifies to what extent, and under which conditions,
%    you are allowed to use and distribute the classes and packages
%    presented in this document.
%
%    The second part, \emph{Implementation}, can be omitted if you want
%    (explanations on how to omit it are given at the beginning of the
%    part itself), and contains information that concerns only
%    ``hackers'' who want to learn how the macros that this document
%    presents are \emph{implemented}.  Actually, this part contains the
%    complete listing of the \LaTeX\ code that implements the
%    macros---unfortunately, almost without comments---in the usual \DS\
%    format; if you are not a \LaTeX\ hacker, this part will not mean
%    anything to you.
%
%    \subsubsection{English, of course!}
%
%    This document, as you can see, is written in English, although the
%    software it describes is intended mainly for Italian users, and was
%    actually developed for a specific application limited to an Italian
%    university (Padua).  Previous versions of this document used to
%    contain in this place a section that, in a somewhat apologetic tone,
%    offered various reasons in support of the choice of English.  Since
%    the inclusion of the C.D.P.  Bundle in the Comprehensive \TeX\ Archive
%    Network, however, there is no longer need to justify what now looks
%    simply an obliged choice, due to the international nature of the CTAN.
%
%
%
% \setcounter{secnumdepth}{3}
%
%
%
% \clearpage
% \part{User's Manual}
%
% \section{About this part}
%
%    We shall only give instructions on how to install the bundle and
%    how to generate this documentation; partial instructions on how to use
%    the classes and packages contained in the bundle can be found
%    in several documents written by the author
%    \cite{tutti,esempi,etichette,novita,nts,ver028,adi,cdpaddon,ver031}, but
%    a systematic user's manual is no longer foreseen.~\mbox{:-(}^^A ) match
%    \spacefactor\sfcode`.  \space
%    Note that including in this document the instructions on how to generate
%    the document itself may seem pretty useless, but actually isn't:
%    you might be reading a copy obtained from another person.
%
% \section{Installing the C.D.P. Bundle and generating this documentation}
%
%    As usual for \LaTeX\ distributions, the C.D.P. Bundle is
%    distributed in the form of a \filedir{.dtx} file, namely
%    \filedir{cdpbundl.dtx}, and an accompanying \filedir{.ins} file,
%    namely \filedir{cdpbundl.ins}.
%
%    \subsection{Installation}
%
%    To install the bundle, run \LaTeX\ (or Plain \TeX) once on the file
%    \filedir{cdpbundl.ins}.  This will generate the following \LaTeX\
%    input files:
%    \begin{quote}
%      \ttfamily
%      \adiseal.sty\\
%      \articoletteracdp.cls\\
%      \cdpaddon.sty\\
%      \example\\
%      \cdpshues\\
%      \epson\\
%      \hplj\\
%      \lettcdpadi.cls\\
%      \letteracdp.cls
%    \end{quote}
%    To finish the installation, move them into a \LaTeX\ input
%    directory.  (If you want, you can discard one, more, or all of the
%    files whose name ends in \filedir{.def}, each of which contains color
%    definitions for the seal appropriate for a particular printer.  See
%    Subsection~\ref{sS:config} for information about how these files
%    are used for this purpose.) The above listing of all the files you
%    need to move is also displayed on the terminal at the end of the run
%    of the file \filedir{cdpbundl.ins}.  The documentation of your \TeX\
%    installation should tell you how to find the \LaTeX\ input
%    directory/ies, and probably also how to create new \LaTeX\ input
%    directories reserved to hold your private classes and packages.  If
%    your \TeX\ installation offers you the chance of defining your
%    private \LaTeX\ input directories, I recommend you exploit this
%    possibility and place the generated files into such a directory.
%
%    \subsection{Configuring the \packlass{\cdpaddon} package}
%    \label{sS:config}
%
%    The \packlass{\cdpaddon} package is the part of the C.D.P. Bundle
%    that takes care of coloring the C.D.P.  seal, which appears in
%    black-and-white if you don't load this package.  Experience by trial
%    and error has shown that some configuration work may be necessary in
%    order to obtain (more or less) correctly-\null looking colors in the
%    seal.  This happens because different printers can render color hues
%    in different ways, sometimes producing surprising results.
%
%    The configuration mechanism works as follows.  For each printer
%    you plan to use there should be a definition file that specifies what
%    hues should be used to color the C.D.P.  seal.  To select which
%    file to load, the user indicates its name in an option passed to the
%    \packlass{\cdpaddon} package.  If the user gives no such indication,
%    the package reads from a configuration file the name of the default
%    definition file, and uses that file.  In both cases, if the
%    designated definition file cannot be read, the package issues a
%    warning and resorts, for the hues, to an emergency definition
%    (which, as you can expect, is not very pleasant to the eye).
%
%    \subsubsection{Writing color definition files}
%
%    The task of a color definition file is simply to define two colors
%    called "slight@col" and "strong@col" (when the definition file is
%    read, the "@"~characters are treated as ordinary letters).
%    "slight@col" is the color used to paint the inner of the D and of
%    the P in the seal, "strong@col" is the color used to draw the lines.
%    You define these colors by means of the "\definecolor" command: see
%    \textsl{\LaTeX book} \cite[Section~7.3 and
%    Subsection~C.14.3]{LaTeXbook} for information about colors and the
%    "\definecolor" command.
%
%    The file \filedir{\example}, too, contains comments which explain
%    how to write new definition files for the \packlass{\cdpaddon}
%    package.  Indeed, this file is supplied only as a prototype: I suggest
%    that you write a new file by making a copy of it (with the
%    appropriate name) and modifying it with the help of the comments.
%    The colors defined in this file are just an example, and indeed they
%    are exactly the emergency colors used internally by the
%    \packlass{\cdpaddon} package when it cannot load a definition
%    file---that is, a completely useless definition!
%
%    The file \filedir{\example} uses the \texttt{named} color model,
%    but of course you can use any color model you want.  Indeed, it is
%    best to use ``direct'' color models like \texttt{rgb} or
%    \texttt{cmyk}, that allow you to drive the printer with precision:
%    after all, it is exactly for this purpose that you are writing the
%    file!  The other two definition files included in the C.D.P. Bundle
%    illustrate the use of these color models.
%
%    \subsubsection{Selecting a color definition file via an option}
%
%    The first way to select a particular color definition file among the
%    ones you have installed is to pass a suitable option to the
%    \packlass{\cdpaddon} package.  More precisely, the option name has
%    the form \opz{printer:}\( \langle\textit{bare file name}\rangle \),
%    all in a row without intervening spaces, where \(
%    \langle\textit{bare file name}\rangle \) is the name of the
%    definition file you want to load \emph{without} the extension
%    \filedir{.def}.  For example, to load a file called
%    \filedir{acme-wylejet.def}, you pass the option
%    \opz{printer:acme-wylejet}.  Explicitly, you would write
%    \begin{verbatim}\usepackage[printer:acme-wylejet]{cdpaddon}\end{verbatim}
%    to load the \packlass{\cdpaddon} package and the color definitions
%    suitable for the ACME WyleJet printer (the printer preferred by
%    8~coyotes out of~10).  Similarly, to load the file
%    \filedir{\example} you would write
%    \begin{verbatim}\usepackage[printer:cdpshues-example]{cdpaddon}\end{verbatim}
%    and so on.  Of course, you can still specify, as well, the other
%    options listed in~\cite{cdpaddon}: for instance,
%    \begin{verbatim}\usepackage[hypertext,printer:acme-wylejet]{cdpaddon}\end{verbatim}
%    activates the hyperlinks and selects the colors for the
%    ACME WyleJet printer.
%
%    When no \opz{printer:}\ldots\ option is specified, a default
%    definition file is loaded, as explained in the next section.  For
%    elegance, you can explicitly request this default definition file with
%    the \opz{printer:Default} option (note the capitalization).  Of
%    course, this implies that you cannot have a definition file called
%    \filedir{Default.def}; but \filedir{default.def} is absolutely OK,
%    and you can select it with \opz{printer:default}.  Moreover, the
%    \opz{printer:None} option forces the \packlass{\cdpaddon} package to
%    ignore the configuration file and to use the emergency, built-in
%    colors; again, \opz{printer:none}, instead, tries to load a color
%    definition file called \filedir{none.def}.
%
%    \subsubsection{Declaring the default color definition file}
%
%    Most users will have only one printer, and even those users who
%    have access to several printers will use one of them more often than
%    the others.  Therefore, it is wise to have a second way of selecting
%    a definition file, to be used when the user does not specify one.
%    This is done by indicating in a configuration file the name of a
%    default color definition file.  This configuration file is called
%    \filedir{\cdpshues}.
%
%    The \filedir{\cdpshues} file should contain only zero or one (but
%    preferably one!) "\DeclareCDPSealHuesDefault" command.  This command
%    can be used only here, and only once, since it deactivates itself
%    when executed, and also stops \LaTeX\ from reading any further in
%    the configuration file.  In its unique (mandatory) argument, one
%    puts the name, \emph{without} the extension \filedir{.def}, of the
%    default color definition file.  Do not include any other command in
%    your configuration file, because the effect of any other command is
%    undefined.
%
%    The \filedir{\cdpshues} file included in the C.D.P. Bundle contains
%    comments that help you to modify it in order to declare your new
%    default color definition file(s).  The recommended way of doing this
%    is:
%    \begin{enumerate}
%    ^^A ( paren match
%    \renewcommand*{\labelenumi}{\theenumi)}
%    \item
%    make a backup copy (good idea indeed!) of the original configuration
%    file under a convenient name, for example
%    \filedir{\cdpshues.original};
%    \item
%    modify the \filedir{\cdpshues} file following the advice given
%    in its comments;
%    \item
%    if you want, delete all comments from the (new version of the)
%    \filedir{\cdpshues} file, to save disk space.
%    \end{enumerate}
%
%    The obsolete version of the \packlass{\cdpaddon} package
%    documented in~\cite{cdpaddon} was not configurable: it was
%    programmed to read the color definitions from a file called
%    \filedir{cdpshues.def}, and this name was hard-coded in the package.
%    To maintain compatibility with this version, the file
%    \filedir{\cdpshues} included in the C.D.P. Bundle designates as the
%    default color definition file exactly a file named
%    \filedir{cdpshues.def}.  Consequently, if you  install the supplied
%    files without making any change to them, the \packlass{\cdpaddon}
%    package will continue to exhibit the old behavior, reading the
%    legacy \filedir{cdpshues.def} file if you have one installed, and
%    adopting the emergency colors otherwise.  Note that no actual
%    \filedir{cdpshues.def} file is included in the C.D.P. Bundle.
%
%    \subsection{The image of the ADI seal}
%
%    The C.D.P. Bundle does \emph{not} include the file containing the
%    image of the ADI seal.  The reason for this is purely legal: I~do
%    not own the copyright for the ADI seal, so I have no right to
%    distribute it under a license of my choice.  But of course, without
%    this file it is impossible for the \packlass{\adiseal} package, the
%    part of the C.D.P. Bundle that has this task, to print, or display,
%    the seal.  Since this is just a legal problem and not a \TeX nical one, I
%    cannot foresee how long it will take to solve it; perhaps I'll
%    never find a solution, because the problem does not depend on
%    me.
%
%    However, by default the \packlass{\adiseal} package does \emph{not}
%    draw the ADI seal, but simply a placeholder; it will try to draw
%    the seal only if explicitly requested via the \opz{usepixmap} option
%    (see~\cite{adi}).  This means that, by default, the package does
%    \emph{not} need the file with the image of the ADI seal, and will
%    try to access it only if invoked with the \opz{usepixmap} option;
%    moreover, this option will be ignored if the file cannot be found.
%    In conclusion, the \packlass{\adiseal} package can recover
%    gracefully even if the file is absent.
%
%    The \packlass{\adiseal} package expects to find the image of the ADI
%    seal in a file in Encapsulated PostScript format called
%    \filedir{\adiseal.eps}.  The image should be exactly \( 60\,\mbox{bp}
%    \) wide and \( 42\,\mbox{bp} \) tall; larger images will be clipped,
%    smaller images will not be well aligned.  The resolution is not
%    fixed by the \packlass{\adiseal} package, but of course the best
%    results are obtained when it matches the target printer resolution.
%    I don't think that with this information you will be able to
%    manifacture the correct image by yourself, but at least you can
%    check if a file that you have does (not) fit!
%
%    Of course, even if I cannot distribute it under the \LaTeX\
%    Project Public License, still I have prepared and made available on
%    the Web an ``official'' \filedir{\adiseal.eps} file (why didn't you
%    say it before, you'll say!): it can be found in
%    \begin{quote}
%      \ttfamily
%      \noindent
%      \rlap{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/adiseal.eps}
%    \end{quote}
%    Its resolution is \( 300\,\mbox{dpi} \), both vertical and
%    horizontal; the image is 250 pixels wide and 175 pixels tall, which,
%    at this resolution, correspond exactly to \( 60\,\mbox{bp} \) by \(
%    42\,\mbox{bp} \).  Again, I am sorry that you need to download this
%    file separately, but\ldots
%
%    I have also prepared a special enhanced variation of the
%    \filedir{\adiseal.eps} file for use with O\kern-.03em
%    z\kern-.15em\TeX, Andrew Trevorrow's implementation of \TeX\ for the
%    Macintosh.  This enhanced file enables O\kern-.03em z\kern-.15em\TeX\
%    to display the seal on its integrated previewer, and to print it
%    also on non-PostScript printers.  To obtain this file, ask it
%    directly to me by e-mail; my address is:
%    \begin{quote}
%      \ttfamily
%      mezzetti@math.unipd.it
%    \end{quote}
%    Perhaps, in the future, I shall erect a mail filter to protect
%    myself from junk-mail, so be sure to cite the word
%    \texttt{\adiseal.eps} in the \emph{subject} of your message.
%
%    \subsection{Documentation}
%
%    To produce this documentation, run \LaTeX\ three times (for the
%    table of contents to be correct) on the file \filedir{\cdpbundl.dtx}.
%    This won't produce the index and the change history, however: for
%    those, you have to run MakeIndex on the files \filedir{\cdpbundl.idx}
%    and \filedir{\cdpbundl.glo}, produced during the previous \LaTeX\
%    run, with the styles \filedir{gind.ist} and \filedir{gglo.ist},
%    respectively (these styles are part of the standard \LaTeX\
%    distribution); then pass \filedir{\cdpbundl.dtx} through \LaTeX\
%    twice more.
%
% \section{How to use the C.D.P. Bundle}
%
%    The C.D.P. Bundle contains three \LaTeX\ document classes, namely
%    \packlass{\letteracdp}, \packlass{\articoletteracdp}, and
%    \packlass{\lettcdpadi}, two \LaTeX\ packages, called
%    \packlass{\adiseal} and \packlass{\cdpaddon}, and some definition
%    and configuration files pertaining to the \packlass{\cdpaddon}
%    package.  As already said, the actual purpose of this section is not
%    to explain you how to use these macro files, but only to give you
%    references to documents where you can find the explanations.
%
%    For instructions on how to use the \packlass{\letteracdp} class
%    the reader is referred to \cite{tutti,esempi,etichette,nts,ver028,ver031}.
%    Note, however, that the class is syntactically compatible with the
%    \packlass{letter} standard \LaTeX\ class, in the sense that a
%    document prepared for the \packlass{letter} class can be compiled
%    without errors with the \packlass{\letteracdp} class; but the output
%    will be different.
%
%    As a minimal reference, fig.~\ref{fig:input} illustrates the typical
%    structure of a simple input file for the \packlass{\letteracdp}
%    document class.
%
% \iffalse
%   Meta-comment: a <*gobble> guard is needed here to prevent the
%   DocStrip program from putting the lines beginning with "%%" in the
%   generated files.
%<*gobble>
% \fi
%    \begin{figure}[tbp]
%      \begin{verbatim}\documentclass[boldsubject,italicsignature,smartindent]{letteracdp}
%% Of course, the above options are a matter of personal taste...
%
%% Name, address and signature of the sender (the name is optional):
%\name{Revinu Jitis Drofnats}
%\address{
%    Revinu~J. \textsc{Drofnats}\\
%    Department of Farm Ecology\\
%    University of St.\thinspace Anford\\
%    Haga Alto, CA~94321 (U.S.A.)
%}
%\signature{R.~J.~Drofnats\\Professor}
%\date{January~1, 2005} % as usual, date is optional, default is \today
%
%% Since we are writing in English, we redefine a couple of words:
%\renewcommand*{\subjectname}{Subject:}
%\renewcommand*{\headtoname}{To:}
%% Uncomment the following declaration if you want running heads:
%% \pagestyle{headings}
%
%
%
%\begin{document}
%
%\begin{letterhead}[Brian~K. Reid]{
%    Prof.~Brian~K. \textsc{Reid}\\
%    Department of Electrical Engineering\\
%    Stanford University\\
%    Stanford, CA~94305 (U.S.A.)
%}[
%    This is the optional subject of the letter.
%]
%
%% A string to be prepended to the date can be specified in an optional
%% argument to the \opening command:
%\opening[St.\thinspace Anford,]{Dear Prof.~Reid,}
%
%this letter is typeset using a \texttt{letterhead} environment, so it
%will be printed with the letterhead of the \emph{Coordinamento} above
%it; if you don't want it, use the \texttt{letter} environment instead.
%You can also use the \texttt{foldedletterhead} environment in place
%of the \texttt{letterhead} environment (or \texttt{foldedletter} in
%place of \texttt{letter}) to obtain a letter prepared to be folded in
%three parts, as one usually does before putting it in an envelope.
%Experiment to see what happens.
%
%\closing{Sincerely,}
%
%\end{letterhead}
%
%\end{document}\end{verbatim}
%      \caption{A sample input file for the \packlass{\letteracdp}
%        document class}
%      \label{fig:input}
%    \end{figure}
% \iffalse
%</gobble>
% \fi
%
%    For instructions on how to use the \packlass{\articoletteracdp}
%    class, see~\cite{novita}.
%
%    For instructions on how to use the \packlass{\adiseal} package and
%    the \packlass{\lettcdpadi} class, see~\cite{adi}.
%
%    For instructions on how to use the \packlass{\cdpaddon} package,
%    see~\cite{cdpaddon}.  Note, however, that this document describes an
%    obsolete version, which lacks the ability to deal with several color
%    definition files.
%
%    Please note that before using the C.D.P. Bundle you must read the
%    following license to see whether its terms are acceptable for you,
%    especially for what concerns the lack of any warranty; if they are
%    not, don't use this program.
%
%    \subsection{License}
%    \label{sS:License}
%
%    The C.D.P. Bundle is \emph{not} in the public domain: its author,
%    Gustavo \textsc{Mezzetti}, owns the copyright, and in general retains
%    all the rights therein; but as a special exception, the author
%    grants you the permissions indicated below.
%
%    \subsubsection{Distribution and/or modification}
%
%    The C.D.P. Bundle may be distributed and/or modified under the
%    conditions of the \LaTeX\ Project Public License, either version~1.3
%    of this license or (at your option) any later version.  The latest
%    version of this license is in
%    \begin{quote}
%      \ttfamily
%      http://www.latex-project.org/lppl.txt
%    \end{quote}
%    and version~1.3 or later is part of all distributions of \LaTeX\
%    version 2003/12/01 or later.
%
%    The C.D.P. Bundle has the LPPL maintenance status ``author-maintained''.
%
%    The file \filedir{manifest.txt} included in the C.D.P. Bundle
%    specifies what the C.D.P. Bundle consists of; more precisely,
%    it explains how the locutions ``Work'' and ``Compiled Work'',
%    used in the \LaTeX\ Project Public License, are to be interpreted
%    in the case of this work.
%
%    \subsubsection{Use}
%
%    The use of the C.D.P. Bundle is unrestricted, provided that you
%    accept the terms and conditions of the \LaTeX\ Project Public
%    License and of the following subsection for what concerns the absence
%    of any warranty.
%
%    \subsubsection{No warranty}
%
%    There is absolutely no warranty for the C.D.P. Bundle.  The
%    Copyright Holder provides the C.D.P. Bundle ``as is'', without
%    warranty of any kind, either expressed or implied, including, but
%    not limited to, the implied warranties of merchantability and
%    fitness for a particular purpose.  The entire risk as to the quality
%    and performance of the C.D.P. Bundle is with you.  Should the
%    C.D.P. Bundle prove defective, you assume the cost of all necessary
%    servicing, repair, or correction.
%
%    In no event will The Copyright Holder, or any other party who may
%    distribute and/or modify the C.D.P. Bundle as permitted by the
%    \LaTeX\ Project Public License, be liable to you for damages,
%    including any general, special, incidental or consequential damages
%    arising out of any use of the C.D.P. Bundle or out of inability to
%    use it (including, but not limited to, loss of data, data being
%    rendered inaccurate, or losses sustained by anyone as a result of any
%    failure of the C.D.P. Bundle to operate with any other programs),
%    even if The Copyright Holder or said other party has been advised of
%    the possibility of such damages.
%
%    \subsection{Options of the \packlass{\letteracdp} class}
%
%    Of course, you load the \packlass{\letteracdp} class by means of the
%    usual "\documentclass" declaration, which allows you to specify
%    various options.  For some reason, the complete list of all the
%    options recognized by this class has never been given in any of the
%    previous documents containing instructions about it; so, we give it
%    here.
%
%    We shall now list all the options recognized by the
%    \packlass{\letteracdp} class, including the standard ones it can
%    understand.  If an option does not appear in the list given below,
%    then that option is not recognized by the \packlass{\letteracdp}
%    class, even if it is a standard one (that is, documented in the
%    \textsl{\LaTeX book}~\cite{LaTeXbook}).
%
%    We begin with the list of standard options.  Since they are
%    already described in the \textsl{\LaTeX book}~\cite{LaTeXbook}, we
%    describe only the options that behave differently from the standard;
%    the others are just listed without description.
%
%    \begin{description}
%
%    \item[\iopz{10pt}\eopz{11pt}\eopz{12pt}\fopz]
%
%    \item[\iopz{letterpaper}\eopz{legalpaper}\eopz{executivepaper}\eopz
%      {a4paper}\eopz{a5paper}\eopz{b5paper}\fopz]
%    \hfil\null\linebreak
%    Note that \packlass{\letteracdp} uses \opz{a4paper} as the default.
%
%    \item[\iopz{landscape}\fopz]
%
%    \item[\iopz{final}\eopz{draft}\fopz]
%
%    \item[\iopz{oneside}\eopz{twoside}\fopz]
%
%    \item[\iopz{onecolumn}\eopz{twocolumn}\fopz] The \opz{twocolumn}
%    option is recognized, but triggers an error; the \opz{onecolumn}
%    option is recognized, but it is ignored because in any case the
%    document is typeset in one-column mode.  Note, however, that
%    requesting \opz{onecolumn} as a global option could make sense:
%    precisely, it could serve to inform possible packages that the
%    document has only one column.  But, precisely for this reason, this
%    option is requested by default during the class initialization;
%    there is hence no reason to specify it, but it does no harm.
%
%    \item[\iopz{leqn}\fopz]
%
%    \item[\iopz{fleqn}\fopz]
%
%    \end{description}
%
%    We now list the option specific to the \packlass{\letteracdp} class.
%
%    \begin{description}
%
%    \item[\iopz{mediumsubject}\eopz{boldsubject}\fopz]
%    The \opz{mediumsubject} option requests that the subject of the
%    letters be typeset in medium weight, while the \opz{boldsubject}
%    option makes it appear in boldface type.  The default is
%    \opz{mediumsubject}.
%
%    \item[\iopz{uprightsignature}\eopz{italicsignature}\fopz]
%    The \opz{uprightsignature} option requests that the signature of the
%    letters be typeset in upright shape, while the \opz{italicsignature}
%    option makes it appear in italic shape.  The default is
%    \opz{uprightsignature}.
%
%    \item[\iopz{noPS}\eopz{usePS}\fopz]
%    The \opz{noPS} option requests that the CDP seal be typest using
%    only the standard \LaTeX\ fonts, so that the output be printable on
%    any kind of printer, even without a PostScript interpreter.  On the
%    other hand, the \opz{usePS} option requests that it be printed using
%    PostScript commands: this enhances its graphical quality, but
%    printing the seal will require a PostScript interpreter.  The
%    default is \opz{noPS}.  \emph{Warning:} If you use this option with
%    the \packlass{\cdpaddon} package, parts of the seal will be
%    incorrectly drawn in black.
%
%    \item[\iopz{indent}\eopz{noindent}\eopz{smartindent}\eopz{shortindent}\fopz]
%    These options are used to specify the paragraph indentation, but
%    only for letters; any portion of text that is not included in a
%    letter---but normally there is no such text---is not affected by
%    these options.  The \opz{indent} option sets the paragraph
%    indentation, for letters, to one tenth of the text width,
%    unless this amount looks too bad, in which case the indentation
%    is set to 2~pica.  The \opz{noindent} option completely
%    suppressess paragraph indentation within letters.  The \opz{smartindent}
%    option sets the paragraph indentation, for letters, to the width
%    of (the last line of) the salutation, unless this amount looks
%    too bad, in which case it behaves like \opz{indent}.  The \opz{shortindent}
%    option maintains also for letters the same indentation used for
%    text not included in letters (see below); its name, chosen to be
%    more easily remembered, is due to the fact that normally it involves
%    a shorter indentation than the default one.  The default is \opz{indent}.
%    I repeat that these options do not affect any text that should appear
%    outside of letters, whose paragraphs will be always indented by
%    2~em, where the unit of 1~em is taken from the main document font;
%    this is also the paragraph indentation for letters if the
%    \opz{shortindent} option is specified.  Paragraphs of
%    postscripts are never indented.
%
%    \item[\iopz{105x37labels}\eopz{70x37labels}\eopz{Avery5352labels}\fopz]
%    These options indicate the format of the address labels.  The
%    first two options indicate address labels of mm~105\,$\times$\,37
%    and mm~70\,$\times$\,37, respectively.  The third option
%    indicates the address labels used by the standard \packlass{letter}
%    class.  Note the uppercase letter in \opz{Avery5352labels}.  The
%    default is \opz{105x37labels}.
%
%    \end{description}
%
% \StopEventually{
%    \setcounter{secnumdepth}{0}
%    \providecommand*\bysame{\leavevmode\hbox to3em{\hrulefill}\thinspace}
%
%    \clearpage
%    \begin{thebibliography}{9}
%    \addcontentsline{toc}{section}{\refname}
%
%    \setcounter{enumiv}{-1}
%
%    \bibitem{LaTeXbook}
%    L.~Lamport, \emph{\LaTeX---A Document Preparation System---User's
%       Guide and Reference Manual}, 2nd~edition, Addison-Wesley,
%       Reading, 1994.
%
%    \bibitem{tutti}
%    G.~Mezzetti, \emph{Breve presentazione d'una classe \LaTeX, denominata
%       \packlass{\letteracdp}, utile nella preparazione delle lettere del
%       Coordinamento}, technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/presentazione.tex}}
%
%    \bibitem{esempi}
%    \bysame, \emph{Esempi d'uso della classe \packlass{\letteracdp}},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/esempi.tex}}
%
%    \bibitem{etichette}
%    \bysame, \emph{Etichette degli indirizzi con la classe \packlass{\letteracdp}},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/etichett.tex}}
%
%    \bibitem{novita}
%    \bysame, \emph{Grandi novit\`{a} per \packlass{\letteracdp}:
%       arriva \packlass{\articoletteracdp}!}, technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/novita.tex}}
%
%    \bibitem{nts}
%    \bysame, \emph{Forse non tutti sanno che\ldots},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/nontuttisanno.tex}}
%
%    \bibitem{ver028}
%    \bysame, \emph{Annuncio delle versioni 0.28 della classe \packlass{\letteracdp}
%       e 0.08 della classe \packlass{\articoletteracdp}},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/ver0-28.tex}}
%
%    \bibitem{adi}
%    \bysame, \emph{Come usare il pacchetto \packlass{\adiseal}
%       (e la classe \packlass{lettcdpadi})},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/adisealistr.tex}}
%
%    \bibitem{cdpaddon}
%    \bysame, \emph{Il pacchetto \packlass{\cdpaddon}},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/cdpaddonistr.tex}}
%
%    \bibitem{ver031}
%    \bysame, \emph{Annuncio della versione 0.31 del \emph{C.D.P. Bundle}},
%       technical note downloadable from:\\
%       \rlap{\texttt{http://www.math.unipd.it/\string~mezzetti/Gustavo/Ludic/CDP/ver0-31.tex}}
%
%    \end{thebibliography}
% }
%
%
%
% \clearpage
% \part{Implementation}
%
% \section{About this part}
%
%    This part is of interest only to \LaTeX\ hackers; to avoid
%    having this part printed, look in the file \filedir{\filename}
%    for a line that looks \emph{exactly} like this
%    \begin{verbatim}%% \OnlyDescription % uncomment to discard Implementation part\end{verbatim}
%    and remove the two leading percent signs ("%%").
%
% \section{A driver for this document}
%
%    This part of the file is \emph{not} included in any generated file:
%    it is simply the driver.
%    \begin{macrocode}
%<*driver>
%    \end{macrocode}
%
%    To begin with, we load the \packlass{ltxdoc} class.
%    \begin{macrocode}
\documentclass[a4paper]{ltxdoc}
%    \end{macrocode}
%    We now set a few typesetting options.
%    First of all, we want a history listing and a full index, the latter
%    organized by line numbers.
%    \begin{macrocode}
\RecordChanges
\EnableCrossrefs
\CodelineIndex
%    \end{macrocode}
%    A two-column index is better than a three-column one, because we
%    have some rather long entries.
%    \begin{macrocode}
\setcounter{IndexColumns}{2}
%    \end{macrocode}
%    If you don't want to include the second part of this document,
%    \emph{Implementation}, uncomment the line containing the command
%    "\OnlyDescription".
%    \begin{macrocode}
%% \OnlyDescription % uncomment to discard Implementation part
%    \end{macrocode}
%    Finally, setting "\hfuzz" and "\vfuzz" to 0~points is only one
%    of the many neurotic symptoms of the author!
%    \begin{macrocode}
\hfuzz=0pt
\vfuzz=0pt
%    \end{macrocode}
%    Now input this same file, using \DS\ conventions.
%    \begin{macrocode}
\begin{document}
  \DocInput{cdpbundl.dtx}
%    \end{macrocode}
%    Then print the change list and the index.  We put these commands in
%    the driver, rather than in the comments of this file, because
%    producing the change list and the index is somewhat cumbersome, and some
%    users could prefer to omit them: such users should simply use a
%    different driver.
%    \begin{macrocode}
  \clearpage \PrintChanges
  \clearpage \PrintIndex
%    \end{macrocode}
%    When this file is read directly by \LaTeX\ without the intervention
%    of \DS, the following line will make \TeX\ stop
%    reading.
%    \begin{macrocode}
\end{document}
%    \end{macrocode}
%    End of driver module.
%    \begin{macrocode}
%</driver>
%    \end{macrocode}
%
% \section{The code for the \packlass{\letteracdp} class}
%
%    This part of the file goes into \filedir{\letteracdp.cls}.
%    \begin{macrocode}
%<*letter>
%    \end{macrocode}
%    The reader must be warned that this is only a preliminary release
%    of this code: a thorough reorganization of the macros has already
%    been planned for future releases.  Instead of putting all the code
%    in a single file and giving it the form of a document class,
%    in future releases the code will be split into several files,
%    part of which will be packages, part definition and/or
%    configuation files, and so on.
%
%    \subsection{Identification}
%
%    I don't remember exactly why I asked for the June 1997 release
%    of \LaTeXe, but I am sure that there was a reason; so, let us
%    continue to ask for it.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1997/06/01] % LaTeX2e is required!
%    \end{macrocode}
%    The usual identification; the string \texttt{(**incomplete**)}
%    will eventually be removed, I hope!
%    \begin{macrocode}
\ProvidesClass{letteracdp}
              [2005/01/01 v0.33 (**incomplete**)]
%    \end{macrocode}
%    Print a copyright message on the terminal, just below the name
%    of the class.
%    \begin{macrocode}
\typeout{Copyright (C) 1999-2005 by Gustavo MEZZETTI,
  all rights reserved.}
%    \end{macrocode}
%
%    \begin{macro}{\@letteracdp}
%    Define a macro containing the name of the class; it will be used
%    in error and warning messages.  This is done for two reasons:
%    first of all, to save tokens in macro definitions, but also to
%    avoid the risk of mispelling the name of the class in some place.
%    \begin{macrocode}
\@ifdefinable\@letteracdp{\def\@letteracdp{letteracdp}}
%    \end{macrocode}
%    \end{macro}
%
%
%    \subsection{Initial code}
%
%    \begin{macro}{\Coordinamento}
%    Define the following macros near the beginning of the code, so
%    it will be easy to change them.  The first is the full name of
%    the \emph{Coordinamento}:
%    \begin{macrocode}
\newcommand*\Coordinamento{%
  Coordinamento dei Dottorandi e dei Dottori di Ricerca
  dell'Universit\`a di Padova%
}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\CoordinamentoWWW}
%    The second is its web address:
%    \begin{macrocode}
\newcommand*\CoordinamentoWWW{%
  http://www.dei.unipd.it/\string~assdott/%
}
%    \end{macrocode}
%    \end{macro}
%
%    Declare the fonts used to print the letterhead and the footer;
%    they are declared as ``fixed fonts'' so that they are not
%    affected by options (\emph{e.g.}, \opz{12pt}), packages
%    (\emph{e.g.}, \opz{times}), and so on.
%    \begin{macro}{\@lh@nss}
%    Main font for letterhead is Computer Modern Sans Serif 12pt
%    (LetterHead\slash Normal Sans Serif):
%    \begin{macrocode}
\DeclareFixedFont\@lh@nss{OT1}{cmss}{m}{n} {12}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@lh@bss}
%    A couple of initials are printed using a bigger font, that is,
%    Computer Modern Sans Serif 17pt (LetterHead\slash Bigger Sans
%    Serif):
%    \begin{macrocode}
\DeclareFixedFont\@lh@bss{OT1}{cmss}{m}{n} {17}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@lh@rm}
%    Main font for footer: Computer Modern Roman 9pt
%    (LetterHead\slash RoMan):
%    \begin{macrocode}
\DeclareFixedFont\@lh@rm {OT1}{cmr} {m}{n} {9}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@lh@it}
%    The words ``World Wide Web'' are printed in italics
%    (LetterHead\slash ITalics):
%    \begin{macrocode}
\DeclareFixedFont\@lh@it {OT1}{cmr} {m}{it}{9}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@lh@tt}
%    And finally, the web address is printed in teletype font
%    (LetterHead\slash TeleType):
%    \begin{macrocode}
\DeclareFixedFont\@lh@tt {OT1}{cmtt}{m}{n} {9}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@ptsize}
%    The following macro will be used later to decide which ``class
%    layout'' file to load.
%    \begin{macrocode}
\newcommand\@ptsize{}
%    \end{macrocode}
%    \end{macro}
%
%    A couple of useful commands that are missing from the \LaTeX\
%    kernel; we leave this explicative comment in the code too.
%    \begin{macrocode}
%% A couple of useful things that are missing from the LaTeX kernel:
%    \end{macrocode}
%    \begin{macro}{\@newrigidlength}
%    The first is similar to "\newlength", but allocates a
%    \textoken{dimen} rather than a \textoken{glue}.
%    \begin{macrocode}
\@ifdefinable\@newrigidlength{\def\@newrigidlength#1{%
  \@ifdefinable#1{\newdimen#1}%
}}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@msetlength}
%    The second can be used to say, for instance,
%\begin{verbatim}
%\@msetlength{\someRubberLength}{2}{\anotherRubberLength}
%\end{verbatim}
%    to set "\someRubberLength" to twice the value of
%    "\anotherRubberLength", without destroying the stretch and
%    shrink components (recall that, on the contrary,
%\begin{verbatim}
%\setlength{\someRubberLength}{2\anotherRubberLength}
%\end{verbatim}
%    only sets the \emph{natural length} of "\someRubberLength" to
%    twice the \emph{natural length} of "\anotherRubberLength", and
%    both the stretch and shrink components of "\someRubberLength" to
%    zero).
%    \begin{macrocode}
\@ifdefinable\@msetlength{\def\@msetlength#1#2#3{%
  #1#3\multiply#1#2\relax
}}
%    \end{macrocode}
%    \end{macro}
%
%    A number of counter, lengths, etc.\ are defined here, at the
%    beginning of the class, to detect as soon as possible if any name
%    conflicts with an already defined one.  The idea is that, since the
%    class is pretty long, it is better to avoid to discover near the end
%    that it cannot be used because of a name that is already defined;
%    but of course, with the speed of modern computers this is not at all
%    a problem, so it is very likely that in future releases all
%    declarations will be moved to the place they naturally belong to.
%    Presently, however, they are almost all listed here; for many of
%    them, some explanations are given here, and a more precise description
%    is delayed to the spot where the corresponding entity is used.
%
%    \counterindex{letter}
%    First, we introduce a counter to keep track of the number of letters
%    produced.  \textbf{Warning:} {\em this counter is used also for
%    internal bookkeeping, so don't change its value unless you know what
%    you are doing!}
%    \begin{macrocode}
\newcounter{letter}
%    \end{macrocode}
%
%    \counterindex{emptyaddrlabels}
%    The following five counters are used in connection with the
%    address labels optionally printed at the end of a compiled file.
%    The \texttt{emptyaddrlabels} counter holds the number of labels to
%    leave blank when starting to print (the first sheet of) the address
%    labels; this is useful if some labels on the same sheet have already
%    been peeled off.
%    \begin{macrocode}
\newcounter{emptyaddrlabels}
%    \end{macrocode}
%    \counterindex{addrlabelrows}
%    A single sheet of address labels contains many labels.  For example,
%    in the well-known (in the U.S.) Avery 5352 format each sheet contains
%    ten labels, organized in two columns and five rows.  Other formats
%    contain different number of rows and columns of labels.  To cope with
%    all these different formats, the number of rows and columns of labels
%    is kept in two counters: \texttt{addrlabelrows} holds the number of
%    rows
%    \begin{macrocode}
\newcounter{addrlabelrows}
%    \end{macrocode}
%    \counterindex{addrlabelcolumns}
%    and \texttt{addrlabelcolumns} holds the number of columns.
%    \begin{macrocode}
\newcounter{addrlabelcolumns}
%    \end{macrocode}
%    \counterindex{label}
%    The \texttt{addrlabelrows} and \texttt{addrlabelcolumns} counters
%    are usually set once for all by the code provided in a suitable
%    "\DeclareOption" declaration, as the result of the user's request of
%    one of the options devoted to specifying the address label format
%    (\opz{105x37labels}, etc.).  In some exceptional circumstances,
%    they can also be reset by the user, but even in this case, once set
%    they are not changed any more.  They are therefore not real
%    ``counters'', but rather (style) parameters.  The following two
%    counters, instead, are ``real'', \emph{running} counters: they hold a
%    running index which identifies the current label.  The \texttt{label}
%    counter holds the index of a label inside a given letter
%    \begin{macrocode}
\newcounter{label}[letter]
%    \end{macrocode}
%    \counterindex{totallabel}
%    while the \texttt{totallabel} counter holds the global index of a
%    label, that is, the index of the label in the whole document.
%    \begin{macrocode}
\newcounter{totallabel}
%    \end{macrocode}
%    It is possible that a single letter has more than one label
%    associated, because sometimes letters are sent to more than one
%    addressee.
%
%    \counterindex{equation}
%    \counterindex{footnote}
%    \counterindex{mpfootnote}
%    In our document class, the letter is the main unit in which the
%    document is organized.  Therefore, we want that equations, footnotes,
%    and footnotes inside minipages be numbered within letters.
%    \begin{macrocode}
\@addtoreset{equation}{letter}
\@addtoreset{footnote}{letter}
\@addtoreset{mpfootnote}{letter}
%    \end{macrocode}
%
%    \begin{macro}{\@lh@left@margin}
%    The second type of parameters we are going to define are rigid
%    lengths (\textoken{dimen}'s).  The first two govern the position of
%    the CDP seal with respect to the text margins (see also
%    fig.~\ref{fig:plo} on page~\pageref{fig:plo}).  More precisely,
%    "\@lh@left@margin" is the horizontal distance from the left margin of
%    text to the \emph{right} edge of the seal\ldots
%    \begin{macrocode}
\@newrigidlength\@lh@left@margin
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@lh@right@margin}
%    \ldots and "\@lh@right@margin" is the distance from the right edge of
%    the rule found in the rightmost part of the letterhead to the right
%    margin of text.
%    \begin{macrocode}
\@newrigidlength\@lh@right@margin
%    \end{macrocode}
%    \end{macro}
%    A couple of lenghts used as internal registers, to hold
%    values that must be passed to certain macros---we shall explain
%    their use when we come to it.
%    \begin{macrocode}
\@newrigidlength\@block@inden
\@newrigidlength\@block@width
%    \end{macrocode}
%    \begin{macro}{\longindentation}
%    The following are style parameters used to govern the typesetting
%    of the addresses and of the signature.  Some of them, in turn, are
%    defined in terms of another, crucial style parameter, the so-called
%    ``long indentation''; this is the length by which items that appear
%    in the right-hand half of the letter should be indented: roughly, it
%    is equal to half the value of "\textsize", but it can be fine-tuned
%    at ``"\begin{document}"-time'' for better alignment with some parts
%    of the letterhead.
%    \begin{macrocode}
\@newrigidlength\longindentation
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\senderindentation}
%    The amount by which the sender address should be indented:
%    \begin{macrocode}
\@newrigidlength\senderindentation
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\senderwidth}
%    The width of the column in which the sender address should be
%    typeset:
%    \begin{macrocode}
\@newrigidlength\senderwidth
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addresseeindentation}
%    The indentation\ldots
%    \begin{macrocode}
\@newrigidlength\addresseeindentation
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addresseewidth}
%    \ldots and column width for the addresse address:
%    \begin{macrocode}
\@newrigidlength\addresseewidth
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\signatureindentation}
%    Indentation\ldots
%    \begin{macrocode}
\@newrigidlength\signatureindentation
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\signaturewidth}
%    \ldots and width for the signature:
%    \begin{macrocode}
\@newrigidlength\signaturewidth
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\foldedheight}
%    There are macros that provide the ability to typeset letters that
%    are going to be folded before being put into the envelopes; these
%    macros assure that no text is typeset astride of the folding.  The
%    vertical distance from the upper edge of the \emph{paper} (not of
%    the text) to the folding is kept in "\foldedheight".  A value of
%    zero or less (\emph{e.g.}, $-"\maxdimen"$) prohibits folded letters:
%    this can be useful for certain paper sizes, and for safety it is set
%    here as the default.  For paper sizes that allow folded letters, the
%    actual value of "\foldedheight" is set by the code given in the
%    relevant "\DeclareOption".
%    \begin{macrocode}
\@newrigidlength\foldedheight
  \setlength\foldedheight{-\maxdimen}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@folding@ht}
%    In general, the default setting of "\foldedheight" provided by the
%    option handling mechanism should be sufficient.  However, the user
%    is allowed to change the value of "\foldedheight", preferably in the
%    preamble, but also in the document body, if a certain simple
%    precaution is taken.  This can be useful if one wants to alter the
%    default behavior, \emph{e.g.}, to have letters that are two-folded
%    rather then three-folded, or to allow folded letters also when using
%    a paper format, like A5, that normally does not allow it.  Useful,
%    sure, but it rises a problem: the algorithm that decides where to
%    split the text between the part that must go above the folding
%    and the part that must go below it requires that the value of
%    "\foldedheight" lie within a certain range.  Obviously we cannot ask
%    the user to know what range is acceptable, so we adopt the
%    following solution: we define an ``internal backup'' of
%    "\foldedheight", called "\@folding@ht" for historical reasons;
%    then, the user is asked to call the macro "\checkfoldedheight"
%    (see below) whenever (s)he changes the value of "\foldedheight";
%    this macro check the new value and, if it is OK, copies it in the
%    internal dimension "\@folding@ht" (actually, after some scaling
%    conversions), otherwise it sets an internal flag which disables
%    folded letters and issues a warning.  A slight variant of
%    "\checkfoldedheight", which differs only in the warning
%    produced, is called automatically at the "\begin{document}", so
%    the user is \emph{not} required to call "\checkfoldedheight" if
%    the changes to "\foldedheight" are made in the preamble.
%    \begin{macrocode}
\@newrigidlength\@folding@ht
%    \end{macrocode}
%    \end{macro}
%    The following three dimensions will be described when we come to
%    the point where they are used.
%    \begin{macrocode}
\@newrigidlength\@lh@folding@ht
\@newrigidlength\@above@folding@margin
\@newrigidlength\@above@folding@shrink
%    \end{macrocode}
%
%    Now we pass to rubber lengths, \emph{i.e.}, \TeX's
%    \textoken{skip}'s.  The first two are something like internal
%    registers used to pass certain style parameters back and forth
%    between macros.
%    \begin{macrocode}
\newlength\@block@space
\newlength\@block@andspace
%    \end{macrocode}
%    \begin{macro}{\@below@folding@skip}
%    This is an internal style parameter which specifies the amount of
%    vertical blank space that should be left, in folded letters, between
%    the folding and the text that follows it.  It can be redefined in
%    packages or other classes, or, in an emergency, by the final user.
%    It is a rubber length, but in this class it is assigned, as we shall
%    see later, a value without stretch or shrink components.  Note that
%    the actual space left between the folding and the text will usually
%    be greater than, or at most equal to, the value of
%    "\@below@folding@skip", because lines of text are usually aligned to
%    integer multiples of half the "\baselineskip".
%    \begin{macrocode}
\newlength\@below@folding@skip
%    \end{macrocode}
%    \end{macro}
%
%    The following ten (rubber) length are style parameters that affect
%    the amount of vertical space left before and after certain building
%    blocks, like addresses and signature.  The user can freely change
%    them with "\setlength".  Note that all these spaces are added with
%    "\addvspace", so only the largest one survives if two of them occur
%    in a row.
%    \begin{macro}{\aboveaddressvspace}
%    The amount of vertical space above the sender's or addressee's
%    address:
%    \begin{macrocode}
\newlength\aboveaddressvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\andaddressvspace}
%    The amount of vertical space between two consecutive addresses
%    separated with "\and" or "\andcc":
%    \begin{macrocode}
\newlength\andaddressvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\belowaddressvspace}
%    The amount of vertical space below the sender's or addressee's
%    address:
%    \begin{macrocode}
\newlength\belowaddressvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\abovesubjectvspace}
%    The amount of vertical space above the subject:
%    \begin{macrocode}
\newlength\abovesubjectvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\presubjectvspace}
%    The amount of vertical space between the text specified with
%    "\presubject" (if any) and the main body of the subject:
%    \begin{macrocode}
\newlength\presubjectvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\belowsubjectvspace}
%    The amount of vertical space below the subject:
%    \begin{macrocode}
\newlength\belowsubjectvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\abovesignaturevspace}
%    The amount of vertical space above the signature:
%    \begin{macrocode}
\newlength\abovesignaturevspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\abovesignatureshortvspace}
%    The amount of vertical space above the signature when the
%    \mbox{$*$-form} of the "\makesignature" command is used (this
%    happens, for instance, when the \mbox{$*$-form} of the
%    "\closing" command is used):
%    \begin{macrocode}
\newlength\abovesignatureshortvspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\belowsignaturevspace}
%    The amount of vertical space below the signature:
%    \begin{macrocode}
\newlength\belowsignaturevspace
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\belowpresentationvspace}
%    The amount of vertical space below the presentation as a whole
%    (the presentation contains the sender address, the addressee
%    address, and the optional subject); this also ends the block of
%    these style parameters:
%    \begin{macrocode}
\newlength\belowpresentationvspace
%    \end{macrocode}
%    \end{macro}
%
%    Allocation of some other rigid lengths (\textoken{dimen}'s)
%    follows: these concern the layout of the sheets of address
%    labels that the user wants to employ.  To save a few keystrokes,
%    we define the "\do" macro to do the allocation and to initialize
%    the value of the allocated length to zero.
%    \begin{macrocode}
\def\do#1{\@newrigidlength #1\setlength #1\z@}
%    \end{macrocode}
%    Then we allocate and initialize the individual lengths.
%    \begin{macro}{\addrlabelsleftmargin}
%    This is the amount of horizontal space between the left edge of the
%    sheet of address labels and the left edge of the leftmost column of
%    labels on the sheet.
%    \begin{macrocode}
\do\addrlabelsleftmargin
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabelstopmargin}
%    This is the amount of vertical space between the top edge of the
%    sheet of address labels and the top edge of the upper row of labels
%    on the sheet.
%    \begin{macrocode}
\do\addrlabelstopmargin
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabelshsep}
%    This is the amount of horizontal space between two columns of labels
%    on the sheet.
%    \begin{macrocode}
\do\addrlabelshsep
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabelsvsep}
%    This is the amount of vertical space between two rows of labels on
%    the sheet.
%    \begin{macrocode}
\do\addrlabelsvsep
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabelborder}
%    Normally, you don't want to write into the labels starting from
%    their physical border: you want to leave a little margin between the
%    text inside the labels and their edges.  The amount of margin is
%    kept in this style parameter (sorry, no provision is made to specify
%    different margins in the two directions).
%    \begin{macrocode}
\do\addrlabelborder
%    \end{macrocode}
%    \end{macro}
%
%    The following four lengths don't have reasonable default values,
%    so they are not initialized here.  The code for each individual
%    address label option will initialize the first two, and the
%    other two are computed later.
%    \begin{macro}{\addrlabelwidth}
%    The (horizontal) width of a single address label.
%    \begin{macrocode}
\@newrigidlength\addrlabelwidth
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabelheight}
%    The (vertical) height of a single address label.
%    \begin{macrocode}
\@newrigidlength\addrlabelheight
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabeltrimwidth}
%    This is a computed value, that the user should regard as
%    read-only: it is the width of a single address label
%    ("\addrlabelwidth"), diminished by twice the width of the
%    border ("\addrlabelborder").
%    \begin{macrocode}
\@newrigidlength\addrlabeltrimwidth
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\addrlabeltrimheight}
%    Analogous: "\addrlabelheight" diminished by twice
%    "\addrlabelborder".  This ends this block of code.
%    \begin{macrocode}
\@newrigidlength\addrlabeltrimheight
%    \end{macrocode}
%    \end{macro}
%
%    Now, we just declare a few names we are going to use.  The idea
%    is to trigger an error message if one of them is already defined.
%    \begin{macro}{\@cdp@reserved}
%    This is a reserved name that will be used as a
%    ``general-purpose'' container, much like "\reserved@a", etc.
%    \begin{macrocode}
\@ifdefinable\@cdp@reserved{}
%    \end{macrocode}
%    \end{macro}
%    Miscellaneous names, we shall describe them in a more
%    appropriate place.
%    \begin{macrocode}
\@ifdefinable\@empty@block{}
\@ifdefinable\@beginlabels{}
\@ifdefinable\@beginlabelgroup{}
\@ifdefinable\@mlabel{}
\@ifdefinable\@endlabelgroup{}
\@ifdefinable\@endlabels{}
\@ifdefinable\startaddrlabel{}
\@ifdefinable\startaddrlabel{}
\@ifdefinable\stopaddrlabel{}
\@ifdefinable\ifactuallabel{}
%    \end{macrocode}
%
%    \begin{macro}{\@lett@decl}
%    We define a token register used to save declarations to execute
%    when a letter begins (see below).
%    \begin{macrocode}
\@ifdefinable\@lett@decl{\newtoks\@lett@decl}
%    \end{macrocode}
%    \end{macro}
%
%    We finally arrive to something simple and clearly comprehensible.
%    We initialize the addresses, the signature, etc.  to empty strings.
%    To do that, we define the "\do" macro as follows:
%    \begin{macrocode}
\def\do#1{\@ifdefinable#1{\let#1\@empty}}
%    \end{macrocode}
%    \begin{macro}{\thesenderaddress}
%    The address of the sender, \emph{including her/his name}:
%    \begin{macrocode}
\do\thesenderaddress
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\thesendername}
%    The name of the sender (essentially, this is provided only for
%    compatibility with the \packlass{letter} standard \LaTeX\ class):
%    \begin{macrocode}
\do\thesendername
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\thesendersignature}
%    The signature of the sender:
%    \begin{macrocode}
\do\thesendersignature
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\thesenderlocation}
%    The room number, etc., of the sender:
%    \begin{macrocode}
\do\thesenderlocation
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\thesenderphone}
%    The phone number of the sender:
%    \begin{macrocode}
\do\thesenderphone
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\theaddresseeaddress}
%    The complete address of the addressee, \emph{including her/his
%    name, title, etc.}:
%    \begin{macrocode}
\do\theaddresseeaddress
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\theaddresseename}
%    The name of the addressee (used in page headings):
%    \begin{macrocode}
\do\theaddresseename
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\thesubject}
%    The subject of the letter:
%    \begin{macrocode}
\do\thesubject
%    \end{macrocode}
%    \end{macro}
%
%    There are also some internal macros that need to be initialized to
%    "\@empty".
%    \begin{macro}{\@subject@style}
%    The subject can be typeset either in medium weight or in
%    boldface.  This is achieved by inserting the "\@subject@style"
%    token in front of it: its default definition given here makes
%    this token a no-op (no font attributes are changed), but the code
%    that implements options like \opz{mediumsubject} or
%    \opz{boldsubject} can "\let" this token be equal to, say,
%    "\mdseries" or "\bfseries", to obtain the desired changes in the
%    font attributes.  If more than one attribute needed to be
%    changed (\emph{e.g.}, if somebody wanted to define a
%    \opz{bolditalicsubject} option), then "\def" should be used
%    instead of "\let"; for instance, one would write
%    \begin{verbatim}\def\@subject@style{\bfseries\itshape}\end{verbatim}
%    We don't make "\@subject@style" a token register because the
%    ``"\let" case'' is the most common.
%    \begin{macrocode}
\do\@subject@style
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@signature@style}
%    This is analogous to "\@subject@style", but for the signature.
%    The code for the \opz{uprightsignature} option "\let"s it equal to
%    "\upshape", and the code for the \opz{italicsignature} option to
%    "\itshape".
%    \begin{macrocode}
\do\@signature@style
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@begin@letter@hook}
%    This hook is executed when a letter starts, at the very end of the
%    process of setting up the ``letter-making'' environment, just
%    after the declarations stored in "\@lett@decl".  It may turn out to
%    be useful in packages and derived classes, and in fact it is used by
%    the \packlass{articoletteracdp} class.  It is not a token register
%    because it is envisioned that many independent segments of code
%    will want to store tokens in it, and this can easily be achieved
%    with the "\g@addto@macro" function, which requires that its
%    argument be a macro, not a token register.
%    \begin{macrocode}
\do\@begin@letter@hook
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@end@letter@hook}
%    This is analogous to "\@begin@letter@hook", but is executed at the
%    end of every ``letter-making'' environment, after its last page has
%    been finished off and ejected, but before writing to the
%    \filedir{.aux} file the information for the associated address labels.
%    Note that there is another hook, called "\stopletter" and described
%    later, which is executed \emph{before} ejecting the last page of
%    the letter.
%    \begin{macrocode}
\do\@end@letter@hook
%    \end{macrocode}
%    \end{macro}
%
%    The following macros are defined only inside a \texttt{subject}
%    environment.  We want that they cause an error if used outside of that
%    environment, but we also want to be sure that their names are not
%    already defined.  We achieve this by calling "\@ifdefinable", and
%    then "\let"ting the relevant token be "\@undefined".
%    \begin{macrocode}
\def\do#1{\@ifdefinable#1{\let#1\@undefined}}
\do\presubject
\do\registered
\do\registeredRR
%    \end{macrocode}
%
%    The following are integer (numeric) style parameters: they are
%    initialized later, and contain several penalty values used to assist
%    \TeX\ in choosing sightful and meaningful page breaks, and also for
%    other purposes that will be explained later.  For now we content
%    ourselves with the simple allocation with "\newcount".
%    \begin{macrocode}
\def\do#1{\@ifdefinable#1{\newcount#1}}
%    \end{macrocode}
%    The first five parameters are actually ``constants'' analogous to
%    "\@lowpenalty", "\@medpenalty", and "\@highpenalty"; they are
%    typically assigned very high penalty values, and their names all
%    begin with "\@fold@" because they are used in connection with the
%    algorithm that takes care of ``folded presentations'' (explained
%    later).
%    \begin{macrocode}
\do\@fold@basepenalty
\do\@fold@lowpenalty
\do\@fold@medpenalty
\do\@fold@highpenalty
\do\@fold@toppenalty
%    \end{macrocode}
%    The real style parameters begin here.  Their values are assigned
%    later, in various spots of the code; indeed, the values assigned
%    vary according to certain circumstances, for example, they are
%    changed from the default when a ``presentation'' is entered.
%    We'll discuss all this later on.
%    \begin{macro}{\@b@frompenalty}
%    This is the penalty inserted at the beginning of a
%    \texttt{sender} environment---the environment used to typeset the
%    sender address.
%    \begin{macrocode}
\do\@b@frompenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@i@frompenalty}
%    This is the penalty inserted before additional sender addresses
%    separated with "\and".
%    \begin{macrocode}
\do\@i@frompenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@e@frompenalty}
%    This is the penalty inserted at the end of a \texttt{sender}
%    environment.
%    \begin{macrocode}
\do\@e@frompenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@b@topenalty}
%    This is the penalty inserted at the beginning of an
%    \texttt{addressee} environment---the environment used to typeset the
%    addressee address.
%    \begin{macrocode}
\do\@b@topenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@i@topenalty}
%    This is the penalty inserted before additional addressee addresses
%    separated with "\and" or "\andcc".
%    \begin{macrocode}
\do\@i@topenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@e@topenalty}
%    This is the penalty inserted at the end of an \texttt{addressee}
%    environment.
%    \begin{macrocode}
\do\@e@topenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@b@subjpenalty}
%    This is the penalty inserted at the beginning of a \texttt{subject}
%    environment---the environment used to typeset the subject.
%    \begin{macrocode}
\do\@b@subjpenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@e@subjpenalty}
%    This is the penalty inserted at the end of a \texttt{subject}
%    environment.
%    \begin{macrocode}
\do\@e@subjpenalty
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@e@prespenalty}
%    This is the penalty inserted at the end of a presentation as a
%    whole.
%    \begin{macrocode}
\do\@e@prespenalty
%    \end{macrocode}
%    \end{macro}
%    The following are two internal registers, used to pass penalty
%    values back and forth between macros.
%    \begin{macrocode}
\do\@i@penalty
\do\@e@penalty
%    \end{macrocode}
%    \begin{macro}{\@cdp@gencount}
%    We also take the opportunity to define a general-purpose numeric
%    register, used for short-term storage when needed.  This ends the
%    block of count registers.
%    \begin{macrocode}
\do\@cdp@gencount
%    \end{macrocode}
%    \end{macro}
%
%    Four internal switches are defined next.
%    \begin{macrocode}
\def\do#1{\@ifdefinable#1{\newif#1}}
%    \end{macrocode}
%    \begin{macro}{\if@use@eepic@}
%    The user can request, through the \opz{usePS} option, that the
%    \packlass{eepic} package be used to trace the lines that make up the
%    CDP seal, for better graphical result; the user's indication,
%    however, will be honored only if the \packlass{eepic} package is
%    available on the system (of course!).  This switch is set to ``true''
%    if the \packlass{eepic} package is present and should be used.
%    \begin{macrocode}
\do\if@use@eepic@
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\if@do@fold@}
%    This switch is ``true'' when folded letters are allowed, and
%    ``false'' when they are shunned; the setting is made by the
%    "\checkfoldedheight" command, and also at
%    ``"\begin{document}"-time''.
%    \begin{macrocode}
\do\if@do@fold@
%    \end{macrocode}
%    \end{macro}
%    The other two switches cannot be explained here.  They are defined
%    differently, without using "\newif", so that they are always changed
%    "\global"ly.
%    \begin{macrocode}
\@ifdefinable\if@new@block@{
  \def\@new@block@true {\global\let\if@new@block@\iftrue }
  \def\@new@block@false{\global\let\if@new@block@\iffalse}
}
\@ifdefinable\if@empty@and@{
  \def\@empty@and@true {\global\let\if@empty@and@\iftrue }
  \def\@empty@and@false{\global\let\if@empty@and@\iffalse}
}
%    \end{macrocode}
%
%    We need the following box registers to hold precompiled parts of
%    the letterhead and of the footer.
%    \begin{macro}{\@logo@box@base}
%    This holds the main part of the CDP seal; more precisely, that
%    part that appears both in the \ldots\texttt{letterhead}\ldots\ and in
%    the \texttt{logo}\ldots\ page styles.
%    \begin{macrocode}
\newsavebox\@logo@box@base
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@logo@box@addS}
%    This holds the part of the CDP seal that should be added to the
%    part contained in "\@logo@box@base" in order to obtain the seal as
%    it appears in the \texttt{logo}\ldots\ page styles.
%    \begin{macrocode}
\newsavebox\@logo@box@addS
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@logo@box@addL}
%    This holds the part of the CDP seal that should be added to the
%    part contained in "\@logo@box@base" in order to obtain the seal as
%    it appears in the \ldots\texttt{letterhead}\ldots\ page styles.
%    \begin{macrocode}
\newsavebox\@logo@box@addL
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@oordinamento@box}
%    This holds the writing ``oordinamento dei Dottorandi di Padova''
%    that appears in the letterhead, with the initial~``C'' being
%    supplied by the seal.
%    \begin{macrocode}
\newsavebox\@oordinamento@box
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@name@and@WWW@box}
%    This holds the footer used in the \texttt{firstletterhead} and
%    \texttt{foldedletterhead} page styles, which contains the full name
%    of the \emph{Coordinamento} and its web address.  This ends the
%    block of box registers, too.
%    \begin{macrocode}
\newsavebox\@name@and@WWW@box
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\and}
%    It is possible to specify several addresses (both for the sender
%    and the addressee) as well as several signatures; the various parts
%    are separated by "\and" commands.  Strictly speaking, it is an error
%    to expand the token "\and" anywhere but inside the \texttt{sender},
%    \texttt{addressee}, and \texttt{signatureenv} environments (the
%    environments used to produce the sender address, the addressee
%    address, and the signature, repectively); hence, the correct thing
%    to do here would be to initialize "\and" to produce an error
%    message, and then redefine it in the various environments, as
%    required in each case.  But alas, the code for \packlass{\letteracdp} is
%    still incomplete, and this is one of the things I still have to
%    finish: I don't know exactly how to handle a misplaced "\and", so,
%    for now, I simply decide to ignore it.
%    \begin{macrocode}
\let\and\relax
%    \end{macrocode}
%    Of course, this definition will be changed inside the
%    abovementioned environments, where "\and" must have a special
%    meaning.
%    \end{macro}
%    \begin{macro}{\andcc}
%    Only inside an \texttt{addressee} environment, the token "\andcc"
%    can be used in place of "\and" to separate addresses of persons to
%    which the letter is sent as a carbon copy.  Its default definition,
%    however, is to act as "\and".
%    \begin{macrocode}
\@ifdefinable\andcc{\def\andcc{\and}}
%    \end{macrocode}
%    \end{macro}
%
%    We need to save the definitions, as initialized by the \LaTeX\
%    kernel, of a couple of macros.
%    \begin{macro}{\m@kel@bel}
%    Saved definition of "\makelabel".
%    \begin{macrocode}
\@ifdefinable\m@kel@bel{\let\m@kel@bel\makelabel}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@@vspace}
%    Saved definition of "\vspace".
%    \begin{macrocode}
\@ifdefinable\@@vspace{\let\@@vspace\vspace}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@indent@pref}
%    This is a multi-way switch used to implement the \opz{indent},
%    \opz{noindent}, etc.\ options, which govern the way in which
%    paragraphs of letters (except~P.S.) are indented.  The code associated
%    with the various options "\let"s this token equal to one of the
%    following keys, which will be interpreted later as specified:
%    \begin{description}
%      \item[F (for ``fixed indent'').]
%        Set "\parindent" to one tenth of "\textwidth", with a threshold
%        value of 2~pica (that is, "\parindent" will be at least 2~pica, even
%        if this is more than one tenth of "\textwidth").
%      \item[N (for ``no ident'').]
%        Set "\parindent" to 0~points.
%      \item[L (for ``leave indent'').]
%        The value of "\parindent" that was in effect outside of the
%        current \ldots\texttt{letter}\ldots\ environment is retained.
%      \item[O (sorry, I don't remember for what).]
%        Set "\parindent" to the width of the last line of the salutation
%        (\emph{i.e.}, the argument of "\opening" or "\makeopening"); if the
%        salutation is not given, this is the same as~``F''.
%    \end{description}
%    The default setting is the same as the one implied by the
%    \opz{indent} option.
%    \begin{macrocode}
\@ifdefinable\@indent@pref{\let\@indent@pref F}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\voidisOK}
%    Sometimes, in a letter, you want to omit the sender or the
%    addressee address, or the signature, and it is annoying to see a
%    warning about an ``empty something'' that you left empty
%    deliberately.  For this reason, inside the environments that produce
%    the addresses and the signature you are allowed to use the command
%    "\voidisOK" to disable such warnings.  The idea is that you say
%    something like
%\begin{verbatim}
%\address{\voidisOK}
%\end{verbatim}
%    when you want to declare that the address has intentionally be
%    left void; when the address is actually typeset (and this happens
%    inside an \texttt{addressee} environment), the command "\voidisOK"
%    will be expanded, causing the warning to be suppressed.  As for the
%    command "\and", the right thing to do would be to define this
%    command only inside the environments in which it can be used; but
%    there are complications arising from the fact that the text
%    specified inside an "\address" declaration can be expanded also at
%    other times, for instance when typesetting the address labels.  For
%    this reason, we take the shortcut of "\let"ting this command equal
%    to "\@empty", so that it will be ignored when it occurs out of place.
%    (We do not "\let" it equal to "\relax" because the latter could
%    confuse an "\ignorespaces"; on the contrary, "\@empty" disappears
%    upon "\write" and "\mark" operations, and this is quite OK.)
%    Where appropriate, "\voidisOK" will be redefined to achieve the
%    desired effect.
%    \begin{macrocode}
\@ifdefinable\voidisOK{\let\voidisOK\@empty}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\subjectnamegap}
%    If present, the subject of a letter is typeset with hanging
%    indentation, preceded by the text contained in the command
%    "\subjectname" and separated from it by a certain amount of
%    horizontal white space: the width of this white space is specified
%    by the "\subjectnamegap" macro.  This is a macro and not a
%    \textoken{dimen} register to allow the length to be specified in
%    terms of the font-dependent units like ``em''.  Of course, the
%    hanging indentation includes this horizontal space; note,
%    however, that if "\subjectname" is empty than the
%    "\subjectnamegap" space is not taken into account (older versions
%    of the class left this space even when "\subjectname" was empty,
%    but this bug has now been corrected).
%    \begin{macrocode}
\newcommand*\subjectnamegap{.5em}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\closingindentation}
%    As for the way of typesetting addresses, different countries have
%    different uses about how to indent the closing of the letter: for
%    instance, in Italy the closing is indented like any other, ordinary
%    paragraph, whilst in anglo-saxon letters it is indented by the same
%    amount by which the sender address is indented.  To cope with this,
%    the "\closingindentation" command is introduced, to hold the amount
%    of indentation for the closing: its default definition is
%    "\parindent", so that the closing is indented like an ordinary
%    paragraph, but a ``letter-making'' environment can redefine it,
%    if necessary.  It is a command and not a length, because the
%    value of "\parindent" can change, and actually does change, in
%    the sequel.
%    \begin{macrocode}
\newcommand*\closingindentation{\parindent}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\signaturealignment}
%    Different countries have different conventions also about how the
%    signature should be aligned; for instance, in the U.S.  the
%    signature is set ragged right, but with a hanging indentation equal
%    to the hanging indentation of the sender address, which in the U.S.
%    is printed on the right-hand half of the paper; in Italy, the
%    signature is more or less centered between the margins, and if it
%    contains more than one line, the lines are aligned at their
%    midpoint.  In order to accomodate the various conventions, the token
%    "\signaturealignment" is inserted at the beginning of the
%    \texttt{signatureenv} environment (the environment one uses to
%    typeset the signature); it is the responsability of the surrounding
%    \ldots\texttt{letter}\ldots\ environment to "\let" this token equal
%    to "\raggedright", "\centering", etc., as required by the particular
%    letter being produced.  This makes it easy, for instance, to define
%    an \texttt{asletter} (anglo-saxon letter) environment that prints
%    letters that obey the U.S.  conventions.  The default setting given
%    here has no special meaning: it just sets the signature ragged
%    right.
%    \begin{macrocode}
\newcommand*\signaturealignment{\raggedright}
%    \end{macrocode}
%    \end{macro}
%
%    \subsection{Declaration of options}
%
%    As a general rule, options pertaining to the same functional group
%    are declared in reverse order of desirability, the default option of
%    the group being declared last.  This assures that if more than
%    one option of the same group is erroneously asked for by the
%    user, the ``most desirable'' one (whatever this means) is
%    executed last, thereby remaining in effect.
%
%    We begin with the options that support the usual page formats.
%    For each such option, the associated code sets appropriate values
%    for the "\paperheight" and "\paperwidth" parameters.  The code also
%    sets the "\foldedheight" parameter, which, as explained above,
%    contains the height at which the sheets of paper should be folded in
%    order to put them into an envelope; this parameter is set to more or
%    less one third of "\paperheight".  For some paper formats, folding
%    is not adequate: for them, folded letters are disabled by setting
%    "\foldedheight" to $-"\maxdimen"$.
%    \begin{macrocode}
\DeclareOption{executivepaper}
   {\setlength\paperheight {10.5in}%
    \setlength\paperwidth  {7.25in}%
    \setlength\foldedheight{3.5in}}
\DeclareOption{legalpaper}
   {\setlength\paperheight {14in}%
    \setlength\paperwidth  {8.5in}%
    \setlength\foldedheight{4.7in}}
\DeclareOption{letterpaper}
   {\setlength\paperheight {11in}%
    \setlength\paperwidth  {8.5in}%
    \setlength\foldedheight{3.7in}}
\DeclareOption{b5paper}
   {\setlength\paperheight {250mm}%
    \setlength\paperwidth  {176mm}%
    \setlength\foldedheight{-\maxdimen}}
\DeclareOption{a5paper}
   {\setlength\paperheight {210mm}%
    \setlength\paperwidth  {148mm}%
    \setlength\foldedheight{-\maxdimen}}
\DeclareOption{a4paper}
   {\setlength\paperheight {297mm}%
    \setlength\paperwidth  {210mm}%
    \setlength\foldedheight{100mm}}
%    \end{macrocode}
%
%    The \opz{landscape} option is implemented as usual, by
%    exchanging the values of "\paperheight" and "\paperwidth" (note that
%    this option is executed after any one of the options that sets the
%    paper dimensions); but we also disable folded letters by setting
%    "\foldedheight" to $-"\maxdimen"$, because usually one does not want
%    to fold a letter set in landscape orientation!
%    \begin{macrocode}
\DeclareOption{landscape}
   {\setlength\@tempdima   {\paperheight}%
    \setlength\paperheight {\paperwidth}%
    \setlength\paperwidth  {\@tempdima}%
    \setlength\foldedheight{-\maxdimen}}
%    \end{macrocode}
%
%    These are the usual options for setting the main font size: they are
%    copied from the standard \LaTeX\ classes.  See, \emph{e.g.}, the
%    documentation of the standard \packlass{letter} class for
%    explanations.
%    \begin{macrocode}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
%    \end{macrocode}
%
%    The way of implementing the \opz{oneside}\slash\opz{twoside}
%    options is again copied from the \packlass{letter} standard \LaTeX\
%    class.
%    \begin{macrocode}
\if@compatibility
  \DeclareOption{twoside}{%
    \@latexerr{No `twoside' layout for letters}\@eha
  }
\else
  \DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
\fi
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
%    \end{macrocode}
%
%    The \opz{onecolumn}\slash\opz{twocolumn} options are not
%    declared in the \packlass{letter} standard \LaTeX\ class, but I prefer
%    to declare them.  The \opz{twocolumn} options causes an error,
%    because I have never seen letters typeset in two columns mode!
%    \begin{macrocode}
\DeclareOption{twocolumn}{%
  \@latexerr{No `twocolumn' layout for letters}\@eha
}
%    \end{macrocode}
%    The \opz{onecolumn} option is simply ignored, but it is
%    declared, so that it is removed from the list of unused options.
%    \begin{macrocode}
\DeclareOption{onecolumn}{}
%    \end{macrocode}
%
%    More options copied from the standard \LaTeX\ classes.
%    \begin{macrocode}
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
%    \end{macrocode}
%
%    Now we have four options for setting the way in which the subject
%    of a letter (if present) and the signature are printed.  As
%    explained above, the setting is done by "\let"ting a conventional
%    token equal to one of the usual NFSS commands used to set individual
%    font attributes; if more than one attribute needed to be changed,
%    "\def" would be used instead of "\let", but fortunately this is not
%    necessary.
%
%    Options for the subject: it can be set in boldface type\ldots
%    \begin{macrocode}
\DeclareOption{boldsubject}{\let\@subject@style\bfseries}
%    \end{macrocode}
%    \ldots or in medium weight.
%    \begin{macrocode}
\DeclareOption{mediumsubject}{\let\@subject@style\mdseries}
%    \end{macrocode}
%
%    Options for the signature: it can be set in italic shape\ldots
%    \begin{macrocode}
\DeclareOption{italicsignature}{\let\@signature@style\itshape}
%    \end{macrocode}
%    \ldots or in upright (normal) shape.
%    \begin{macrocode}
\DeclareOption{uprightsignature}{\let\@signature@style\upshape}
%    \end{macrocode}
%
%    Next, we have the options used to tell whether PostScript
%    commands, inserted by means of the \packlass{eepic} package, should be
%    used, or not, to draw the CDP seal.  Here we simply set the internal
%    switch according to the user's request; if we later find that the
%    \packlass{eepic} package is not available, we shall force the switch
%    to false.
%    \begin{macrocode}
\DeclareOption{usePS}{\@use@eepic@true}
\DeclareOption{noPS}{\@use@eepic@false}
%    \end{macrocode}
%    (These mean ``use PostScript'' and ``don't use PostScript'',
%    respectively.)
%
%    Cheer up!  We are almost over!  (Just with the options, of
%    course!)  We are now to the options for the paragraph
%    indentation within letters.  They are implemented by setting an
%    internal multi-value switch to a conventional key; the meaning of
%    the keys has already been explained above.
%    \begin{macrocode}
\DeclareOption{smartindent}{\let\@indent@pref O}
\DeclareOption{shortindent}{\let\@indent@pref L}
\DeclareOption{noindent}{\let\@indent@pref N}
\DeclareOption{indent}{\let\@indent@pref F}
%    \end{macrocode}
%
%    The last three options deal with the format of the address
%    labels.  As already said, the format is specified by
%    initializing a number of \textoken{dimen} parameters which
%    specify the ``geometry'' of the sheet of address labels.  Many
%    of these parameters have a default value of 0~points: when this
%    default is appropriate, the parameter is not re-initialized in
%    the code given below.
%
%    We support the Avery 5352 address labels only for compatibility
%    with the standard \packlass{letter} class.  I have never seen a sheet
%    of these labels, and the code for the \opz{Avery5352labels}
%    option simply assigns values to the parameters in a way that tries to
%    imitate the geometry described by the code found in the
%    \packlass{letter} class.
%    \begin{macrocode}
\DeclareOption{Avery5352labels}{%
%    \end{macrocode}
%    We have 5~rows of labels.
%    \begin{macrocode}
  \setcounter{addrlabelrows}{5}%
%    \end{macrocode}
%    Each row contains 2~labels, \emph{i.e.}, we have two columns of
%    labels.
%    \begin{macrocode}
  \setcounter{addrlabelcolumns}{\tw@}%
%    \end{macrocode}
%    The left edge of the leftmost column is 35~points to the left of
%    the \TeX\ origin, which in turn is 1~inch from the left edge of
%    the paper.
%    \begin{macrocode}
  \setlength\addrlabelsleftmargin{-35\p@}%
  \addtolength\addrlabelsleftmargin{1in}%
%    \end{macrocode}
%    The top edge of the topmost row is 50~points above
%    the \TeX\ origin, which in turn is 1~inch from the top edge of
%    the paper.
%    \begin{macrocode}
  \setlength\addrlabelstopmargin{-50\p@}%
  \addtolength\addrlabelstopmargin{1in}%
%    \end{macrocode}
%    The two columns are separated by 26~points.
%    \begin{macrocode}
  \setlength\addrlabelshsep{26\p@}%
%    \end{macrocode}
%    Labels are 262~points wide by 2~inches high.
%    \begin{macrocode}
  \setlength\addrlabelwidth{262\p@}%
  \setlength\addrlabelheight{2in}%
}
%    \end{macrocode}
%
%    The code for the labels I had the opportunity to actually see and
%    measure is more elegant, and fits more naturally into the scheme.
%    The following is the setting for the 70\,$\times$\,37 labels (the
%    dimensions are given in~mm).
%    \begin{macrocode}
\DeclareOption{70x37labels}{%
%    \end{macrocode}
%    8~rows of labels.
%    \begin{macrocode}
  \setcounter{addrlabelrows}{8}%
%    \end{macrocode}
%    3~columns, \emph{i.e.}, 3~labels in each row.
%    \begin{macrocode}
  \setcounter{addrlabelcolumns}{\thr@@}%
%    \end{macrocode}
%    Labels are 70\,mm wide by 37\,mm high.
%    \begin{macrocode}
  \setlength\addrlabelwidth{70mm}%
  \setlength\addrlabelheight{37mm}%
%    \end{macrocode}
%    We leave 6\,mm of margin between the border of the labels and the
%    actual printing.
%    \begin{macrocode}
  \setlength\addrlabelborder{6mm}%
}
%    \end{macrocode}
%    The setting for the 105\,$\times$\,37 labels (the default) is
%    similar.
%    \begin{macrocode}
\DeclareOption{105x37labels}{%
  \setcounter{addrlabelrows}{8}%
  \setcounter{addrlabelcolumns}{\tw@}%
  \setlength\addrlabelwidth{105mm}%
  \setlength\addrlabelheight{37mm}%
  \setlength\addrlabelborder{6mm}%
}
%    \end{macrocode}
%
%    \subsection{Option processing}
%
%    Nothing special to note here.
%    \begin{macrocode}
\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,%
mediumsubject,uprightsignature,noPS,indent,105x37labels}
\ProcessOptions\relax
%    \end{macrocode}
%
%    \subsection{Package loading}
%
%    In this version of the C.D.P. Bundle, all the original code is
%    put in the file \filedir{\letteracdp.cls}, so in the normal operating
%    mode no packages need to be loaded.  This will change in future
%    releases: the code will be split among several packages, to allow
%    the final user to request only some features and not the others;
%    when this happens, this section will become much longer, in order to
%    load all those packages.  However, even now it could be necessary to
%    require the \packlass{eepic} package, if the user specified the
%    \opz{usePS} option.  At this stage, the presence of this option can
%    be tested for by means of the "\if@use@eepic@" switch.
%    \begin{macrocode}
\if@use@eepic@
%    \end{macrocode}
%    We check whether the \packlass{eepic} package exists on the
%    system: if it does, we load it, otherwise we force the
%    "\if@use@eepic@" flag to false and issue a warning.
%    \begin{macrocode}
  \IfFileExists{eepic.sty}{%
    \RequirePackage{eepic}%
  }{%
    \@use@eepic@false
    \ClassWarningNoLine{\@letteracdp}{%
      Can't find the eepic package;\MessageBreak
      option usePS ignored (converted to noPS)%
    }%
  }%
\fi
%    \end{macrocode}
%
%    \subsection{Main code}
%
%    ^^A ( paren match
%    OK, boys, until now we have just set up a few things; now the real
%    fun begins.~\mbox{:-)}  Oh, well, actually it will begin in a few lines:
%    for now we have to do a little more bit of tedious work.~\mbox{:-(}
%    ^^A ) paren match
%
%    \subsubsection{More initializations}
%
%    The following initializations have not been put in the
%    \emph{Initial code} section because it is traditional to put
%    them here; moreover, some of them actually require that the code
%    for the options has already been executed, so they must be put
%    here!
%
%    \begin{macro}{\date}
%    I was ready to swear that I had copied the following
%    redefinition of the "\date" command from the standard
%    \packlass{letter} class\ldots{}  Anyway, we redefine "\date" in
%    order to make the changes to the date local instead of global:
%    this is useful if one of the letters has a date which is
%    different from the others.  An explicative comments is left in
%    the code too (because "\date" is a command defined in the
%    \LaTeX\ kernel).
%    \begin{macrocode}
%% Command \date redefined to make changes to date local.
\def\date#1{\def\@date{#1}}
%    \end{macrocode}
%    \end{macro}
%
%    Usual loading of the suitable \filedir{.clo} file; see the
%    documentation of, \emph{e.g.}, the standard \packlass{letter}
%    class for explanations about the following three lines of code.
%    \begin{macrocode}
\input{size1\@ptsize.clo}
\setlength\lineskip{\p@}
\setlength\normallineskip{\p@}
%    \end{macrocode}
%    \begin{macro}{\baselinestretch}
%    This command can be redefined by the final user to obtain
%    double-spaced, triple-spaced, etc.\ output.  See the
%    \textsl{\LaTeX book} \cite[Subsection~C.3.2]{LaTeXbook}.
%    \begin{macrocode}
\renewcommand*\baselinestretch{}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\thelabel}
%    The printed form of the \texttt{label} counter is changed to include
%    also the number of the letter it refers to.  Note that we do not
%    change "\p@label" (the prefix used only when printing
%    \emph{references} to the counter), but actually the command used to
%    print the counter itself.
%    \begin{macrocode}
\renewcommand*\thelabel{\theletter\@alph\c@label}
%    \end{macrocode}
%    \end{macro}
%
%    The following are the usual constants used to represent typical
%    penalty values; again, see the documentation of the standard
%    classes.
%    \begin{macrocode}
\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301
%    \end{macrocode}
%    We need five more constants of the same type, but with much
%    higher penalty values.  They are used in the algorithm that takes
%    care of folded letters.
%    \begin{macrocode}
\@fold@basepenalty 9000
\@fold@lowpenalty  9101
\@fold@medpenalty  9202
\@fold@highpenalty 9303
\@fold@toppenalty  9500
%    \end{macrocode}
%
%    We now initialize the style parameters that contain the penalties
%    inserted around the address blocks and the subject.  This values
%    will never be used in practice, because usually the address blocks
%    and the subject are wrapped up in a \ldots\texttt{presentation}
%    environment, and these environments completely redefine the values
%    of these style parameters.  The values given here will be used only
%    when a \texttt{sender}, \texttt{addressee}, or \texttt{subject}
%    environment is used without being wrapped in a presentation.  These
%    values allow a page break without penalty before each of the blocks
%    and at the end of the subject, mildly discourage a break after the
%    address blocks, and discourage rather strongly a break at an "\and"
%    or "\andcc" token.
%    \begin{macrocode}
\@b@frompenalty\z@
\@i@frompenalty\@highpenalty
\@e@frompenalty\@lowpenalty
\@b@topenalty\z@
\@i@topenalty\@highpenalty
\@e@topenalty\@lowpenalty
\@b@subjpenalty\z@
\@e@subjpenalty\z@
%    \end{macrocode}
%    Unlike the preceding ones, the following style parameter is not
%    redefined elsewhere.  It is the penalty inserted after
%    presentations, and since a presentation typically ends with the
%    subject, the following initialization seems quite natural.
%    \begin{macrocode}
\@e@prespenalty\@e@subjpenalty
%    \end{macrocode}
%
%    \subsubsection{Page layout}
%
%    The first thing one could begin to find interesting is the code
%    for setting up the page layout.  To help the reader to understand
%    what is going on, fig.~\ref{fig:plo} summarizes the basic page
%    layout parameters we are going to speak about.\footnote{If you are
%    reading directly the comments in the \filedir{.dtx} file, instead of
%    typesetting it with \LaTeX, you might find it difficult to follow
%    the forthcoming discussion.}  This figure shows the parameters used
%    in the case of an A5~sheet of paper: this allows to fit the entire
%    figure on the page without having to scale it.
%
%    \begin{figure}[tbp]
%      \centering
%      \setlength{\unitlength}{1mm}
%      \begin{picture}(108,200)(-10,0)
%        \thinlines
%        \put(-20,0)  {\line(1,0){148}}
%        \put(-20,210){\line(1,0){148}}
%        \put(-20,0)  {\line(0,1){210}}
%        \put(128,0)  {\line(0,1){210}}
%        \put(10,185){\makebox(88,10)[bl]{\makebox[88mm][s]{^^A
%          \kern -1cm
%          \setlength\unitlength{.625mm}^^A
%          \begin{picture}(32,16)(-3,7.87)
%            \thinlines
%            \put(8,16){\oval(10,10)[l]}
%            \put(8,11){\line(0,1){10}}
%            \put(9,11){\framebox(3,20){}}
%            \put(18,16){\oval(10,10)[r]}
%            \put(18,11){\line(0,1){10}}
%            \put(14,1){\framebox(3,20){}}
%            \thicklines
%            \put(8,16){\oval(16,16)[l]}
%            \put(8,8){\line(1,0){5}}
%            \put(13,24){\line(1,0){10}}
%            \put(8,16){\oval(14,14)[l]}
%            \put(8,9){\line(1,0){5}}
%            \put(13,23){\line(1,0){10}}
%            \put(18,8){\line(1,0){10}}
%            \put(18,9){\line(1,0){10}}
%          \end{picture}^^A
%          \lhnss oordinamento dei {\lhbss D}\kern-.033333em ottorandi di
%          {\lhbss P}\kern-.1em adova\enspace\hrulefill\kern-1cm
%        }}}
%        \put(10,40){\makebox(88,130)[tl]{\begin{minipage}[t]{88mm}
%          \vrule height 10pt depth 0pt width 0pt \relax
%          Text text text text text text text text text text text text
%          text text text text text text text text text text text text.
%        \end{minipage}}}
%        \put(10,25){\makebox(88,3.514598035146)[tl]{\parbox[t]{88mm}{^^A
%          \setlength{\parfillskip}{0pt}
%          \noindent\rule{0pt}{10pt}\kern-1cm\hrulefill\kern-1cm\par
%          \setlength{\baselineskip}{11pt}
%          \hbox to \hsize{\hss\lhrm
%            Coordinamento dei Dottorandi e dei Dottori di Ricerca
%            dell'Universit\`{a} di Padova
%          \hss}
%          \hbox to \hsize{\hss
%            \lhit World Wide Web:\/
%            \lhtt http://www.dei.unipd.it/\string~assdott/^^A
%          \hss}
%        }}}
%        \linethickness{0.1pt}
%        \put(-27,210){\line(1,0){17}}
%        \put(-27,195){\line(1,0){125}}
%        \put(-27,185){\line(1,0){142}}
%        \put(-27,170){\line(1,0){142}}
%        \put(-27,40) {\line(1,0){142}}
%        \put(-27,25) {\line(1,0){142}}
%        \put(10,25) {\line(0,1){192}}
%        \put(98,25) {\line(0,1){192}}
%        \put(20,185){\line(0,1){37}}
%        \put(5,215) {\vector(1,0){5}}
%        \put(10,215){\line(1,0){10}}
%        \put(55,215){\vector(-1,0){35}}
%        \put(55,215){\makebox(0,35)[br]{\strut\ttfamily\bslash @lh@left@margin}}
%        \put(63,215) {\vector(1,0){35}}
%        \put(63,215){\makebox(0,35)[bl]{\strut\ttfamily\bslash @lh@right@margin}}
%        \put(98,215){\line(1,0){10}}
%        \put(113,215){\vector(-1,0){5}}
%        \put(108,25){\line(0,1){197}}
%        \put(0,25)  {\line(0,1){12}}
%        \put(-5,30){\vector(1,0){5}}
%        \put(0,30) {\line(1,0){10}}
%        \put(45,30){\vector(-1,0){35}}
%        \put(45,30){\makebox(0,35)[br]{\strut\ttfamily\bslash @lh@right@margin}}
%        \put(-15,35){\vector(1,0) {15}}
%        \put(-5,35) {\vector(-1,0){15}}
%        \put(-10,35){\makebox(0,0)[b]{\strut $2\,\mbox{cm}$}}
%        \put(-20,200){\line(0,1){22}}
%        \put(-10,220){\vector(1,0) {30}}
%        \put(10,220) {\vector(-1,0){30}}
%        \put(0,220){\makebox(0,0)[b]{\strut $4\,\mbox{cm}$}}
%        \put(128,200){\line(0,1){22}}
%        \put(113,220){\vector(1,0) {15}}
%        \put(123,220){\vector(-1,0){15}}
%        \put(118,220){\makebox(0,0)[b]{\strut $2\,\mbox{cm}$}}
%        \put(113,195){\vector(0,1) {15}}
%        \put(113,200){\vector(0,-1){15}}
%        \put(113,197.5){\makebox(0,0)[l]{ $2.5\,\mbox{cm}$}}
%        \put(113,175){\vector(0,1) {10}}
%        \put(113,180){\vector(0,-1){10}}
%        \put(113,177.5){\makebox(0,0)[l]{ $1.5\,\mbox{cm}$}}
%        \put(113,30){\vector(0,1) {10}}
%        \put(113,35){\vector(0,-1){10}}
%        \put(113,32.5){\makebox(0,0)[l]{${}\ge1.5\,\mbox{cm}$}}
%        \put(113,10){\vector(0,1) {15}}
%        \put(113,15){\vector(0,-1){15}}
%        \put(113,12.5){\makebox(0,0)[l]{ $2.5\,\mbox{cm}$}}
%        \put(-25,200){\vector(0,1) {10}}
%        \put(-25,205){\vector(0,-1){10}}
%        \put(-25,202.5){\makebox(0,0)[r]{$\mbox{\ttfamily\bslash topmargin}+1\,\mbox{in}$ }}
%        \put(-25,189){\vector(0,1) {6}}
%        \put(-25,191){\vector(0,-1){6}}
%        \put(-25,190){\makebox(0,0)[r]{{\ttfamily\bslash headheight} }}
%        \put(-25,175){\vector(0,1) {10}}
%        \put(-25,180){\vector(0,-1){10}}
%        \put(-25,177.5){\makebox(0,0)[r]{{\ttfamily\bslash headsep} }}
%        \put(-25,100){\vector(0,1) {70}}
%        \put(-25,110){\vector(0,-1){70}}
%        \put(-25,105){\makebox(0,0)[r]{{\ttfamily\bslash textheight} }}
%        \put(-25,30){\vector(0,1) {10}}
%        \put(-25,35){\vector(0,-1){10}}
%        \put(-25,32.5){\makebox(0,0)[r]{{\ttfamily\bslash footskip} }}
%        \put(-10,100){\vector(1,0) {20}}
%        \put(0,100)  {\vector(-1,0){20}}
%        \put(-5,100) {\makebox(0,0)[b]{\parbox[b]{4cm}{\centering
%          \strut\texttt{\bslash oddsidemargin}\\
%          or\\
%          \texttt{\bslash evensidemargin}\\
%          ${}+1\,\mbox{in}$\strut
%        }}}
%        \put(48,100){\vector(1,0) {50}}
%        \put(60,100){\vector(-1,0){50}}
%        \put(54,100){\makebox(0,0)[b]{\strut\ttfamily\bslash textwidth}}
%      \end{picture}
%      \caption{Basic page layout parameters}
%      \label{fig:plo}
%    \end{figure}
%
%    Before discussing the page layout parameters, let us make a brief
%    digression to illustrate what we are trying to achieve and what
%    difficulties we need to solve.  We would like that the seal and
%    certain other details of the letterhead and the footer appeared in
%    fixed positions with respect to the physical edges of the sheet:
%    fig.~\ref{fig:plo} shows these fixed distances, explicitly given in
%    centimeters, among the others, indicated by their symbolic name.
%    This rises a little problem: we want to typeset the letterhead and
%    the footer as standard \LaTeX\ headers and footers, but the
%    subroutine for the header or the footer installed with a
%    "\ps@"\ldots\ declaration is called inside a box of width
%    "\textwidth" and aligned with the main body of text.  In other
%    words, when typesetting the header, or the footer, one has no direct
%    means to refer to the page boundaries: the only available reference
%    points are the margins of the main body of text.  For this reason,
%    it is necessary to precompute the offset from the text margins of
%    the various points that we want to appear in fixed positions.  For
%    instance, looking at fig.~\ref{fig:plo}: if we know that the left
%    margin of the text runs exactly at \( 3\,\mbox{cm} \) from the left
%    border of the sheet, and we want the left edge of the writing
%    ``oordinamento dei Dottorandi di Padova'' to lie at exactly \(
%    4\,\mbox{cm} \) from this border, we need to set the
%    "\@lh@left@margin" parameter to \( 1\,\mbox{cm} \), to indicate that
%    the left edge of the writing should lie \( 1\,\mbox{cm} \) to the
%    right of the left text margin.
%
%    But this is only half of the story; the other half is best
%    illustrated with an example.  Suppose you are typesetting on A4~paper,
%    using 10 points fonts (these are precisely the settings chosen by
%    default).  If you calculate the text margins and the text width
%    following the recommendations given by the authors of \LaTeX\ for
%    this particular combination of paper and font sizes, you will
%    discover that the left margin of the main text runs at, say, \(
%    4.2\,\mbox{cm} \) from the left border of the sheet.  (I~don't want
%    to compute the exact value just now, since this is only an example,
%    but I know that the actual value is very close to this, so the
%    example is meaningful.)  If, according to what we have just said, you
%    set "\@lh@left@margin" to \( -0.2\,\mbox{cm} \), you will end with
%    the writing ``oordinamento\ldots'' that fails to be aligned with the
%    main text by just \( 2\,\mbox{mm} \)---which is awful to see.
%    Clearly, in a case like this it is better to foresee that
%    "\@lh@left@margin" is going to receive a small value, and to adjust
%    the left margin of the main body of text to \( 4\,\mbox{cm} \), so
%    that "\@lh@left@margin" can be set to \( 0\,\mbox{pt} \).  This is
%    just what the class does, and the final visual effect is, let
%    me say, pretty good indeed\ldots
%
%    To sum up, the strategy for setting the page layout parameters
%    should be as follows:
%
%    \begin{enumerate}
%
%    \item\label{plostep1}
%    Compute the main text width and margins according to usual \LaTeX\
%    recommendations.
%
%    \item\label{plostep2}
%    Figure out whether the margins computed in step~\ref{plostep1} fall
%    too close to some of the points of the letterhead that we want to
%    stay in fixed position, and, if it is so, adjust them so that they
%    are exactly aligned with those positions.
%
%    \item\label{plostep3}
%    Allow the user to change the values computed in step~\ref{plostep2},
%    in case (s)he needs to set the margins to some special value.
%
%    \item\label{plostep4}
%     Compute the offset of those fixed points from one of the text
%    margin (\emph{e.g.}, "\@lh@left@margin" in the example above), using
%    whatever values for the margins are in effect after
%    step~\ref{plostep3}, in such a way to be able to correctly position
%    the abovementioned points using only the text margins as a reference.
%
%    \end{enumerate}
%
%    Of course, step~\ref{plostep3} occurs in the preamble; this means
%    that step~\ref{plostep4} must be performed during the
%    "\AtBeginDocument" hook.
%
%    As already said, the fixed distances of the layout design are all
%    shown in fig.~\ref{fig:plo}; from this distances, from the relations
%    shown in the figure, and from the additional information that the
%    main body of text should be horizontally centered between the edges
%    of the sheet, it is possible to deduce the values of almost all the
%    basic page layout parameters once the value for "\textwidth" has
%    been (cleverly) chosen.  Some of these parameters are readily
%    readable: for instance, fig.~\ref{fig:plo} clearly states that
%    "\headsep" should be equal to \( 1.5\,\mbox{cm} \); other parameters
%    may require some computations, and may even not be completely
%    determined: for instance, from the figure you see that \(
%    "\topmargin"+"\headheight" = 2.5\,\mbox{cm}-1\,\mbox{in} \), but you
%    cannot tell what the single values of "\topmargin" and "\headheight"
%    are.  In the last case, the inherent uncertainty does no harm,
%    because the "\headheight" parameter is not used to position any
%    graphical element of the letterhead: it suffices to assure that it
%    allows enough room for the other, ordinary running heads; in
%    practice, that there is room for a line of text in the largest
%    supported font size (\emph{i.e.}, 12~points).  Setting "\headheight"
%    to \( 1\,\mbox{cm} \) definitely satisfies this requisite, and has the
%    nice additional aesthetical advantage that the lines delimiting the
%    head run exactly along the outer strokes of the ``C'' in the seal.
%    (Note that decreasing or increasing the value of "\headheight" does
%    not alter the dimensions of the seal: the dimensions of the seal are
%    fixed, and the seal appears as a box of null width and height.)
%
%    We shall now discuss the parameters shown in fig.~\ref{fig:plo}
%    one by one.  Of course, many of them are standard \LaTeX\ page
%    layout parameters, and do not require particular explanations.
%
%    The first decision I took was to locate the lower right corner of
%    the seal in a fixed position \( 4\,\mbox{cm} \) across and \(
%    2.5\,\mbox{cm} \) down from the upper left corner of the page.  The
%    value of \( 4\,\mbox{cm} \) was chosen because it was twice the
%    design width of the seal; $2.5$~is the golden section of~$4$.  I then
%    placed the upper margin of the main body of text \( 4\,\mbox{cm}
%    \) from the upper edge of the paper.  Also, the rule found to the
%    right of the letterhead extends up to a distance of \( 2\,\mbox{cm}
%    \) from the right edge of the paper; the rule of the footer is
%    aligned with that of the letterhead on the right, and on the left it
%    extends to a symmetric distance.  From these fixed setting, one
%    deduces the other parameters: let us see how.
%
%    \begin{description}
%
%    \renewcommand*\makelabel[1]{\hspace\labelsep\normalfont
%      \texttt{\bslash #1}.}
%
%    \item[textwidth]
%    This parameter is first of all initialized in the standard
%    \filedir{.clo} files: this assures that the standard \LaTeX\ initial
%    value is used (cf.~step~\ref{plostep1} above).  Nevertheless, the
%    value can be subsequently adjusted as explained in
%    step~\ref{plostep2}, to achieve a better alignment with some points
%    of the letterhead.
%
%    \item[oddsidemargin]
%    This is set to \( \frac{1}{2}("\paperwidth"-"\textwidth") -
%    1\,\mbox{in} \), to assure that the main body of text is
%    horizontally centered on the page.  Note that \LaTeX\ measures
%    "\oddsidemargin" from the \TeX\ origin, and not from the left edge
%    of the paper.
%
%    \item[evensidemargin]
%    This is set equal to "\oddsidemargin".
%
%    \item[@lh@left@margin]
%    This is set to \( 4\,\mbox{cm}-"\oddsidemargin"-1\,\mbox{in} \);
%    this setting is done at ``"\begin{document}"-time''
%    (cf.~step~\ref{plostep4} above), to allow the user to change
%    "\oddsidemargin" in the preamble (cf.~step~\ref{plostep3} above).
%    It can be useful to remark that the amount shown in
%    fig.~\ref{fig:plo} is positive when measured according to the
%    sign convention used internally by the code.
%
%    \item[@lh@right@margin]
%    This is set to \( 2\,\mbox{cm}-"\oddsidemargin"-1\,\mbox{in} \);
%    this setting is done at ``"\begin{document}"-time''
%    (cf.~step~\ref{plostep4} above), to allow the user to change
%    "\oddsidemargin" in the preamble (cf.~step~\ref{plostep3} above).
%    It can be useful to remark that the amounts shown in
%    fig.~\ref{fig:plo} are negative when measured according to the sign
%    convention used internally by the code.
%
%    \item[topmargin]
%    This is set to \( 2.5\,\mbox{cm}-1\,\mbox{in} \) (because \LaTeX\
%    measures "\topmargin" from the \TeX\ origin, and not from the
%    upper edge of the paper).
%
%    \item[headheight]
%    This is set to \( 1\,\mbox{cm} \).
%
%    \item[headsep]
%    This is set to \( 1.5\,\mbox{cm} \).
%
%    \item[textheight]
%    To avoid underfull "\vbox"es when typesetting pages that contain
%    no glue besides the "\baselineskip" glue (that usually has no
%    ability to stretch or shrink), it is highly recommendable to
%    set "\textheight" to an integer number of text lines, that is,
%    to set it to \( "\topskip" + n\cdot"\baselineskip" \), where
%    $n$~is a natural number.  We do this, choosing $n$ to be the
%    largest natural number such that
%    \begin{equation}
%      "\topskip" + n\cdot"\baselineskip" \le "\paperheight"-8\,\mbox{cm}
%      \mbox{.}
%      \label{eq:textheight}
%    \end{equation}
%
%    \item[footskip]
%    This is set to \( "\paperheight" - "\textheight" -
%    6.5\,\mbox{cm} \): this assures that the baseline of the footer
%    (along which the rule is traced) runs at \( 2.5\,\mbox{cm} \)
%    from the bottom edge of the paper.
%
%    \end{description}
%
%    In the case of "\footskip", note that the baseline of the footer
%    actually means\ldots\ the baseline of the footer!  I mean, normal
%    footers (like, for instance, page numbers) are typeset with the
%    baseline at exactly \( 2.5\,\mbox{cm} \) from the bottom edge of the
%    paper; but the footer containing the address of the
%    \emph{Coordinamento} is treated differently, in that it is the
%    horizontal rule which is aligned with the baseline.
%
%    OK, after all this preliminary blather, we are now ready to return
%    to the code.  Since we have already given many explanations, the
%    following comments will be rather terse.
%
%    We begin to perform some of the initialization described above.
%    \begin{macrocode}
\setlength\headheight{1cm}
\setlength\topmargin{1.5cm}
\addtolength\topmargin{-1in}
\setlength\headsep{1.5cm}
%    \end{macrocode}
%    The following settings pertaining to marginal notes and footnotes
%    are simply copied from the standard \packlass{letter} class: we have
%    no reason to change them.
%    \begin{macrocode}
\setlength\marginparsep {11\p@}
\setlength\marginparpush{5\p@}
\setlength\footnotesep{12\p@}
\setlength{\skip\footins}{10\p@ plus 2\p@ minus 4\p@}
%    \end{macrocode}
%
%    Everything we have been saying above was for \LaTeXe\footnote{This
%    term should no longer be used, however: what was once known as
%    \LaTeXe\ has now become \LaTeX\ \emph{tout-court}.}.  No attempt is
%    made to support any users who happened to be still using the
%    Palaeolithic \LaTeX~2.09: we simply honor the standard convention
%    according to which certain basic page layout parameters must be set to
%    fixed values in compatibility mode.  Note that the alignment of
%    those certain special points of the letterhead to fixed positions
%    will still work even in this case, but the placement of the main
%    body of text will be awful, in the best hypothesis.  Note also that,
%    in general, "\textheight" will not at all be of the form \(
%    "\topskip" + n\cdot "\baselineskip" \).
%    \begin{macrocode}
\if@compatibility
  \setlength\oddsidemargin{53pt}
  \setlength\evensidemargin{53pt}
  \setlength\marginparwidth{90pt}
  \setlength\textwidth{365\p@}
  \setlength\textheight{505\p@}
  \setlength\footskip{25\p@}
\else
%    \end{macrocode}
%
%    Very well, now that the have get rid of that bothersome
%    parenthesis of compatibility mode, we can go on with our
%    initialization code.  We now take care of "\textwidth" and
%    "\oddsidemargin".  These parameters have already been initialized in
%    a \filedir{.clo} file---and this was step~\ref{plostep1}, see above.
%    Now we take care of step~\ref{plostep2}.  Put
%    \[
%      "\@tempdima" = \textit{total\_left\_margin} :=
%        {"\paperwidth"-"\textwidth"\over 2}
%      \mbox{.}
%    \]
%    \begin{macrocode}
  \setlength\@tempdima{\paperwidth}
  \addtolength\@tempdima{-\textwidth}
  \setlength\@tempdima{.5\@tempdima}
%    \end{macrocode}
%    If \( \textit{total\_left\_margin} < 3.25\,\mbox{cm} \), that is,
%    if the left margin measured from the paper edge is too narrow, then
%    we set "\oddsidemargin" to \( 3\,\mbox{cm} \), thereby aligning the
%    left margin with the centre of the seal.
%    \begin{macrocode}
  \ifdim\@tempdima < 3.25cm % align to centre of logo
    \setlength\oddsidemargin{3cm}
%    \end{macrocode}
%    If \( 3.25\,\mbox{cm} \le \textit{total\_left\_margin} <
%    4.5\,\mbox{cm} \), that is, if the left margin measured from the paper
%    edge is sufficiently close to the predetermined position of the right
%    edge of the seal, then we align the former to the latter, by
%    setting "\oddsidemargin" to~\( 4\,\mbox{cm} \).
%    \begin{macrocode}
  \else\ifdim\@tempdima < 4.5cm % align to right edge of logo
    \setlength\oddsidemargin{4cm}
%    \end{macrocode}
%    In all other cases, we set "\oddsidemargin" to the computed
%    $\textit{total\_left\_margin}$.
%    \begin{macrocode}
  \else % keep the computed margin
    \setlength\oddsidemargin{\@tempdima}
  \fi\fi
%    \end{macrocode}
%    Whatever value we have set "\oddsidemargin" to, we reset
%    "\textwidth" according to it.
%    \begin{macrocode}
  \setlength\textwidth{\paperwidth}
  \addtolength\textwidth{-2\oddsidemargin}
%    \end{macrocode}
%    Of course, we must not forget to subtract \( 1\,\mbox{in} \) from
%    "\oddsidemargin": we shall do this later.
%
%    The following segment of code sets the width of marginal
%    paragraphs (marginal notes).  We first try to use up all the
%    margin, leaving only a gap of "\marginparsep" (already
%    initialized above) on the text side, and of \( 7\,\mbox{mm} \)
%    from the paper edge.  The latter should suffice with modern laser
%    printers, but other printers might have more restrictive
%    mechanical constraints that can affect their ability to print so
%    close to the paper edge: let's hope everything works\ldots
%    \begin{macrocode}
  \setlength\marginparwidth{\oddsidemargin}
  \addtolength\marginparwidth{-\marginparsep}
  \addtolength\marginparwidth{-7mm}
%    \end{macrocode}
%    However, with some paper formats (\emph{e.g.}, with landscape
%    orientation) the above setting may yield very wide marginal notes,
%    which is undesirable.  Therefore, if the value just set exceeds one
%    third of "\textwidth", we cut it down to this value, provided that
%    the latter is at least \( 90\,\mbox{pt} \).
%    \begin{macrocode}
  \setlength\@tempdima{.33333\textwidth}
  \ifdim\marginparwidth > \@tempdima
    \ifdim\@tempdima < 90pt\else
      \setlength\marginparwidth{\@tempdima}
    \fi
  \fi
%    \end{macrocode}
%
%    All the main horizontal page layout parameters have been set.  We
%    can now convert "\oddsidemargin" into \TeX's coordinate system: we
%    did not do this before to ease other computations.  We also set
%    "\evensidemargin".
%    \begin{macrocode}
  \addtolength\oddsidemargin{-1in}
  \setlength\evensidemargin{\oddsidemargin}
%    \end{macrocode}
%
%    We turn now to vertical parameters.  We set "\textheight"
%    according to~\eqref{eq:textheight} and "\footskip" as stated above.
%    First step:
%    \[
%      "\@tempdima" = \textit{max\_desired\_text\_height}
%        := "\paperheight"-8\,\mbox{cm}
%      \mbox{.}
%    \]
%    \begin{macrocode}
  \setlength\@tempdima{\paperheight}
  \addtolength\@tempdima{-8cm}
  \setlength\footskip{\@tempdima}
%    \end{macrocode}
%    Remove the first line, which is only "\topskip" high:
%    \begin{macrocode}
  \addtolength\@tempdima{-\topskip}
%    \end{macrocode}
%    Set "\textheight" to the largest possible integer multiple of
%    "\baselineskip":
%    \begin{macrocode}
  \divide\@tempdima\baselineskip
  \@tempcnta=\@tempdima
  \setlength\textheight{\@tempcnta\baselineskip}
%    \end{macrocode}
%    Put in again the first line:
%    \begin{macrocode}
  \addtolength\textheight{\topskip}
%    \end{macrocode}
%    "\footskip" is still equal to \( "\paperheight"-8\,\mbox{cm} \);
%    finish its initialization (cf.~above):
%    \begin{macrocode}
  \addtolength\footskip{-\textheight}
  \addtolength\footskip{1.5cm}
%    \end{macrocode}
%
%    The following "\fi" goes with "\if@compatibility":
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
%    \begin{macro}{\computelongindentation}
%    As explained above, "\longindentation" is a parameter that should
%    set to roughly half the value of "\textwidth", with optional
%    fine-tuning for better graphical results.  The setting is made
%    by the "\computelongindentation" macro, which is available also
%    to the final user: if (s)he alters the value of "\textwidth",
%    then (s)he should also call this macro to update the value of
%    "\longindentation".  The macro takes care of all the necessary
%    fine-tuning.
%    \begin{macrocode}
\newcommand*\computelongindentation{%
%    \end{macrocode}
%    More precisely, "\longindentation" is set as follows: the first
%    attempt is to set it equal to the width of the writing
%    ``oordinamento dei Dottorandi di Padova'' ("\@oordinamento@box"
%    is initialized below), because this makes for a great visual
%    effect\ldots
%    \begin{macrocode}
  \setlength\@tempdima{\wd\@oordinamento@box}%
  \setlength\longindentation{\@tempdima}%
%    \end{macrocode}
%    \ldots but this ideal value will only be retained if it falls within
%    the closed range \( [\frac{1}{2}"\textwidth"-2.5\,\mbox{mm},
%    \frac{1}{2}"\textwidth"+12.5\,\mbox{mm}] \), that is, sufficiently
%    close to \( \frac{1}{2}"\textwidth" \) (which is the case for the
%    most common page formats, like \opz{a4paper}); otherwise, \(
%    \frac{1}{2}"\textwidth" \) will be used.
%    \begin{macrocode}
  \addtolength\@tempdima{2.5mm}%
  \ifdim\@tempdima<.5\textwidth
    \setlength\longindentation{.5\textwidth}%
  \else
    \addtolength\@tempdima{-12.5mm}%
    \ifdim\@tempdima>.5\textwidth
      \setlength\longindentation{.5\textwidth}%
    \fi
  \fi
%    \end{macrocode}
%    A final check is also made to assure that "\longindentation" falls
%    within the closed range \( [\frac{4}{10}"\textwidth",
%    \frac{6}{10}"\textwidth"] \).
%    \begin{macrocode}
  \ifdim\longindentation<.4\textwidth
    \setlength\longindentation{.5\textwidth}%
  \else\ifdim\longindentation>.6\textwidth
    \setlength\longindentation{.5\textwidth}%
  \fi\fi
}
%    \end{macrocode}
%    \end{macro}
%
%    The following part of the code deals with initializations the have
%    to be deferred until the "\begin{document}" hook.  The most complex
%    of these is the check about the "\foldedheight" parameter.  Recall
%    that this parameter, which is initialized to a default value by the
%    code which handles the \ldots\opz{paper} options, can be altered by
%    the user at any time, but has to be converted in an internal form
%    afterwards; before making the conversion, we need to check that the
%    value lies in the prescribed range.  If this is not the case, we
%    issue a warning and set the "\if@do@fold@" switch to false: the
%    following two macros, which are used below, take care of this,
%    providing two different types of warning.  They take two arguments,
%    used to modify the warning printed to the user: argument \#1 will be
%    either the word ``short'' or the word ``tall'', and argument \#2
%    will contain text giving further help.
%
%    \begin{macro}{\@folding@ht@warn}
%    This macro is invoked when the value of "\foldedheight" is found
%    to be wrong in the check that is made during the "\AtBeginDocument"
%    hook.
%    \begin{macrocode}
\@ifdefinable\@folding@ht@warn{\def\@folding@ht@warn#1#2{%
  \ClassWarningNoLine{\@letteracdp}{%
    \protect\foldedheight\space ignored:
    it is too #1!\MessageBreak
    (#2.)\MessageBreak
    Folded letters will be shunned%
  }%
  \@do@fold@false
}}%
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@folding@ht@NO}
%    This macro is used by the "\checkfoldedheight" command.
%    \begin{macrocode}
\@ifdefinable\@folding@ht@NO{\def\@folding@ht@NO#1#2{%
  \ClassWarning{\@letteracdp}{%
    Bad value of \protect\foldedheight: it is too #1!\MessageBreak
    (#2.)\MessageBreak
    Therefore, at present folded letters are _shunned_;\MessageBreak
    warning issued%
  }%
  \@do@fold@false
}}%
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@folding@ht@OK}
%    The following, instead, is the macro used to inform the user that
%    the value of "\foldedheight" is correct.  It sets the "\if@do@fold@"
%    switch to true, too.
%    \begin{macrocode}
\@ifdefinable\@folding@ht@OK{\def\@folding@ht@OK{%
  \ClassWarning{\@letteracdp}{%
    Checked \protect\foldedheight,
    current value is acceptable.\MessageBreak
    Therefore, at present folded letters are _allowed_;\MessageBreak
    warning issued%
  }%
  \@do@fold@true
}}%
%    \end{macrocode}
%    \end{macro}
%
%    Uncommented code starts here.
%    \begin{macrocode}
\@ifdefinable\@checkfoldedheight{\def\@checkfoldedheight#1#2{%
  \ifdim\foldedheight>\z@
    \ifdim\foldedheight>.6\paperheight
      #1{tall}{% action to take if value is bad
        It must not exceed 0.6\protect\paperheight%
      }%
    \else
      \setlength\@folding@ht{\foldedheight}%
      \addtolength\@folding@ht{-1in}%
      \addtolength\@folding@ht{-\topmargin}%
      \addtolength\@folding@ht{-\headheight}%
      \setlength\@lh@folding@ht{-\@folding@ht}%
      \addtolength\@folding@ht{-\headsep}%
      \ifdim\@folding@ht<2.5cm
        #1{short}{% action to take if value is bad
          At least 2cm _of_text_ and 0.5cm of margin\MessageBreak
          must be allowed above the folding%
        }%
      \else
        \setlength\@above@folding@margin{1cm}%
        \setlength\@above@folding@shrink{5mm}%
        \setlength\@below@folding@skip{5mm}%
        \dimen4 .5\baselineskip
        \dimen@ \@folding@ht
        \advance\dimen@ \@below@folding@skip
        \advance\dimen@ -\topskip
        \dimen@ii -\dimen@
        \divide\dimen@ \dimen4%
        \count@ \dimen@
        \advance\dimen@ii \count@\dimen4%
        \addtolength\@below@folding@skip{\dimen@ii}%
        \addtolength\@folding@ht{-\@above@folding@margin}%
        #2% action to take if value is OK
      \fi
    \fi
  \else
    \@do@fold@false
  \fi
}}
\newcommand*\checkfoldedheight{%
  \@checkfoldedheight\@folding@ht@NO\@folding@ht@OK
}
\AtBeginDocument{%
  \setlength\@lh@left@margin{4cm}%
  \addtolength\@lh@left@margin{-1in}%
  \addtolength\@lh@left@margin{-\oddsidemargin}%
  \setlength\@lh@right@margin{\@lh@left@margin}%
  \addtolength\@lh@right@margin{-2cm}%
  \@checkfoldedheight\@folding@ht@warn\@do@fold@true
  \let\@folding@ht@warn\@undefined
}
\sbox\@oordinamento@box{%
  \@lh@nss oordinamento dei {\@lh@bss D}\kern-.033333em ottorandi di
  {\@lh@bss P}\kern-.1em adova\enspace
}
\computelongindentation
\newcommand*\standardvertspaces{%
  \setlength\aboveaddressvspace       {\medskipamount}%
  \@msetlength\andaddressvspace       {2}{\medskipamount}%
  \@msetlength\belowaddressvspace     {3}{\medskipamount}%
  \setlength\abovesubjectvspace       {\medskipamount}%
  \setlength\presubjectvspace         {\medskipamount}%
  \@msetlength\belowsubjectvspace     {3}{\medskipamount}%
  \@msetlength\abovesignaturevspace   {6}{\medskipamount}%
  \setlength\abovesignatureshortvspace{\bigskipamount}%
  \setlength\belowsignaturevspace     {\bigskipamount}%
  \@msetlength\belowpresentationvspace{3}{\medskipamount}%
}
\setlength\senderindentation   {\z@}
\setlength\senderwidth         {\textwidth}
\setlength\addresseeindentation{\z@}
\setlength\addresseewidth      {\textwidth}
\setlength\signatureindentation{\z@}
\setlength\signaturewidth      {\textwidth}
\standardvertspaces
%    \end{macrocode}
%
%    \subsubsection{Page styles}
%
%    \begin{macrocode}
\newcommand*{\automark}{\let\@mkboth\markboth}
\newcommand*{\usermark}{\let\@mkboth\@gobbletwo}
\automark % default is to put page no. and addressee in the header
%% We need to change even the definition of the standard page styles.
\def\ps@empty{%
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \let\@oddfoot\@empty
  \let\@evenfoot\@empty
}
\def\ps@plain{%
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@firstpage{%
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \let\@oddfoot\@first@foot
  \let\@evenfoot\@centred@folio
}
\def\ps@foldedpage{%
  \def\@oddhead{\hfill\@folding@tag}%
  \let\@evenhead\@empty
  \let\@oddfoot\@first@foot
  \let\@evenfoot\@centred@folio
}
\def\ps@letterhead{%
  \let\@oddhead\@cdp@head
  \let\@evenhead\@empty
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@firstletterhead{%
  \let\@oddhead\@cdp@head
  \let\@evenhead\@empty
  \let\@oddfoot\@cdp@foot
  \let\@evenfoot\@centred@folio
}
\def\ps@foldedletterhead{%
  \def\@oddhead{\@cdp@head\@folding@tag}%
  \let\@evenhead\@empty
  \let\@oddfoot\@cdp@foot
  \let\@evenfoot\@centred@folio
}
\def\ps@logo{%
  \def\@oddhead{\@cdp@logo\hfill}%
  \let\@evenhead\@empty
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@headings{%
  \automark
  \let\@oddhead\@r@head
  \let\@evenhead\@l@head
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@logoheadings{%
  \automark
  \def\@oddhead{\@cdp@logo\@r@head}%
  \let\@evenhead\@l@head
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@myheadings{%
  \usermark
  \let\@oddhead\@r@head
  \let\@evenhead\@l@head
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@logomyheadings{%
  \usermark
  \def\@oddhead{\@cdp@logo\@r@head}%
  \let\@evenhead\@l@head
  \let\@oddfoot\@centred@folio
  \let\@evenfoot\@centred@folio
}
\def\ps@letterheadnpn{%
  \let\@oddhead\@cdp@head
  \let\@evenhead\@empty
  \let\@oddfoot\@empty
  \let\@evenfoot\@empty
}
\def\ps@logonpn{%
  \def\@oddhead{\@cdp@logo\hfill}%
  \let\@evenhead\@empty
  \let\@oddfoot\@empty
  \let\@evenfoot\@empty
}
\@ifdefinable\@centred@folio{\def\@centred@folio{%
  \reset@font\hfil\thepage\hfil
}}
\@ifdefinable\@l@head{\def\@l@head{%
  \reset@font\slshape\hfil\ignorespaces\leftmark\unskip\/\hfil
}}
\@ifdefinable\@r@head{\def\@r@head{%
  \reset@font\slshape\hfil\ignorespaces\rightmark\unskip\/\hfil
}}
\@ifdefinable\@first@foot{\def\@first@foot{%
  \reset@font
  \raisebox{-24\p@}[\z@]{%
    \hb@xt@\textwidth{%
      \ifcase \@ptsize\relax
        \normalsize
      \or
        \small
      \or
        \footnotesize
      \fi
      \thesenderlocation \hfill \thesenderphone
    }%
  }\hss
}}
\@ifdefinable\@folding@tag{\def\@folding@tag{%
  \if@do@fold@
    \raisebox{\@lh@folding@ht}[\z@][\z@]{%
      \makebox[\z@][l]{%
        \dimen@ -\@lh@right@margin
        \advance\dimen@ 1cm%
        \kern\dimen@ \vbox{%
          \kern -.1\p@
          \hrule \@height .1\p@ \@depth .1\p@ \@width 5mm%
          \kern -.1\p@
        }%
      }%
    }%
  \fi
}}
%    \end{macrocode}
%
%    \subsubsection{Macros for drawing the CDP seal}
%
%    \begin{macrocode}
\savebox\@logo@box@base[\z@][r]{\setlength\unitlength{.625mm}%
  \begin{picture}(32,16)(-3,7.87)%
    \put(8,16){\oval(10,10)[l]}%
    \put(8,11){\line(0,1){10}}%
    \put(9,11){\framebox(3,20){}}%
    \put(18,16){\oval(10,10)[r]}%
    \put(18,11){\line(0,1){10}}%
    \put(14,1){\framebox(3,20){}}%
    \thicklines
    \put(8,16){\oval(16,16)[l]}%
    \put(8,8){\line(1,0){5}}%
    \put(13,24){\line(1,0){10}}%
    \put(8,16){\oval(14,14)[l]}%
    \put(8,9){\line(1,0){5}}%
    \put(13,23){\line(1,0){10}}%
  \end{picture}%
}%
\savebox\@logo@box@addS[\z@][r]{\setlength\unitlength{.625mm}%
  \begin{picture}(32,16)(-3,7.87)%
    \thicklines
    \put(18,8){\line(1,0){8}}%
    \put(18,9){\line(1,0){8}}%
  \end{picture}%
}%
\savebox\@logo@box@addL[\z@][r]{\setlength\unitlength{.625mm}%
  \begin{picture}(32,16)(-3,7.87)%
    \thicklines
    \put(18,8){\line(1,0){10}}%
    \put(18,9){\line(1,0){10}}%
  \end{picture}%
}%
\@ifdefinable\@logo@overlay{\def\@logo@overlay{%
  \kern\@lh@left@margin
  \copy\@logo@box@base \copy
}}
\@ifdefinable\@cdp@logo{\def\@cdp@logo{%
  \@logo@overlay\@logo@box@addS
}}
\@ifdefinable\@cdp@head{\def\@cdp@head{%
  \@logo@overlay\@logo@box@addL
  \copy\@oordinamento@box \hrulefill \kern\@lh@right@margin
}}
\setbox\@name@and@WWW@box = \vtop{%
  \baselineskip 11\p@
  \hb@xt@\z@{\hss \@lh@rm\Coordinamento \hss}%
  \hb@xt@\z@{%
    \hss
    \@lh@it World Wide Web:\/
    \@lh@tt \CoordinamentoWWW
    \hss
  }%
}
\@ifdefinable\@cdp@foot{\def\@cdp@foot{%
  \reset@font
  \setlength\@tempdima{\textwidth}%
  \addtolength\@tempdima{-2\@lh@right@margin}%
  \hss\parbox[t]{\@tempdima}{%
    \parfillskip\z@skip
    \noindent\hrulefill\@@par
    \baselineskip 11\p@
    \hb@xt@\hsize{\hfil\copy\@name@and@WWW@box\hfil}%
  }\hss
}}
%    \end{macrocode}
%
%    \subsubsection{``Letter-making'' environments}
%
%    \begin{macrocode}
\newcommand*\name     [1]{\def\thesendername{#1}}
\newcommand \signature[1]{\def\thesendersignature{#1}}
\newcommand \address  [1]{\def\thesenderaddress{#1}}
\newcommand \location [1]{\def\thesenderlocation{#1}}
\newcommand*\telephone[1]{\def\thesenderphone{#1}}
\newcommand*\makelabels{%
  \AtBeginDocument{%
     \def\@beginlabels{\begin{labels}}%
     \def\@beginlabelgroup{\begin{labelgroup}}%
     \let\@mlabel\basemlabel
     \def\@endlabelgroup{\end{labelgroup}}%
     \def\@endlabels{\end{labels}}%
     \if@filesw
       \immediate\write\@mainaux{\string\@beginlabels}\fi}%
  \AtEndDocument{%
     \if@filesw\immediate\write\@mainaux{\string\@endlabels}\fi}}
\@onlypreamble\makelabels
\newcommand*\cleardoubleemptypage{\par
  \onecolumn
  \if@twoside \ifodd\c@page \else
    \thispagestyle{empty}\null\newpage
  \fi\fi
}
\@ifdefinable\@safe@space{\def\@safe@space#1#2{%
  \setbox\z@\hbox{\ignorespaces #1\unskip}%
  \ifdim\wd\z@>\z@
    \unhbox\z@ #2%
  \else
    \unhbox\z@
  \fi
}}
%    \end{macrocode}
%
%    \begin{environment}{baseletter}
%    \changes{0.31}{2001 Dec 01}{Reintroduced the first mandatory argument
%      to hold local initializations}
%    All the ``letter-making'' environments are based upon this one,
%    which is the lowest-level one.  Its purpose is to take the basic
%    actions that are needed to begin and end every kind of letter.  In
%    this version of the code it takes two arguments (this has changed
%    several times among different releases), which are meant to contain
%    code that performs any custom initialization required by the
%    higher-level environments (or by the user, if this environment is
%    called directly by the user).  The code passed in~"#1" is executed
%    before the core initializations provided by "baseletter", but inside
%    the group implied by this environment; the code passed in~"#2" is
%    executed as the last thing.  Other arguments will be picked up by the
%    "\x@baseletter" or "\y@baseletter" macro.
%    \begin{macrocode}
\newenvironment{baseletter}[2]{%
  #1%
%    \end{macrocode}
%    Save~"#2" in a token register for later execution:
%    \begin{macrocode}
  \@lett@decl{#2}%
%    \end{macrocode}
%    Obvious initializations; note that "\cleardoubleemptypage" calls
%    "\onecolumn".
%    \begin{macrocode}
  \cleardoubleemptypage
  \c@page\@ne
  \refstepcounter{letter}%
  \typeout{Letter \number\c@letter}%
  \interlinepenalty 200 % smaller than the TeXbook value
  \parskip\medskipamount
%    \end{macrocode}
% Set "\parindent" according to the option specified by the user.
%    \begin{macrocode}
  \ifx\@indent@pref L\else
    \ifx\@indent@pref N%
      \setlength\parindent{\z@}%
    \else
      \ifdim .1\textwidth>2pc
        \setlength\parindent{.1\textwidth}%
      \else
        \setlength\parindent{2pc}%
      \fi
    \fi
  \fi
%    \end{macrocode}
%    Continue initialization in two different ways, according to the
%    presence or not of the first optional argument.
%    \begin{macrocode}
  \@ifnextchar[\x@baseletter\y@baseletter % ] bracket matching
}{%
%    \end{macrocode}
%    Code for ending letters.  "\stopletter" is a hook reserved to the
%    user; it is executed \emph{before} the last page of the letter is
%    finished off.
%    \begin{macrocode}
  \stopletter
%    \end{macrocode}
%    Now ensure vertical mode and add a zero-cost page break \emph{above}
%    the vertical glue (possibly) present at the end of the page: this
%    allows to discard the glue after the signature if this is needed to
%    fit the letter in the page, even if "\stopbreaks" is in effect after
%    the signature.  Should this be a ``"-\@M"''-cost page break instead?
%    (Probably yes, but not sure of all implications, so leave it this
%    way.)
%    \begin{macrocode}
  \@@par\addpenalty\z@
  \clearpage
%    \end{macrocode}
%    The following is a hook reserved to extensions of the
%    \packlass{letteracdp} class; it is used, for instance, by
%    \packlass{articoletteracdp}.  Note that it is executed \emph{after}
%    ejecting the last page of the letter.
%    \begin{macrocode}
  \@end@letter@hook
%    \end{macrocode}
%    Write to the \filedir{.aux} file the data for the address labels.
%    This is rather tricky because we can have multiple addressees
%    \emph{and} multiple senders.
%    \begin{macrocode}
  \if@filesw
    \begingroup
%    \end{macrocode}
%    Assure that "\\", "~" and "\protect"'ed tokens are written literally
%    instead of being expanded:
%    \begin{macrocode}
      \let\\\relax
      \let ~\relax
      \let\protect\@unexpandable@protect
%    \end{macrocode}
%    ^^A { bracket match
%    The following hack causes "\and" (and "\andcc") to expand into
%    "}\@gobble{"
%    ^^A } bracket match
%    \begin{macrocode}
      \def\and{%
        \iffalse{\fi}\expandafter\@gobble\expandafter{\iffalse}\fi
      }%
      \let\andcc\and
%    \end{macrocode}
%    "\returnaddress" contains the addresses of the senders, separated by
%    "\and"; thanks to the above hack, only the first is saved into
%    "\@cdp@reserved", and the others are "\@gobble"'d.
%    \begin{macrocode}
      \edef\@cdp@reserved{{\returnaddress}}%
      \def\and{%
        \iffalse{\fi}^^J%
        \string\@mlabel{\@cdp@reserved}{\iffalse}\fi
      }%
      \let\andcc\and
      \immediate\write\@auxout{%
        \string\@beginlabelgroup ^^J%
        \string\@mlabel
          {\@cdp@reserved}{\theaddresseeaddress}^^J%
        \string\@endlabelgroup
      }%
    \endgroup
  \fi
}
%    \end{macrocode}
%    \end{environment}
%
%    Back to uncommented code.
%    \begin{macrocode}
\@ifdefinable\x@baseletter{\long\def\x@baseletter[#1]#2{%
  \def\theaddresseename{#1}%
  \def\theaddresseeaddress{#2}%
  \@baseletter
}}
\@ifdefinable\y@baseletter{\long\def\y@baseletter#1{%
  \@cut@andcc #1\andcc @@@%
  \def\theaddresseeaddress{#1}%
  \@baseletter
}}
\newcommand\@baseletter[1][]{%
  \def\thesubject{#1}%
  \if@twoside
    \@mkboth{%
      \noexpand\@safe@space\noexpand\headtoname\noexpand\enspace
      \ignorespaces\theaddresseename\unskip \hfill \noexpand\@date
    }{%
      \noexpand\@date \hfill
      \noexpand\@safe@space\noexpand\headtoname\noexpand\enspace
      \ignorespaces\theaddresseename % \unskip put by \@?@head
    }%
  \else
    \@mkboth{}{%
      \noexpand\@safe@space\noexpand\headtoname\noexpand\enspace
      \ignorespaces\theaddresseename\unskip \hfill \noexpand\@date
    }%
  \fi
  \the\@lett@decl
  \@begin@letter@hook
}
\@ifdefinable\@cut@andcc{\long\def\@cut@andcc#1\andcc#2@@@{%
  \@cut@and #1\and @@@%
}}
\@ifdefinable\@cut@and{\long\def\@cut@and#1\and#2@@@{%
  \@cut@nl #1\\@@@%
}}
\@ifdefinable\@cut@nl{\long\def\@cut@nl#1\\#2@@@{%
  \@cut@par #1\par @@@%
}}
\@ifdefinable\@cut@par{\long\def\@cut@par#1\par#2@@@{%
  \def\theaddresseename{#1}%
}}
\newcommand*\stopbreaks{%
  \interlinepenalty\@M
  \def\par{\ifvmode\else\@@par\nobreak\fi}%
  \let\\\@nobreakcr
  \let\vspace\@nobreakvspace
}
\DeclareRobustCommand\@nobreakvspace
   {\@ifstar\@vspacer\@nobreakvspacex}
\@ifdefinable\@nobreakvspacex{\def\@nobreakvspacex#1{%
  \ifvmode
    \nobreak
    \vskip #1%
    \vskip\z@skip
  \else
    \@bsphack
    \vadjust{\@restorepar
      \nobreak
      \vskip #1%
      \vskip\z@skip
    }%
    \@esphack
  \fi
}}
\@ifdefinable\@nobreakcr{\def\@nobreakcr{%
  \@ifstar{\@normalcr*}{\@normalcr*}%
}}
\newcommand*\startbreaks{%
  \interlinepenalty 200%
  \let\par\@@par
  \let\\\@normalcr
  \let\vspace\@@vspace
}
\@ifdefinable\@par@stopbreaks{\def\@par@stopbreaks{%
  \par\nobreak\stopbreaks
}}
\@ifdefinable\@@letter{\def\@@letter#1#2#3{%
  \ifx#2N%
    \renewcommand*\makepresentation{\makenormalpresentation}%
    \renewenvironment*{presentation}{%
      \normalpresentation
    }{%
      \endnormalpresentation
    }%
  \else\ifx#2F%
    \renewcommand*\makepresentation{\makefoldedpresentation}%
    \renewenvironment*{presentation}{%
      \foldedpresentation
    }{%
      \endfoldedpresentation
    }%
  \fi\fi
  \setlength\senderindentation   {\z@}%
  \setlength\senderwidth         {#3}%
  \setlength\addresseeindentation{#3}%
  \setlength\addresseewidth      {\textwidth}%
    \addtolength\addresseewidth{-\addresseeindentation}%
  \setlength\signatureindentation{.3\textwidth}%
  \setlength\signaturewidth      {.6\textwidth}%
  \renewcommand*\closingindentation{\parindent}
  \renewcommand*\signaturealignment{\centering}%
  \standardvertspaces
  \baseletter{}{%
    #1%
  }%
}}
\@ifdefinable\@letter{\def\@letter#1{%
  \@@letter{\thispagestyle{#1}}%
}}
\newenvironment*{customletter}{%
  \@@letter{}L%
}{\endbaseletter}
\newenvironment*{letter}{%
  \@letter{firstpage}N{.5\textwidth}%
}{\endbaseletter}
\newenvironment*{foldedletter}{%
  \@letter{foldedpage}F{.5\textwidth}%
}{\endbaseletter}
\newenvironment*{letter*}{%
  \@letter{firstpage}N\longindentation
}{\endbaseletter}
\newenvironment*{foldedletter*}{%
  \@letter{foldedpage}F\longindentation
}{\endbaseletter}
\newenvironment*{letterhead}{%
  \@letter{firstletterhead}N\longindentation
}{\endbaseletter}
\newenvironment*{foldedletterhead}{%
  \@letter{foldedletterhead}F\longindentation
}{\endbaseletter}
%    \end{macrocode}
%
%    \subsubsection{Addresses and subject}
%
%    \begin{macrocode}
\@ifdefinable\@block@parshape{\def\@block@parshape{%
  \parshape \@ne\@block@inden\@block@width
}}
\@ifdefinable\@block@@everypar{\def\@block@@everypar{%
  \parskip\z@skip
  \@nobreakfalse \@minipagefalse % these are already \global
  \@new@block@false \@empty@and@false % these too
  \everypar{\@block@parshape}%
}}
\@ifdefinable\@block@everypar{\def\@block@everypar{%
  \@block@parshape
  \@block@@everypar
}}
\@ifdefinable\x@custom@block{\def\x@custom@block#1#2#3#4#5#6#7#8#9{%
  \@custom@block#1#4#5#6#8#9%
  \@block@inden #2%
  \@block@width #3%
  \def\voidisOK{\global\let\@empty@block\@empty}%
  \everypar{\@block@everypar}%
  \@@custom@block #7%
}}
\@ifdefinable\y@custom@block{\def\y@custom@block#1#2#3#4#5#6#7#8{%
  \@custom@block#1#3#4#5#7#8%
  \sbox\@labels{\normalfont\ignorespaces #2\unskip}%
    % We use \@labels to save a box register.
  \@block@inden\wd\@labels
  \ifdim\@block@inden>\z@
    \advance \@block@inden by \subjectnamegap \relax
    \wd\@labels\@block@inden
  \fi
  \@block@width\textwidth \advance\@block@width -\@block@inden
  \everypar{%
    \parshape \tw@ \z@\textwidth \@block@inden\@block@width
    \box\@labels
    \@block@@everypar
  }%
  \@@custom@block #6%
}}
\@ifdefinable\@custom@block{\def\@custom@block#1#2#3#4#5#6{%
  \if@inlabel \indent \fi
  \let\par\@@par \par
  \if@newlist \@noitemerr \fi
  \let\makelabel\m@kel@bel
  \@nobreakfalse
  \@noskipsecfalse
  \@totalleftmargin\z@
  \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
  \parfillskip\@flushglue
  \ifx#1Y%
    \parskip #2\relax
    \ifdim\lastskip>\parskip
      \parskip\z@skip
    \else
      \advance\parskip -\lastskip
    \fi
  \else
    \parskip\z@skip
  \fi
  \parindent\z@
  \linewidth\textwidth
  \hsize\textwidth
  \@block@space #4%
  \@block@andspace #3%
  \@i@penalty #5%
  \@e@penalty #6%
  \stopbreaks
  \@new@block@true \@empty@and@true
}}
\@ifdefinable\@@custom@block{\def\@@custom@block#1{%
  \addpenalty #1%
  \color@begingroup
}}
\def\end@custom@block#1{\par
  \color@endgroup
  \if@new@block@
    \@empty@block
  \else
    \if@empty@and@
      \@empty@and
    \fi
    \ifx#1Y%
      \addpenalty\@e@penalty
      \addvspace\@block@space
    \fi
  \fi
  \everypar{}%
}
\newcommand*\makeandvspace{%
  \addpenalty\@i@penalty
  \addvspace\@block@andspace
}
\newcommand*\makeandcclabel[1][\andccname]{%
  \makebox[\z@][r]{\normalfont\@safe@space{#1}\quad}%
  \ignorespaces
}
\@ifdefinable\@block@nd{\def\@block@nd{\par
  \if@empty@and@
    \@empty@and
  \else
    \makeandvspace
  \fi
  \@empty@and@true
  \everypar{\@block@everypar}%
}}
\@ifdefinable\@empty@and{\def\@empty@and{%
  \ClassWarning{\@letteracdp}{%
    \protect\and\space with nothing inside%
  }%
}}
\@ifdefinable\@empty@sender{\def\@empty@sender{%
  \ClassWarning{\@letteracdp}{%
    Empty sender address%
  }%
}}
\@ifdefinable\@sender{\def\@sender#1{%
  \let\@empty@block\@empty@sender
  \let\and\@block@nd
  \x@custom@block #1%
    \senderindentation\senderwidth
    \aboveaddressvspace\andaddressvspace\belowaddressvspace
    \@b@frompenalty\@i@frompenalty\@e@frompenalty
  \raggedright
}}
\newenvironment*{sender} {\@sender Y}{\end@custom@block Y}
\newenvironment*{sender*}{\@sender N}{\end@custom@block N}
\@ifdefinable\@empty@addressee{\def\@empty@addressee{%
  \ClassWarning{\@letteracdp}{%
    Empty addressee address%
  }%
}}
\@ifdefinable\@addressee{\def\@addressee#1{%
  \let\@empty@block\@empty@addressee
  \let\and\@block@nd
  \def\andcc{\@block@nd
    \everypar\expandafter{\the\everypar
      \makeandcclabel\relax
    }%
  }%
  \x@custom@block #1%
    \addresseeindentation\addresseewidth
    \aboveaddressvspace\andaddressvspace\belowaddressvspace
    \@b@topenalty\@i@topenalty\@e@topenalty
  \raggedright
}}
\newenvironment*{addressee} {\@addressee Y}{\end@custom@block Y}
\newenvironment*{addressee*}{\@addressee N}{\end@custom@block N}
\@ifdefinable\@good@prsbj{\def\@good@prsbj#1{%
  \@new@block@false \@empty@and@false
  \let\presubject\@bad@prsbj
  \vskip\parskip
  \leftline{\normalfont\ignorespaces #1\unskip}%
  \nobreak
  \parskip\presubjectvspace
}}
\@ifdefinable\@bad@prsbj{\def\@bad@prsbj#1{%
  \ClassError{\@letteracdp}{%
    Misused \protect\presubject%
  }{%
    At the beginning of the subject of a letter
    you can write something like\MessageBreak
    \protect\presubject{A short phrase...}
    in order to typeset "A short phrase..."\MessageBreak
    just above the subject; but the \protect\presubject\space
    command must come before\MessageBreak
    any other text in the subject,
    and it cannot be used twice.\MessageBreak
    (If you are wondering where you used the
    \protect\presubject\space command,\MessageBreak
    recall that both \protect\registered\space and
    \protect\registeredRR\space invoke
    \protect\presubject.)\MessageBreak
    The offending command will be ignored:
    try to type \space <return> \space to proceed.%
  }%
}}
\@ifdefinable\@subject{\def\@subject#1#2{%
  \let\@empty@block\@empty
  \y@custom@block #1%
    {#2}%
    \abovesubjectvspace\z@skip\belowsubjectvspace
    \@b@subjpenalty\@M\@e@subjpenalty
  \let\presubject\@good@prsbj
  \def\registered  {\presubject{\registeredname}}%
  \def\registeredRR{\presubject{\registeredRRname}}%
  \everypar\expandafter{\the\everypar
    \let\presubject\@bad@prsbj
  }%
  \@subject@style
}}
\newenvironment*{subject} [1][\subjectname]
  {\@subject Y{#1}}{\end@custom@block Y}
\newenvironment*{subject*}[1][\subjectname]
  {\@subject N{#1}}{\end@custom@block N}
\newcommand*\ifemptyblock{%
  \if@new@block@
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\@ifdefinable\@makesender{\def\@makesender#1{%
  \begin{sender#1}\thesenderaddress\end{sender#1}%
}}
\newcommand*\makesender{%
  \@ifstar{\@makesender *}{\@makesender {}}%
}
\@ifdefinable\@makeaddressee{\def\@makeaddressee#1{%
  \begin{addressee#1}\theaddresseeaddress\end{addressee#1}%
}}
\newcommand*\makeaddressee{%
  \@ifstar{\@makeaddressee *}{\@makeaddressee {}}%
}
\newcommand*\x@makesubject[1][\subjectname]{%
  \begin{subject}[#1]\thesubject\end{subject}%
}
\newcommand*\y@makesubject[1][\subjectname]{%
  \begin{subject*}[#1]\thesubject\end{subject*}%
}
\newcommand*\makesubject{\@ifstar\y@makesubject\x@makesubject}
%    \end{macrocode}
%
%    \subsubsection{Presentations}
%
%    \begin{macrocode}
\@ifdefinable\@setup@pres{\def\@setup@pres{%
  \global\@topnum\z@ % prevents figures from going at top of page
  \parskip\z@skip
  \parindent\z@
  \@b@frompenalty \@M
  \@i@frompenalty \@fold@toppenalty
  \@e@frompenalty \@M
  \@b@topenalty   \@fold@toppenalty
  \@i@topenalty   \@fold@toppenalty
  \@e@topenalty   \@M
  \@b@subjpenalty \@fold@toppenalty
  \@e@subjpenalty \@M
  \interlinepenalty\@M
  \def\par{\ifvmode\else\@@par\penalty\@fold@toppenalty\fi}%
  \let\\\@nobreakcr
  \let\vspace\@nobreakvspace
}}
\newenvironment*{presentation}{%
  \normalpresentation
}{%
  \endnormalpresentation
}
\newenvironment*{normalpresentation}{%
  \cleardoublepage
  \@setup@pres
}{%
  \par
  \addpenalty\@e@prespenalty
  \addvspace\belowpresentationvspace
}
\@ifdefinable\@nofoldwarning{\def\@nofoldwarning{%
  \ClassWarning{\@letteracdp}{%
    The paper format you chose does not allow\MessageBreak
    folded letters; making normal presentation.\MessageBreak
    (Modify \protect\foldedheight\space in the preamble\MessageBreak
    if you want to alter the default behavior.)\MessageBreak
    Warning issued%
  }%
}}
\newenvironment*{foldedpresentation}{%
  \if@do@fold@
    \cleardoublepage
    \setbox\z@\vbox\bgroup
      \@setup@pres
      \color@begingroup
      \penalty-\@M
      \prevdepth\z@
  \else
    \@nofoldwarning
    \normalpresentation
  \fi
}{%
  \if@do@fold@
      \@@par
      \color@endgroup
      \global\dimen@i\prevdepth
      \@f@ldingfilbreak\@fold@basepenalty
      \vskip\maxdimen % "discourage" the break at the \penalty-10000
    \egroup
    \splitmaxdepth\maxdepth
    \splittopskip\topskip
    \setbox\tw@\vsplit\z@ to\z@
    \splittopskip\baselineskip
    \advance\splittopskip\@below@folding@skip
    \advance\splittopskip\parskip
    \setbox\tw@\vsplit\z@ to\@folding@ht
    \nointerlineskip
    \box\tw@
    {\baselineskip\@above@folding@margin \nobreak\null}%
    \penalty\@highpenalty
    \ifvoid\z@
      \vskip\@below@folding@skip
    \else
      \unvbox\z@
      \unskip    % remove "\vskip\maxdimen"
      \unpenalty % remove "\penalty\@fold@basepenalty"
      \unskip    % remove "\vskip \dimen@ plus 1fil minus ..."
      \unskip    % remove "\vskip -\skip@"
      \unpenalty % remove "\penalty 10000"
      \prevdepth\dimen@i
      \addpenalty\@e@prespenalty
      \addvspace\belowpresentationvspace
      \ClassWarning{\@letteracdp}{%
        Some text that did not fit into the folded flap\MessageBreak
        was moved into the main text below the folding;\MessageBreak
        warning issued%
      }%
    \fi
  \else
    \endnormalpresentation
  \fi
}
\newcommand*\iffoldedallowed{%
  \if@do@fold@
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\newcommand*\makepresentation{\makenormalpresentation}
\newcommand*\makenormalpresentation{%
  \begin{normalpresentation}%
    \makesender\relax
    \makeaddressee\relax
    \makesubject\relax
  \end{normalpresentation}%
}
\@ifdefinable\@f@ldingfilbreak{\def\@f@ldingfilbreak#1{%
  \ifdim\prevdepth<\maxdepth
    \dimen@ -\prevdepth
  \else
    \dimen@ -\maxdepth
  \fi
  \skip@ \lastskip
  \nobreak
  \vskip -\skip@
  \vskip \dimen@ \@plus 1fil\@minus \@above@folding@shrink
  \penalty #1%
}}
\@ifdefinable\@foldingfilbreak{\def\@foldingfilbreak#1#2{\par
  \@f@ldingfilbreak#1%
  \vskip -\dimen@ \@plus -1fil\@minus -\@above@folding@shrink
  \vskip \skip@
  \addvspace{#2}%
}}
\@ifdefinable\@fold@getpen{\def\@fold@getpen#1{%
  \ifcase #1 \@fold@basepenalty \or \@fold@lowpenalty
    \or \@fold@medpenalty \or \@fold@highpenalty
    \else \@fold@toppenalty \fi
}}
\newcommand*\foldingbreak[1][\z@]{%
  \ifvmode
    \penalty\@fold@getpen{#1}%
  \else
    \@bsphack
    \vadjust{\penalty\@fold@getpen{#1}}%
    \@esphack
  \fi
}
\newcommand*\foldingfilbreak[2][\z@]{%
  \@foldingfilbreak{\@fold@getpen{#1}}{#2}%
}
\newcommand*\makefoldedpresentation{%
  \if@do@fold@
    \begin{foldedpresentation}%
      \renewcommand*\makeandvspace{%
        \@foldingfilbreak\@fold@medpenalty\andaddressvspace
      }%
      \makesender\relax
      \@foldingfilbreak\@fold@medpenalty\z@skip
      \if@new@block@
        \aboveaddressvspace \z@\@plus1fil\relax
        \nointerlineskip\null\nobreak
      \fi
      \makeaddressee\relax
      \@foldingfilbreak\@fold@lowpenalty\z@skip
      \makesubject\relax
    \end{foldedpresentation}%
  \else
    \@nofoldwarning
    \makenormalpresentation
  \fi
}
%    \end{macrocode}
%
%    \subsubsection{Date, salutation, signature, enclosures\ldots}
%
%    \begin{macrocode}
\@ifdefinable\@make@date{\def\@make@date#1#2#3{\par
  \ifx#2Y%
    \nobreak\medskip
  \fi
  \noindent\@safe@space{#1}\space\@date\par
  \ifx#3Y%
    \nobreak\medskip
  \fi
}}
\newcommand*\makedate      [1][]{\@make@date{#1}NN}
\newcommand*\maketopdate   [1][]{\@make@date{#1}NY}
\newcommand*\makebottomdate[1][]{\@make@date{#1}YN}
\@ifdefinable\@empty@signature{\def\@empty@signature{%
  \ClassWarning{\@letteracdp}{%
    Empty signature%
  }%
}}
\@ifdefinable\@signatureenv{\def\@signatureenv#1{\par
  \let\@empty@block\@empty@signature
  \let\and\@block@nd
  \x@custom@block Y%
    \signatureindentation\signaturewidth
    #1#1\z@skip
    \@M\@M\@M
  \signaturealignment\@signature@style
}}
\def\end@signatureenv{%
  \end@custom@block N% not "Y" for efficiency
  \addvspace\belowsignaturevspace
}
\newenvironment*{signatureenv}{%
  \@signatureenv\abovesignaturevspace
}{%
  \end@signatureenv
}
\newenvironment*{signatureenv*}{%
  \@signatureenv\abovesignatureshortvspace
}{%
  \end@signatureenv
}
\@ifdefinable\x@msignature{\def\x@msignature#1{%
  \begin{signatureenv#1}%
    \ifx\thesendersignature\@empty
      \thesendername
    \else
      \thesendersignature
    \fi
  \end{signatureenv#1}%
}}
\@ifdefinable\y@msignature{\def\y@msignature{%
  \begin{signatureenv}%
    \vskip\parskip \vskip\z@skip
    \the\everypar
  \end{signatureenv}%
}}
\newcommand*\makesignature{\@par@stopbreaks
  \@ifstar{%
    \x@msignature *%
  }{%
    \@ifnextchar -{%
      \@firstoftwo\y@msignature
    }{%
      \x@msignature {}%
    }%
  }%
}
\newcommand*\makeopening{\par
  \@ifnextchar +{\@firstoftwo\y@mopening}\x@mopening
}
\@ifdefinable\x@mopening{\def\x@mopening#1{%
  \ifx\@indent@pref O%
    \dimen@\prevdepth
    \setbox\z@\vbox{\color@begingroup
      \null
      \prevdepth\dimen@
      \noindent\null\ignorespaces #1\par
      \global\dimen@i\prevdepth
    \color@endgroup}%
    \setbox\tw@\vbox{%
      \unvcopy\z@
      \setbox\z@\lastbox
      \global\setbox\@ne\hbox{\unhbox\z@}%
    }%
    \ifdim\wd\@ne<2pc
      \parindent 2pc\relax
    \else\ifdim\wd\@ne>.4\textwidth
      \parindent .1\textwidth\relax
    \else
      \parindent \wd\@ne
    \fi\fi
    \unvbox\z@
    \prevdepth\dimen@i
  \else
    \noindent\null\ignorespaces #1\par
  \fi
  \nobreak
}}
\@ifdefinable\y@mopening{\def\y@mopening{%
  \@handwr@box\z@ \nobreak
}}
\newcommand*\opening{\par
  \@ifnextchar +{%
    \let\@cdp@reserved\y@mopening
    \@firstoftwo\@opening
  }{%
    \let\@cdp@reserved\x@mopening
    \@opening
  }%
}
\newcommand*\@opening[1][]{%
  \makepresentation
  \maketopdate[#1]%
  \@cdp@reserved
}
\newcommand*\makeclosing{\@par@stopbreaks
  \@ifnextchar +{\@firstoftwo\y@mclosing}\x@mclosing
}
\@ifdefinable\x@mclosing{\def\x@mclosing#1{%
  \noindent\hspace*{\closingindentation}\ignorespaces #1\par
}}
\@ifdefinable\y@mclosing{\def\y@mclosing{%
  \@handwr@box\closingindentation
}}
\newcommand*\closing{\@par@stopbreaks
  \@ifstar{%
    \@closing{\x@msignature *}%
  }{%
    \@ifnextchar +{%
      \@firstoftwo{\y@mclosing \y@msignature}%
    }{%
      \@ifnextchar -{%
        \@firstoftwo{\@closing \y@msignature}%
      }{%
        \@closing{\x@msignature {}}%
      }%
    }%
  }%
}
\@ifdefinable\@closing{\def\@closing#1#2{\x@mclosing{#2}#1}}
\@ifdefinable\@handwr@box{\def\@handwr@box#1{%
  \vskip .5\baselineskip
  \setbox\z@\vbox{%
    \hrule\@height .1\p@ \@depth .1\p@ \@width 3\p@
  }%
  \wd\z@\z@ \ht\z@\z@ \dp\z@\z@ \noindent\hspace*{#1}\box\z@\par
  \vskip .5\baselineskip\vskip\z@skip
}}
\newcommand\@cc@encl[2]{\par
  \noindent\parbox[t]{\textwidth}{%
    \@hangfrom{\normalfont\@safe@space{#1}\enspace}%
    \ignorespaces #2\strut
  }\par
}
\newcommand*\cc  [1][\ccname]  {\@cc@encl{#1}}
\newcommand*\encl[1][\enclname]{\@cc@encl{#1}}
\newenvironment{enclosures}[1][\enclname]{%
  \baseenclosures[#1]{}%
}{%
  \endbaseenclosures
}
\newenvironment{baseenclosures}[2][\enclname]{\par
  \addpenalty{-\@lowpenalty}%
  \addvspace{\bigskipamount}%
  \startbreaks
  \parskip\z@skip
  {\parindent\z@ #1\par}%
  \list{\labelenumi}{%
    \usecounter{enumi}%
    \@beginparpenalty\@M
    \@itempenalty-\@lowpenalty
    \@endparpenalty-\@medpenalty
%% ( paren match
    \renewcommand*\labelenumi{\theenumi)}%
    #2%
  }%
}{%
  \endlist
  \aftergroup\startbreaks
}
\newcommand*\ps{\par\startbreaks\parindent\z@}
\newcommand*\@PS@rigid [1][\PSname]{%
  {\normalfont\@safe@space{#1}\enspace}\ignorespaces
}
\newcommand*\@PS@rubber[1][\PSname]{%
  \@safe@space{#1}\space\ignorespaces
}
\newcommand*\PS{%
  \ps\@ifstar{\@PS@rubber}{\@PS@rigid}%
}
\newcommand*\stopletter{}
%    \end{macrocode}
%
%    \subsubsection{Address labels}
%
%    \begin{macrocode}
\newcommand*\returnaddress{\thesenderaddress}
\@ifdefinable\@emptyaddrlabels@err{\def\@emptyaddrlabels@err{%
  \advance \@cdp@gencount \m@ne
  \ClassError{\@letteracdp}{%
    Counter emptyaddrlabels out of range%
  }{%
    The counter emptyaddrlabels holds
    the number of labels\MessageBreak
    to leave blank when starting to print
    the address labels\MessageBreak
    (e.g., because some labels
    have already been peeled off).\MessageBreak
    For the label format you chose,
    it must lie in the range\MessageBreak
    0..\number\@cdp@gencount\space (inclusive),
    but presently its value is \number\c@emptyaddrlabels.\MessageBreak
    It will therefore be ignored;
    type \space <return> \space to proceed.%
  }%
}}
\newcommand*\skipemptylabels{%
  \@cdp@gencount \c@addrlabelrows
  \multiply \@cdp@gencount \c@addrlabelcolumns
  \ifnum\c@emptyaddrlabels<\z@
    \@emptyaddrlabels@err
  \else\ifnum\c@emptyaddrlabels<\@cdp@gencount
    \begingroup
      \let\ifactuallabel\@secondoftwo
      \@whilenum\c@totallabel<\c@emptyaddrlabels\do{\@mlabel{}{}}%
    \endgroup
  \else
    \@emptyaddrlabels@err
  \fi\fi
}
\newenvironment*{baselabels}{%
  \cleardoubleemptypage
  \c@page\@ne
  \typeout{Address Labels}%
  \pagestyle{empty}%
  \textwidth \c@addrlabelcolumns\addrlabelwidth
  \count@ \c@addrlabelcolumns
  \advance \count@ \m@ne
  \ifnum\count@>\z@
    \advance \textwidth \count@\addrlabelshsep
  \fi
  \linewidth\textwidth \hsize\textwidth
  \oddsidemargin -1in%
  \advance \oddsidemargin \addrlabelsleftmargin
  \evensidemargin \oddsidemargin
  \@totalleftmargin\z@
  \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
  \parfillskip\@flushglue
  \textheight \c@addrlabelrows\addrlabelheight
  \count@ \c@addrlabelrows
  \advance \count@ \m@ne
  \ifnum\count@>\z@
    \advance \textheight \count@\addrlabelsvsep
  \fi
  \@colht\textheight  \@colroom\textheight \vsize\textheight
  \headsep \z@
  \headheight \z@
  \footskip \z@
  \topmargin -1in%
  \advance \topmargin \addrlabelstopmargin
  \ifcase \@ptsize\relax
    \normalsize
  \or
    \small
  \or
    \footnotesize
  \fi
  \parindent \z@
  \baselineskip \z@skip
  \lineskip \z@skip
  \boxmaxdepth \z@
  \raggedright
  \fboxrule \z@
  \fboxsep \addrlabelborder
  \addrlabeltrimwidth \addrlabelwidth
  \advance \addrlabeltrimwidth -2\addrlabelborder
  \addrlabeltrimheight \addrlabelheight
  \advance \addrlabeltrimheight -2\addrlabelborder
  \setcounter{totallabel}{\z@}%
  \setcounter{label}{\z@}%
  \setcounter{letter}{\z@}%
  \noindent
  \skipemptylabels
}{%
  \@killglue\clearpage
}
\newenvironment*{labels}{\baselabels}{\endbaselabels}
\let\@beginlabels=\relax
\let\@endlabels=\relax
\newenvironment*{labelgroup}{\stepcounter{letter}}{}
\let\@beginlabelgroup=\relax
\let\@endlabelgroup=\relax
\newcommand*\labeltab{\@killglue
  \ifnum\c@totallabel>\z@
    \count@ \c@totallabel
    \divide \count@ \c@addrlabelcolumns
    \multiply \count@ -\c@addrlabelcolumns
    \advance \count@ \c@totallabel
    \ifnum\count@=\z@
      \par\vskip\addrlabelsvsep\noindent
    \else
      \hskip\addrlabelshsep
    \fi
  \fi
  \stepcounter{totallabel}%
  \stepcounter{label}%
}
\let\ifactuallabel\@firstoftwo
\newcommand\basemlabel[2]{%
  \begingroup
    \def\startaddrlabel{\par
      \noindent \vrule\@height\topskip \@depth\z@ \@width\z@ \par
      \vskip-\baselineskip \vskip\z@skip
    }%
    \def\stopaddrlabel{\par
      \ifnum\prevdepth>\z@
        \kern -\prevdepth
        \prevdepth\z@
      \fi
    }%
    \labeltab\mlabel{\ignorespaces #1}{\ignorespaces #2}%
  \endgroup
}
\newcommand\mlabel[2]{%
  \fbox{%
    \parbox[c][\addrlabeltrimheight]{\addrlabeltrimwidth}{%
      \raggedright\startaddrlabel #2\stopaddrlabel
    }%
  }%
}
\let\@mlabel=\@gobbletwo
%    \end{macrocode}
%
%    \subsubsection{Lists and other similar environments}
%
%    \begin{macrocode}
\normalfont \normalsize
\setlength\leftmargini  {2em}
\setlength\leftmarginii {2em}
\setlength\leftmarginiii{2em}
\setlength\leftmarginiv {1.75em}
\setlength\leftmarginv  {1.5em}
\setlength\leftmarginvi {1.5em}
\setlength\leftmargin   {\leftmargini}
\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\setlength\partopsep{\z@skip}
\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty
\def\@listI{\leftmargin\leftmargini
            \parsep \smallskipamount
            \topsep \medskipamount
            \itemsep\smallskipamount}
\let\@listi\@listI
\@listi
\def\@listii {\leftmargin\leftmarginii
              \labelwidth\leftmarginii
              \advance\labelwidth-\labelsep
              \topsep\smallskipamount
              \parsep\z@skip}
\def\@listiii{\leftmargin\leftmarginiii
              \labelwidth\leftmarginiii
              \advance\labelwidth-\labelsep}
\def\@listiv {\leftmargin\leftmarginiv
              \labelwidth\leftmarginiv
              \advance\labelwidth-\labelsep}
\def\@listv  {\leftmargin\leftmarginv
              \labelwidth\leftmarginv
              \advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
              \labelwidth\leftmarginvi
              \advance\labelwidth-\labelsep}
\renewcommand*\theenumi{\@arabic\c@enumi}
\renewcommand*\theenumii{\@alph\c@enumii}
\renewcommand*\theenumiii{\@roman\c@enumiii}
\renewcommand*\theenumiv{\@Alph\c@enumiv}
\newcommand*\labelenumi{\theenumi.}
\newcommand*\labelenumii{(\theenumii)}
\newcommand*\labelenumiii{\theenumiii.}
\newcommand*\labelenumiv{\theenumiv.}
\renewcommand*\p@enumii{\theenumi}
\renewcommand*\p@enumiii{\theenumi(\theenumii)}
\renewcommand*\p@enumiv{\p@enumiii\theenumiii}
\newcommand*\labelitemi{\textbullet}
\newcommand*\labelitemii{\normalfont\bfseries \textendash}
\newcommand*\labelitemiii{\textasteriskcentered}
\newcommand*\labelitemiv{\textperiodcentered}
\newenvironment*{description}
               {\list{}{\labelwidth\z@ \itemindent-\leftmargin
                        \let\makelabel\descriptionlabel}}
               {\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries #1}
\newenvironment*{verse}
               {\let\\\@centercr
                \list{}{\setlength\itemsep{\z@skip}%
                        \setlength\itemindent{-15\p@}%
                        \setlength\listparindent{\itemindent}%
                        \setlength\rightmargin{\leftmargin}%
                        \addtolength\leftmargin{15\p@}}%
                \item[]}
               {\endlist}
\newenvironment*{quotation}
               {\list{}{\setlength\listparindent{1.5em}%
                        \setlength\itemindent{\listparindent}%
                        \setlength\rightmargin{\leftmargin}}%
                \item[]}
               {\endlist}
\newenvironment*{quote}
               {\list{}{\setlength\rightmargin{\leftmargin}}%
                \item[]}
               {\endlist}
%    \end{macrocode}
%
%    \subsubsection{Miscellanea}
%
%    \begin{macrocode}
\setlength\parindent{2em}
\setlength\parskip{\z@ plus \p@}
\setlength\columnsep{10\p@}
\setlength\columnseprule{\z@}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
\renewcommand*\theequation{\@arabic\c@equation}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax}
\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}}
\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}}
\renewcommand*\footnoterule{%
  \kern-\p@
  \hrule \@width .4\columnwidth
  \kern .6\p@}
\long\def\@makefntext#1{%
    \noindent
    \hangindent 5\p@
    \hb@xt@5\p@{\hss\@makefnmark}#1}
%    \end{macrocode}
%
%    \subsubsection{Names and final setup}
%
%    \begin{macrocode}
\newcommand*\subjectname     {Oggetto:}
\newcommand*\registeredname  {Raccomandata}
\newcommand*\registeredRRname{\registeredname~A.R.}
\newcommand*\andccname       {e~p.~c.}
\newcommand*\ccname          {P.~c.:}
\newcommand*\enclname        {Allegati:}
\newcommand*\PSname          {P.S.:}
\newcommand*\headtoname      {A:}
\newcommand*\today{\number\day~\ifcase\month\or
  gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
  luglio\or agosto\or settembre\or ottobre\or novembre\or dicembre\fi
  \space\number\year}
\let\do\@undefined
\pagestyle{plain}
\pagenumbering{arabic}
\raggedbottom
\onecolumn
%    \end{macrocode}
%
%    End of the module for the \packlass{\letteracdp} class.
%    \begin{macrocode}
%</letter>
%    \end{macrocode}
%
% \section{The code for the \packlass{\articoletteracdp} class}
%
%    This part of the file goes into \filedir{\articoletteracdp.cls}.
%    \begin{macrocode}
%<*artico>
%    \end{macrocode}
%
%    \subsection{Identification}
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1996/06/01] % LaTeX2e is required!
\ProvidesClass{articoletteracdp}
              [2005/01/01 v0.33 (development)]
%% \typeout{Copyright (C) 1999-2005 by Gustavo MEZZETTI,
%%   all rights reserved.}
%    \end{macrocode}
%
%    \subsection{Initial code}
%
%    We check that some names are not already taken.
%    \begin{macrocode}
\@ifdefinable\@out@table@list{}
\@ifdefinable\@in@table@list{}
\@ifdefinable\@do@tf{}
\@ifdefinable\@sec@head@size{}
%    \end{macrocode}
%
%    Definition of two switches that support the options about what to
%    include in the table of contents.
%    \begin{macrocode}
\def\do#1{\@ifdefinable#1{\newif#1}}
\do\if@toc@in@toc@
\do\if@loX@in@toc@
%    \end{macrocode}
%
%    Space above and below captions for figures and tables.
%    \begin{macrocode}
\newlength\abovecaptionskip
\newlength\belowcaptionskip
%    \end{macrocode}
%
%    \subsection{Declaration of options}
%
%    \begin{macrocode}
\DeclareOption{titlepage}{%
  \@latexerr{No title page for letters}\@eha
}
\DeclareOption{notitlepage}{}
\DeclareOption{loXintoc}{%
  \@toc@in@toc@false
  \@loX@in@toc@true
}
\DeclareOption{tocintoc}{%
  \@toc@in@toc@true
  \@loX@in@toc@true
}
\DeclareOption{Hofstadter}{%
  \ExecuteOptions{tocintoc}%
}
\DeclareOption{plaintoc}{%
  \@toc@in@toc@false
  \@loX@in@toc@false
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letteracdp}}
%    \end{macrocode}
%
%    \subsection{Option processing}
%
%    \begin{macrocode}
\ExecuteOptions{plaintoc}
\ProcessOptions\relax
%    \end{macrocode}
%
%    \subsection{Class loading}
%
%    \begin{macrocode}
\LoadClass{letteracdp}[2005/01/01]
%    \end{macrocode}
%
%    \subsection{Main code}
%
%    Unfortunately, the code is not commented (yet).
%
%    \subsubsection{More initializations}
%
%    \begin{macrocode}
\newcounter{section}[letter]
\newcounter{paragraph}[section]
\newcounter{figure}[letter]
\newcounter{table}[letter]
%    \end{macrocode}
%
%    The \packlass{\hyperref} package generates references to paragraphs
%    that include also the "\subsection" and the "\subsubsection" number,
%    because it assumes that paragraphs are numbered within subsubsections.
%    While, on one hand, it is not necessary to actually have subsections
%    numbered within sections, subsubsections numbered within subsection,
%    and paragraphs numbered within subsubsections, on the other, to assure
%    compatibility with \packlass{\hyperref} one must at least
%    \emph{define} the \texttt{subsection} and \texttt{subsubsection}
%    counters, to assure that the \packlass{\hyperref} package may safely
%    mention them.  We do this here, so that \packlass{\articoletteracdp}
%    can be used together with \packlass{\hyperref}.
%    \begin{macrocode}
\newcounter{subsection}
\newcounter{subsubsection}
%    \end{macrocode}
%
%    \begin{macro}{\hyper@last}
%    The following line is to deactivate the check that
%    \packlass{\hyperref} makes against old files; this is necessary
%    because otherwise, on the first \LaTeX\ run, it would overwrite our
%    redefinition of "\@starttoc", possibly writing unwanted
%    \filedir{.toc}, \filedir{.lof}, and \filedir{.lot} files, and (much
%    worse) causing trouble if the letter happens to contain more than one
%    "\tableofcontents", "\listoffigures", or "\listoftables".  Of course,
%    this means that the user must be informed that (s)he has to delete the
%    old files by hand.~\mbox{:-(}^^A ) paren match
%    \spacefactor\sfcode`.  \space
%    Note, anyway, that the automatic check made by \packlass{\hyperref}
%    would not work with the C.D.P.  Bundle in any case, so\ldots
%    \begin{macrocode}
\@ifdefinable\hyper@last{\let\hyper@last\relax}
%    \end{macrocode}
%    \end{macro}
%
%    Back to uncommented code.
%
%    \begin{macrocode}
%% Command \title and \author redefined to make changes local.
\def\title#1{\def\@title{#1}}
\def\author#1{\def\@author{#1}}
%    \end{macrocode}
%
%    \subsubsection{Managing the \filedir{.toc}, \filedir{.lof}, and
%      \filedir{.lot} files}
%
%    \begin{macrocode}
%% Inner command \@starttoc redefined to make table of contents, etc.
%% local to letters (this is tricky!).
\def\@starttoc#1{%
  \begingroup
    \vskip\parskip
    \parskip\z@skip
    \makeatletter
    \@input{\jobname.#1\number\c@letter}%
    \if@filesw
      \@ifundefined{tf@@#1}{%
        \expandafter\newwrite\csname tf@@#1\endcsname
      }\relax
      \immediate\write\@out@table@list{\string\@do@tf{#1}}%
    \fi
    \@nobreakfalse
  \endgroup
}
\g@addto@macro\@begin@letter@hook{%
  \if@filesw
    {\escapechar\m@ne
      \immediate\write\@out@table@list{\string\}^^J\string\{}%
    }%
    \immediate\write\@auxout
      {\string\@deferred@clopen{\number\c@letter}}%
  \fi
}
\@ifdefinable\@deferred@open  {\let\@deferred@open  \@gobble}
\@ifdefinable\@deferred@close {\let\@deferred@close \@empty}
\@ifdefinable\@deferred@clopen{\let\@deferred@clopen\@gobble}
\newwrite\@out@table@list
\newread\@in@table@list
\AtBeginDocument{%
  \if@filesw
    \immediate\openout\@out@table@list = \jobname.summ\relax
    {\escapechar\m@ne
      \immediate\write\@out@table@list{\string\{}%
    }%
    \immediate\write\@auxout{\string\@deferred@open{0}}%
    \def\@deferred@close{%
      \def\@do@tf##1{%
        \@restore@tf{##1}%
        \immediate\closeout \csname tf@##1\endcsname
        \global\expandafter\let\csname tf@##1\endcsname\@undefined
      }%
      \@temp@table@list
    }%
    \def\@deferred@open#1{%
      \ifeof\@in@table@list\else
        \read\@in@table@list to\@temp@table@list
        \def\@do@tf##1{%
          \@restore@tf{##1}%
          \immediate\openout
            \csname tf@##1\endcsname = \jobname.##1#1\relax
        }%
        \@temp@table@list
      \fi
    }%
    \def\@deferred@clopen#1{%
      \@deferred@close
      \@deferred@open{#1}%
    }%
  \fi
}
\AtEndDocument{%
  \if@filesw
    {\escapechar\m@ne
      \immediate\write\@out@table@list{\string\}}%
    }%
    \immediate\closeout\@out@table@list
    \clearpage
    \immediate\write\@auxout{\string\@deferred@close}%
    \openin\@in@table@list = \jobname.summ\relax
  \fi
}
\@ifdefinable\@restore@tf{\def\@restore@tf#1{%
  \edef\@tempa{%
    \let\csname tf@#1\endcsname\csname tf@@#1\endcsname
  }%
  \global\@tempa
}}
\@ifdefinable\@temp@table@list{\let\@temp@table@list\@empty}
%    \end{macrocode}
%
%    \subsubsection{Adding punctuation to titles}
%
%    \begin{macrocode}
\@ifdefinable\@addfullstop{\long\def\@addfullstop#1{%
  {\nonfrenchspacing\ignorespaces#1\unskip
  \ifnum\spacefactor>\@m \else.\fi \/}%
}}
\newcommand*\nopunct{\spacefactor 1001\relax}
%    \end{macrocode}
%
%    \subsubsection{Floats}
%
%    \begin{macrocode}
\setcounter{topnumber}{\tw@}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{\@ne}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{\thr@@}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\c@dbltopnumber\c@topnumber
\let\dbltopfraction\topfraction
\let\dblfloatpagefraction\floatpagefraction
\setlength  \floatsep           {\bigskipamount}
\@msetlength\textfloatsep    {2}{\bigskipamount}
\setlength  \intextsep          {\bigskipamount}
\setlength  \dblfloatsep        {\bigskipamount}
\@msetlength\dbltextfloatsep {2}{\bigskipamount}
\setlength  \@fptop             {\z@ plus 1 fil}
\setlength  \@fpsep             {\bigskipamount}
\setlength  \@fpbot             {\z@ plus 1 fil}
\setlength  \@dblfptop          {\z@ plus 1 fil}
\setlength  \@dblfpsep          {\bigskipamount}
\setlength  \@dblfpbot          {\z@ plus 1 fil}
\setlength\abovecaptionskip{\medskipamount}
\setlength\belowcaptionskip{\z@skip}
%    \end{macrocode}
%
%    \subsubsection{Title, section heads, figures, bibliography\ldots}
%
%    \begin{macrocode}
\newcommand*\maketitle{%
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \def\thesenderaddress{\@author}%
    \def\thesubject{\leavevmode\@addfullstop\@title}%
    \let\@empty@sender\@empty
    \let\@thanks\@empty
    \makepresentation
    \@thanks
  \endgroup
  \setcounter{footnote}{\z@}%
  \maketopdate
}
\setcounter{secnumdepth}{\tw@}
\def\@seccntformat#1{\csname the#1\endcsname .\enspace}
\ifcase \@ptsize\relax
  \def\@sec@head@size{\@setfontsize\@sec@head@size\@xiipt{15}}
\or
  \def\@sec@head@size{\@setfontsize\@sec@head@size\@xiipt{17.4}}
\or
  \def\@sec@head@size{\@setfontsize\@sec@head@size\@xivpt{18.75}}
\fi
\newcommand*\section{\@startsection {section}{\@ne}%
  {\z@}%
  {-\bigskipamount}%
  {\smallskipamount}%
  {%
    \normalfont
    \noindent\null\@@par\nobreak\vskip-\baselineskip
    \parskip\z@skip
    \@sec@head@size\bfseries
  }%
}
\newcommand*\paragraph{\@startsection{paragraph}{\tw@}%
  {\z@}%
  {-\medskipamount}%
  {-.66667em}%
  {\normalfont\normalsize\itshape\@addfullstop}%
}
\newcommand*\epilogue{%
  \if@noskipsec \leavevmode \fi
  \par
  \if@nobreak
    \everypar{}%
  \else
    \addpenalty\@secpenalty\addvspace\bigskipamount
  \fi
}
\renewcommand*\thesection{\@arabic\c@section}
\renewcommand*\theparagraph{\thesection.\@arabic\c@paragraph}
\renewcommand*\thefigure{\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{\@ne}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
\newenvironment*{figure}
               {\@float{figure}}
               {\end@float}
\newenvironment*{figure*}
               {\@dblfloat{figure}}
               {\end@dblfloat}
\renewcommand*\thetable{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{\tw@}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\newenvironment*{table}
               {\@float{table}}
               {\end@float}
\newenvironment*{table*}
               {\@dblfloat{table}}
               {\end@dblfloat}
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\itshape \@addfullstop{#1: #2}}%
  \ifdim \wd\@tempboxa >\hsize
    \unhbox\@tempboxa\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip
}
\newcommand*\@pnumwidth{1.55em}
\newcommand*\@tocrmarg{2.55em}
\newcommand*\@dotsep{4.5}
\setcounter{tocdepth}{\@ne}
\newcommand*\tableofcontents{%
  \section*{\contentsname \sectionmark\contentsname}
  \if@toc@in@toc@
    \addcontentsline{toc}{section}{\protect\contentsname}%
  \fi
  \@starttoc{toc}%
}
\newcommand*\l@section{\@dottedtocline{\@ne}{\z@}{2em}}
\newcommand*\l@paragraph[2]{%
  \@dottedtocline{\tw@}{2em}{2.5em}{\small #1}{\small #2}%
}
\newcommand*\listoffigures{%
  \section*{\listfigurename \sectionmark\listfigurename}%
  \if@loX@in@toc@
    \addcontentsline{toc}{section}{\protect\listfigurename}%
  \fi
  \@starttoc{lof}%
}
\def\l@figure{\@dottedtocline{\@ne}{\z@}{2em}}
\newcommand*\listoftables{%
  \section*{\listtablename \sectionmark\listtablename}%
  \if@loX@in@toc@
    \addcontentsline{toc}{section}{\protect\listtablename}%
  \fi
  \@starttoc{lot}%
}
\let\l@table\l@figure
\newenvironment*{thebibliography}[1]{%
  \startbreaks
  \section*{\refname \sectionmark\refname}%
  \addcontentsline{toc}{section}{\protect\refname}%
  \vskip\parskip
  \parskip\z@skip
  \parindent\z@
  \list{\@biblabel{\@arabic\c@enumiv}}{%
    \settowidth\labelwidth{\@biblabel{#1}}%
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumiv}%
    \let\p@enumiv\@empty
    \renewcommand\theenumiv{\@arabic\c@enumiv}%
  }%
  \sloppy
  \clubpenalty 4000
  \@clubpenalty \clubpenalty
  \widowpenalty 4000
  \sfcode`\.\@m
}{%
  \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
  \endlist
}
\newcommand*\newblock{\hskip .11em\@plus.33em\@minus.07em}
\newcommand*\bysame{\leavevmode\hbox to3em{\hrulefill}\thinspace}
%    \end{macrocode}
%
%    \subsubsection{Names}
%
%    \begin{macrocode}
\newcommand*\contentsname  {Sommario}
\newcommand*\listfigurename{Indice delle figure}
\newcommand*\listtablename {Indice delle tabelle}
\newcommand*\refname       {Testi citati}
\newcommand*\indexname     {Indice analitico}
\newcommand*\figurename    {Figura}
\newcommand*\tablename     {Tabella}
%    \end{macrocode}
%
%    End of the module for the \packlass{\articoletteracdp} class.
%    \begin{macrocode}
%</artico>
%    \end{macrocode}
%
% \section{The code for the \packlass{\adiseal} package}
%
%    This part of the file goes into \filedir{\adiseal.sty}.
%    \begin{macrocode}
%<*adipk>
%    \end{macrocode}
%
%    \subsection{Identification}
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1998/06/01] % LaTeX2e is required!
\ProvidesPackage{adiseal}
              [2005/01/01 v0.33 (development)]
\@ifdefinable\@adiseal{\def\@adiseal{adiseal}}
%    \end{macrocode}
%
%    \subsection{Initial code}
%
%    This segment contains also code that could have been deferred to
%    the Main Code segment, but which is handy to have here, right at
%    the beginning.
%
%    \begin{macro}{\ADIWWW}
%    The web address of ADI-PD is stored in a macro accessible to the
%    user.
%    \begin{macrocode}
\newcommand*\ADIWWW{%
  http://www.math.unipd.it/\string~favero/adipd/%
}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@seal@graph@file}
%    The name of the file which contains the image of the ADI seal is
%    also kept in a macro, to allow customization, but this macro is not
%    made accessible to the user.  Note the image must be contained in a
%    file in Encapsulated PostScript format, and that it should be exactly \(
%    60\,\mbox{bp} \) wide and \( 42\,\mbox{bp} \) tall.
%    \begin{macrocode}
\@ifdefinable\@seal@graph@file{\def\@seal@graph@file{%
  adiseal.eps% must be an Encapsulated PostScript file
}}
%    \end{macrocode}
%    \end{macro}
%
%    The following switch is used to implement the
%    \iopz{nopixmap}\eopz{usepixmap}\fopz\space mutually exclusive
%    options: see subsection~\ref{sS:adisealoptdec} for details.
%    \begin{macrocode}
\@ifdefinable\if@use@pixmap@{\newif\if@use@pixmap@}
%    \end{macrocode}
%
%    \begin{macro}{\@temp@adiseal}
%    A ``scratch'' macro, used as a temporary storage in the sequel.
%    Here, we simply check that this name can be used as a macro name.
%    \begin{macrocode}
\@ifdefinable\@temp@adiseal{}
%    \end{macrocode}
%    \end{macro}
%
%    \subsection{Declaration of options}
%    \label{sS:adisealoptdec}
%
%    The \opz{nopixmap} option inhibits the printing of the seal; more
%    precisely, it prevents the \packlass{\adiseal} package from trying to
%    load the \packlass{\epsfig} package and the file containing the image
%    of the seal.  The \opz{usepixmap} option, on the contrary, tries to load
%    the file containing the image and the \packlass{\epsfig} package,
%    and, if both are succesfully loaded, causes the printing of the seal.
%    Should the \packlass{\epsfig} package or the file containing the image
%    of the seal be unavailable, the \opz{usepixmap} option will be
%    converted to \opz{nopixmap} at package-loading time (actually, it is
%    the "\if@use@pixmap@" switch that will be forced to ``false'').  When,
%    for either reason, the seal is not displayed, a placeholder is printed
%    in its place.
%
%    \begin{macrocode}
\DeclareOption{nopixmap}{\@use@pixmap@false}
\DeclareOption{usepixmap}{\@use@pixmap@true}
%    \end{macrocode}
%
%    \subsection{Option processing}
%
%    We select the \opz{nopixmap} option by default, because the file
%    containing the image of the seal is not included in the C.D.P.
%    Bundle.
%    \begin{macrocode}
\ExecuteOptions{nopixmap}
\ProcessOptions\relax
%    \end{macrocode}
%
%    \subsection{Package loading}
%
%    \begin{macrocode}
\def\@temp@adiseal#1{%
  \@use@pixmap@false
  \PackageWarningNoLine{\@adiseal}{%
    Can't find the #1;\MessageBreak
    option usepixmap ignored (converted to nopixmap).\MessageBreak
    The ADI seal will _not_ be printed%
  }%
}
\if@use@pixmap@
  \IfFileExists{\@seal@graph@file}{%
    \IfFileExists{epsfig.sty}{%
      \RequirePackage{epsfig}%
    }{%
      \@temp@adiseal{epsfig package}%
    }%
  }{%
    \@temp@adiseal{pixel map for the ADI seal}%
  }%
\fi
\let\@temp@adiseal\@undefined
%    \end{macrocode}
%
%    \subsection{Main code}
%
%    Unfortunately, the code is not commented (yet).
%
%    \subsubsection{The two main commands}
%
%    \begin{macrocode}
\@ifdefinable\@seal@box{\def\@seal@box#1{%
  \parbox[t][42bp][c]{60bp}{\centerline{#1}}%
}}
\newcommand*\ADIconcert{\par\noindent
  \emph\concertname
  \ADIaddress
}
\DeclareRobustCommand*\ADIaddress{\par
  \setbox\z@\vtop{%
    \normalfont\normalsize
    \leftline{%
      \vtop{%
        \hbox{%
          \if@use@pixmap@
            \edef\@temp@adiseal{%
              \noexpand\epsfig{file=\@seal@graph@file,%
                height=42bp,width=60bp,clip=}%
            }%
            \@seal@box\@temp@adiseal
            \let\@temp@adiseal\@undefined
          \else
            \setlength\fboxrule{.2pt}%
            \setlength\fboxsep{-\fboxrule}%
            \fbox{\@seal@box\substitutesealname}%
          \fi
        }%
      }%
      \kern\baselineskip
      \vtop{%
        \null\nointerlineskip
        \hbox{%
          \Large ADI%
          \setbox\z@\hbox{\ignorespaces\seatacronym\unskip}%
          \ifdim\wd\z@>\z@
            -\unhbox\z@
          \else
            \unhbox\z@
          \fi
        }%
        \ialign{##\cr
          \spaceskip \fontdimen\tw@\font
            \@plus \@ne fil%
            \@minus \fontdimen4\font
          Associazione Dottorandi e\cr
          Dottori di Ricerca Italiani\cr
        }%
        \hbox{%
          \setbox\z@\hbox{\ignorespaces\seatname\unskip}%
          \ifdim\wd\z@>\z@
            --- \unhbox\z@
          \else
            \unhbox\z@
          \fi
        }%
        \global\dimen@i\prevdepth
      }%
    }%
    \kern\p@
    \prevdepth \dimen@i
    \leftline{\ttfamily\small\ADIWWW}%
    \global\dimen@i\prevdepth
  }%
  \dimen@ \dp\z@
  \advance \dimen@ -\dimen@i
  \dimen@ii .5\baselineskip
  \divide \dimen@ \dimen@ii
  \count@ \dimen@
  \advance \count@ 1
  \dimen@ \dp\z@
  \advance \dimen@ -\count@\dimen@ii
  \box\z@
  \prevdepth\dimen@
}
%    \end{macrocode}
%
%    \subsubsection{Names}
%
%    Note that "\seatacronym" and "\seatname" can also be redefined as
%    empty strings: in this case, the package automatically suppresses
%    some of the surrounding printings that have no meaning when those
%    strings are empty.
%
%    \begin{macrocode}
\newcommand*\concertname       {di concerto con}
\newcommand*\seatacronym       {PD}
\newcommand*\seatname          {Sede di Padova}
\newcommand*\substitutesealname{Logo ADI}
%    \end{macrocode}
%
%    End of the module for the \packlass{\adiseal} package.
%    \begin{macrocode}
%</adipk>
%    \end{macrocode}
%
% \section{The code for the \packlass{\lettcdpadi} class}
%
%    This part of the file goes into \filedir{\lettcdpadi.cls}.
%    \begin{macrocode}
%<*adicl>
%    \end{macrocode}
%
%    The purpose of this file is simply to supply ``glue code'' to 
%    support the legacy \packlass{\lettcdpadi} class.  The document 
%    class is ``redirected'' to \packlass{\letteracdp}, and the 
%    \packlass{\adiseal} package is automatically loaded.  Options are 
%    properly shunted, too.
%
%    It should be time to expunge this file from the Bundle, perhaps 
%    [v0.33], but it is also true that it uses so few 
%    bytes\ldots\space(that is, an entire block of the disk!).
%
%    \subsection{Identification}
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1998/06/01] % LaTeX2e is required!
\ProvidesClass{lettcdpadi}
              [2005/01/01 v0.33 (development)]
%    \end{macrocode}
%
%    \subsection{Initial code}
%
%    This segment is empty in the \packlass{\lettcdpadi} class.
%
%    \subsection{Declaration of options}
%
%    \begin{macrocode}
\DeclareOption{nopixmap} {\PassOptionsToPackage{nopixmap} {adiseal}}
\DeclareOption{usepixmap}{\PassOptionsToPackage{usepixmap}{adiseal}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letteracdp}}
%    \end{macrocode}
%
%    \subsection{Option processing}
%
%    \begin{macrocode}
\ProcessOptions\relax
%    \end{macrocode}
%
%    \subsection{Class and package loading}
%
%    \begin{macrocode}
\LoadClass{letteracdp}[2005/01/01]
\RequirePackage{adiseal}[2005/01/01]
%    \end{macrocode}
%
%    \subsection{Main code}
%
%    This segment is empty in the \packlass{\lettcdpadi} class.
%
%    End of the module for the \packlass{\lettcdpadi} class.
%    \begin{macrocode}
%</adicl>
%    \end{macrocode}
%
% \section{The code for the \packlass{\cdpaddon} package}
%
%    This part of the file goes into \filedir{\cdpaddon.sty}.
%    \begin{macrocode}
%<*addon>
%    \end{macrocode}
%
%    \subsection{Identification}
%
%    Why did I ask for the June 1998 release of \LaTeX?  I don't remember!
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1998/06/01] % LaTeX2e is required!
\ProvidesPackage{cdpaddon}
              [2005/01/01 v0.33 (development)]
\@ifdefinable\@cdpaddon{\def\@cdpaddon{cdpaddon}}
%    \end{macrocode}
%
%    \subsection{Initial code}
%
%    Switches.
%    \begin{macrocode}
\def\do#1{\@ifdefinable#1{\newif#1}}
\do\if@using@cdp@
\do\if@use@color@
\do\if@use@hyper@
%    \end{macrocode}
%
%    \begin{macro}{\@cdpaddon@printer}
%    Below, we shall store in this macro the name (without the extension
%    \filedir{.def}) of the definition file from which to read the
%    definitions of the colors for the C.D.P.  seal.  It is needed only
%    during the initialization of the package, and it is "\@undefined"
%    before the end.  If it is empty, the emergency colors will be used:
%    we make this the default.
%    \begin{macrocode}
\@ifdefinable\@cdpaddon@printer{\let\@cdpaddon@printer\@empty}
%    \end{macrocode}
%    \end{macro}
%
%    ``Scratch'' macros, will be re-used in the sequel.
%    \begin{macrocode}
\@ifdefinable\@temp@cdpaddon@a{}
\@ifdefinable\@temp@cdpaddon@b{}
%    \end{macrocode}
%
%    Here is a first use of those ``scratch'' macros.
%    \begin{macrocode}
\def\@temp@cdpaddon@a{%
  \@using@cdp@false
  \PackageWarningNoLine{\@cdpaddon}{%
    It seems that you are not using the letteracdp\MessageBreak
    document class; therefore no attempt will be made\MessageBreak
    to modify letterheads and similar things%
  }%
}
\def\@temp@cdpaddon@b{letteracdp}
%    \end{macrocode}
%    Double check to be absolutely sure that the \packlass{\letteracdp}
%    class is loaded.
%    \begin{macrocode}
\@ifclassloaded{\@temp@cdpaddon@b}{%
  \ifx\@letteracdp\@temp@cdpaddon@b
    \@using@cdp@true
  \else
    \@temp@cdpaddon@a
  \fi
}{%
  \@temp@cdpaddon@a
}
%    \end{macrocode}
%
%    \subsection{Declaration of options}
%
%    The following macro is needed to strip the prefix \opz{printer:}\
%    from the option that selects which color definition file to load.
%    Again, we use one of the ``scratch'' macro to save memory (the other
%    ``scratch'' macro is used as well inside).
%    \begin{macrocode}
\def\@temp@cdpaddon@a#1printer:#2,#3@@@{%
  \def\@temp@cdpaddon@b{#1}%
  \ifx\@temp@cdpaddon@b\@empty
    \def\@cdpaddon@printer{#2}%
  \else
    \@unknownoptionerror
  \fi
}
\DeclareOption{bw}{\@use@color@false}
\DeclareOption{color}{\@use@color@true}
\DeclareOption{hypertext}{\@use@hyper@true}
\DeclareOption{plaintext}{\@use@hyper@false}
%    \end{macrocode}
%    The purpose of the following ``catch-all'' option is to intercept
%    a \opz{printer:}\ldots\ option requesting a color definition file.
%    \begin{macrocode}
\DeclareOption*{%
  \expandafter\@temp@cdpaddon@a\CurrentOption,printer:,@@@%
}
%    \end{macrocode}
%
%    \subsection{Option processing}
%
%    \begin{macrocode}
\ExecuteOptions{color,plaintext}
\ProcessOptions\relax
%    \end{macrocode}
%    If the \opz{printer:Default} option has been specified, we want
%    the same behavior as if no \opz{printer:}\ldots\ option had been
%    specified at all.
%    \begin{macrocode}
\def\@temp@cdpaddon@a{Default}
\ifx\@cdpaddon@printer\@temp@cdpaddon@a
  \let\@cdpaddon@printer\@empty
\fi
%    \end{macrocode}
%
%    \subsection{Package loading}
%
%    \begin{macrocode}
\def\@temp@cdpaddon@a#1#2#3#4#5{%
  \IfFileExists{#1.sty}{%
    \RequirePackage[#2]{#1}%
  }{%
    \@nameuse{@use@#3@false}
    \PackageWarningNoLine{\@cdpaddon}{%
      Can't find the #1 package;\MessageBreak
      option #4 ignored (converted to #5)%
    }%
  }%
}
\if@use@color@
  \@temp@cdpaddon@a{color}{}{color}{color}{bw}
\fi
\if@use@hyper@
  \@temp@cdpaddon@a{hyperref}{}{hyper}{hypertext}{plaintext}
\fi
%    \end{macrocode}
%
%    \subsection{Main code}
%
%    Unfortunately, the code is only sparsely commented (at the moment).
%
%    \subsubsection{Redefinition of the seal, etc.}
%
%    The following macro is used to draw in color the thin, small line
%    that, when the page needs to be folded, indicates where to fold it.
%    We need to define it here, outside of the conditionals, and to
%    assign it later to "\@folding@tag" using "\let" (see below) because
%    it contains a "\fi" (mumble grumble\ldots).
%    \begin{macrocode}
\@ifdefinable\@back@folding@tag{\def\@back@folding@tag{%
  \if@do@fold@
    \raisebox{\@lh@folding@ht}[\z@][\z@]{%
      \makebox[\z@][l]{%
        \color{strong@col}%
        \dimen@ -\@lh@right@margin
        \advance\dimen@ 1cm%
        \kern\dimen@ \vbox{%
          \kern -.1\p@
          \hrule \@height .1\p@ \@depth .1\p@ \@width 5mm%
          \kern -.1\p@
        }%
      }%
    }%
  \fi
}}
%    \end{macrocode}
%
%    If the \packlass{\letteracdp} class is loaded\ldots
%    \begin{macrocode}
\if@using@cdp@
%    \end{macrocode}
%    \ldots then we can try to replace the macros that draw the seal,
%    etc.; but we want to perform the redefinition (if and) only if the
%    macro is already defined, and rise an error otherwise.  To ease this
%    task, we define the ``scratch'' macro "\@temp@cdpaddon@a" in such a
%    way that "\@temp@cdpaddon@a{"\meta{name}"}{"\meta{code}"}" rises an
%    error if \meta{name} is undefined, and executes \meta{code}
%    otherwise.  It is intended that \meta{code} is the code that does the
%    actual redefinition.  Note that \meta{name} must be indicated
%    \emph{without} the backslash.  Note also that it is not necessary to
%    put in a second parameter for \meta{code}: simply, "{"\meta{code}"}"
%    will become the third parameter of "\@ifundefined".
%    \begin{macrocode}
  \def\@temp@cdpaddon@a#1{%
    \@ifundefined{#1}{%
      \PackageError\@cdpaddon{%
        Internal command \@backslashchar#1 undefined%
      }{%
        The internal command \@backslashchar#1,
        that should have been defined\MessageBreak
        by the \@letteracdp\space document class,
        is actually undefined.\MessageBreak
        Probably, you are using an old or modified version
        of that class.\MessageBreak
        Proceed, but some of the colors won't come out right.%
      }%
    }%
  }
%    \end{macrocode}
%
%    We first take care of color.  Did the user request colors?
%    \begin{macrocode}
  \if@use@color@
%    \end{macrocode}
%    Yes?  Well, in that case, we try to load the file that defines
%    the hues.  First of all, see whether the user selected a color
%    definition file.
%    \begin{macrocode}
    \ifx\@cdpaddon@printer\@empty
%    \end{macrocode}
%    If not (\("\@cdpaddon@printer"="\@empty"\)), then we must read the
%    config.\ file.  Before doing this, we define the "\DeclareCDPSealHuesDefault"
%    command, in a somewhat tricky way: we begin a group, thereby making
%    a local definition, but we put the "\endgroup" in the replacement text
%    of the macro itself.  This is quite OK, because once the macro has
%    been expanded, we no longer need its definition!  We must foresee
%    the case in which the configuration file does not contain any
%    "\DeclareCDPSealHuesDefault" command at all.  For this, we use
%    another hack: we "\let" "\@temp@cdpaddon@b" equal to "\endgroup"
%    \emph{inside} the group, but to "\@empty" outside of it.  Then we call it:
%    if the group has already ended, nothing happens, otherwise the group
%    is ended now.
%    \begin{macrocode}
      \let\@temp@cdpaddon@b\@empty
      \begingroup % \endgroup put in by \@temp@cdpaddon@b
      \let\@temp@cdpaddon@b\endgroup
      \InputIfFileExists{cdpshues.cfg}{%
        \PackageInfo{\@cdpaddon}{%
          Reading config. file%
        }%
%    \end{macrocode}
%    \begin{macro}{\DeclareCDPSealHuesDefault}
%    This command is defined in such a way that it not only ends the group,
%    but also stops reading from the file.
%    \begin{macrocode}
        \def\DeclareCDPSealHuesDefault{%
          \@temp@cdpaddon@b % ends group
          \endinput
%    \end{macrocode}
%    \end{macro}
%    The argument to "\DeclareCDPSealHuesDefault" will become the
%    replacement text of the following "\def".
%    \begin{macrocode}
          \def\@cdpaddon@printer
        }%
      }{%
        \PackageWarningNoLine{\@cdpaddon}{%
          Could not find config. file for default printer%
        }%
      }%
%    \end{macrocode}
%    The following is part of the hack to end the group if it has not
%    already ended.
%    \begin{macrocode}
      \@temp@cdpaddon@b
%    \end{macrocode}
%    We now check if the user specified the \opz{printer:None} option;
%    if so, we take the same action that would result from an empty
%    configuration file.
%    \begin{macrocode}
    \else
      \def\@temp@cdpaddon@b{None}%
      \ifx\@cdpaddon@printer\@temp@cdpaddon@b
        \let\@cdpaddon@printer\@empty
      \fi
%    \end{macrocode}
%    End of things to do when no \opz{printer:}\ldots\ option has been
%    specified.
%    \begin{macrocode}
    \fi
%    \end{macrocode}
%    OK, now we have the name of the color definition file in
%    "\@cdpaddon@printer", and we have to load it.  The following are the
%    actions to take when the file cannot be found or when
%    "\@cdpaddon@printer" is still empty (\emph{e.g.,} because no
%    config.\ file was found, or because it was void): use emergency
%    definitions and issue a warning.  We save them in a ``scratch''
%    macro because we need them twice~(!).
%    \begin{macrocode}
    \def\@temp@cdpaddon@b{%
      \definecolor{slight@col}{named}{SpringGreen}
      \definecolor{strong@col}{named}{OliveGreen}
      \PackageInfo{\@cdpaddon}{%
        Color hues defined internally%
      }%
      \typeout{%
        *Package cdpaddon using built-in colors for the C.D.P. seal.*%
      }%
    }
%    \end{macrocode}
%    We finally try to load the color definition file.
%    \begin{macrocode}
    \ifx\@cdpaddon@printer\@empty
      \@temp@cdpaddon@b
    \else
      \InputIfFileExists{\@cdpaddon@printer.def}{%
        \PackageInfo{\@cdpaddon}{%
          Color hues defined by def. file\MessageBreak
          \@cdpaddon@printer.def%
        }%
      }{%
        \PackageWarningNoLine{\@cdpaddon}{%
          Could not find def. file \@cdpaddon@printer.def%
        }%
        \@temp@cdpaddon@b
      }%
    \fi
%    \end{macrocode}
%
%    We define another handy subroutine.  Given the name \meta{boxname}
%    of an hbox, "\@temp@cdpaddon@b{"\meta{boxname}"}" causes a
%    "\color{strong@col}" declaration to be added at the beginning of
%    "\"\meta{boxname}, properly contained in a group to assure that the
%    "\special" for restoring the previous colors is included in the box too.
%    We use this method of setting and resetting the color inside the
%    individual boxes because the one used in the previous versions, of
%    setting the color once for all at the beginning of "\@cdp@head", did
%    not seem to work properly with pdf\TeX.
%    \begin{macrocode}
    \def\@temp@cdpaddon@b#1{%
      \@temp@cdpaddon@a{#1}{%
        \setbox\z@\box\@nameuse{#1}%
        \sbox{\@nameuse{#1}}{{\color{strong@col}\unhbox\z@}}%
      }%
    }
%    \end{macrocode}
%
%    Actual redefinition of macros begins here.
%
%    \begin{macro}{\@folding@tag}
%    First, install the redefinition of "\@folding@tag" that we had
%    prepared in advance.
%    \begin{macrocode}
    \@temp@cdpaddon@a{@folding@tag}{%
      \let\@folding@tag\@back@folding@tag
    }
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\@logo@box@base}
%    \changes{0.32}{2002 Jul 01}{Eliminated an awful bug introduced with
%      version 0.31 (a conditional that could not appear at this spot)}
%    Color the main part of the seal.
%    \begin{macrocode}
    \@temp@cdpaddon@a{@logo@box@base}{%
      \savebox\@logo@box@base[\z@][r]{\setlength\unitlength{.625mm}%
        \begin{picture}(32,16)(-3,7.87)%
%    \end{macrocode}
%    I don't remember exactly what this group was for.  Eliminate?
%    \begin{macrocode}
          \begingroup
%    \end{macrocode}
%    Draw the inner of the~``D'' and of the~``P'', in the slight color.
%    \begin{macrocode}
            \color{slight@col}%
%    \end{macrocode}
%    Try to draw two filled circles of the right size to fill up the
%    inner of the two letters.  If the target system happens to have 
%    sufficiently large filled circles, this will suffice.
%    \begin{macrocode}
            \put(8,16){\circle*{10}}%
            \put(18,16){\circle*{10}}%
%    \end{macrocode}
%    With the standard set of fonts, however, the above request can not
%    be honored, and the two circles we have just obtained are a little
%    too small; so, we finish them by adding arcs of circumference of
%    increasing size, drawn in thick lines.
%    \begin{macrocode}
            \thicklines
            \put(8,16){\oval(8.2,8.2)[l]}%
            \put(8,16){\oval(8.6,8.6)[l]}%
            \put(8,16){\oval(9,9)[l]}%
            \put(8,16){\oval(9.4,9.4)[l]}%
            \put(8,16){\oval(9.8,9.8)[l]}%
            \put(18,16){\oval(8.2,8.2)[r]}%
            \put(18,16){\oval(8.6,8.6)[r]}%
            \put(18,16){\oval(9,9)[r]}%
            \put(18,16){\oval(9.4,9.4)[r]}%
            \put(18,16){\oval(9.8,9.8)[r]}%
%    \end{macrocode}
%    Now erase the inner half of the two circles.
%    \begin{macrocode}
            \put(13,16){\makebox(0,0){\color{white}%
              \vrule height 6.25mm depth 0mm width 6.25mm
            }}%
%    \end{macrocode}
%    Draw the vertical part of the two letters.
%    \begin{macrocode}
            \put(9,11){\makebox(0,0)[bl]{%
              \vrule height 12.5mm depth 0mm width 1.875mm
            }}%
            \put(14,1){\makebox(0,0)[bl]{%
              \vrule height 12.5mm depth 0mm width 1.875mm
            }}%
          \endgroup
%    \end{macrocode}
%    Now redraw the outer strokes of the~``D'' and of the~``P'' in the
%    strong color.
%    \begin{macrocode}
          \color{strong@col}%
          \put(8,16){\oval(10,10)[l]}%
          \put(8,11){\line(0,1){10}}%
          \put(9,11){\framebox(3,20){}}%
          \put(18,16){\oval(10,10)[r]}%
          \put(18,11){\line(0,1){10}}%
          \put(14,1){\framebox(3,20){}}%
%    \end{macrocode}
%    The strokes of the~``C'' are thick.
%    \begin{macrocode}
          \thicklines
          \put(8,16){\oval(16,16)[l]}%
          \put(8,8){\line(1,0){5}}%
          \put(13,24){\line(1,0){10}}%
          \put(8,16){\oval(14,14)[l]}%
          \put(8,9){\line(1,0){5}}%
          \put(13,23){\line(1,0){10}}%
        \end{picture}%
      }%
    }
%    \end{macrocode}
%    \end{macro}
%    Coloring the other parts of the seal is easier: just add the color
%    declaration to the various boxes, to the rule in the head, and to the
%    whole footer.
%    \begin{macrocode}
    \@temp@cdpaddon@b{@logo@box@addS}
    \@temp@cdpaddon@b{@logo@box@addL}
    \@temp@cdpaddon@b{@oordinamento@box}
    \@temp@cdpaddon@a{@cdp@head}{\def\@cdp@head{%
      \@logo@overlay\@logo@box@addL
      \copy\@oordinamento@box
      {\color{strong@col}\hrulefill}\kern\@lh@right@margin
    }}
    \@temp@cdpaddon@a{@cdp@foot}{\def\@cdp@foot{%
      \color{strong@col}%
      \reset@font
      \setlength\@tempdima{\textwidth}%
      \addtolength\@tempdima{-2\@lh@right@margin}%
      \hss\parbox[t]{\@tempdima}{%
        \parfillskip\z@skip
        \noindent\hrulefill\@@par
        \baselineskip 11\p@
        \hb@xt@\hsize{\hfil\copy\@name@and@WWW@box\hfil}%
      }\hss
    }}
  \fi
%    \end{macrocode}
%
%    We now deal with hyperlinks.  If the user requested them\ldots
%    \begin{macrocode}
  \if@use@hyper@
%    \end{macrocode}
%    \ldots well, we take care of them.  The precompilation of the footer
%    must be deferred until the "\begin{document}" hook, because the macros
%    of the \packlass{hyperref} package are not available for actual
%    typesetting until that moment.  Note that we just need to encapsulate
%    the web address of the \emph{Coordinamento} into an "\href" command:
%    the color-switching command has already been given above, inside the
%    "\@cdp@foot" box (the color must be changed independently from the use
%    of hyperlinks).
%    \begin{macrocode}
    \AtBeginDocument{%
      \@temp@cdpaddon@a{@name@and@WWW@box}{%
        \setbox\@name@and@WWW@box = \vtop{%
          \baselineskip 11\p@
          \hb@xt@\z@{\hss \@lh@rm\Coordinamento \hss}%
          \hb@xt@\z@{%
            \hss
            \@lh@it World Wide Web:\/
            \href{\CoordinamentoWWW}{\@lh@tt \CoordinamentoWWW}%
            \hss
          }%
        }%
      }%
%    \end{macrocode}
%    Of course, in this case we cannot release the "\@temp@cdpaddon@a"
%    macro until the "\begin{document}" hook, too.
%    \begin{macrocode}
      \let\@temp@cdpaddon@a\@undefined
    }
%    \end{macrocode}
%    The following line informs the \packlass{\hyperref} package that the
%    bookmark level for paragraphs should be~2.
%    \begin{macrocode}
    \def\toclevel@paragraph{2}
%    \end{macrocode}
%    If hyperlinks are not requested, we can release "\@temp@cdpaddon@a"
%    right now.
%    \begin{macrocode}
  \else
    \let\@temp@cdpaddon@a\@undefined
  \fi
%    \end{macrocode}
%
%    We can do the same thing if the \packlass{\letteracdp} class is
%    not loaded.
%    \begin{macrocode}
\else
  \let\@temp@cdpaddon@a\@undefined
\fi
%    \end{macrocode}
%
%    The memory taken by the following ``scratch'' macros can be freed
%    in any case.
%    \begin{macrocode}
\let\if@using@cdp@\@undefined
\let\@using@cdp@true\@undefined
\let\@using@cdp@false\@undefined
\let\if@use@color@\@undefined
\let\@use@color@true\@undefined
\let\@use@color@false\@undefined
\let\if@use@hyper@\@undefined
\let\@use@hyper@true\@undefined
\let\@use@hyper@false\@undefined
\let\@back@folding@tag\@undefined
\let\@cdpaddon@printer\@undefined
\let\@temp@cdpaddon@b\@undefined
%    \end{macrocode}
%
%    \subsubsection{Smiling faces}
%
%    \begin{macro}{\facesmile}
%    \begin{macro}{\facefrown}
%    These commands produce happy or sad ``faces''.  They are made
%    ``transparent'' to the "\spacefactor", just like parentheses
%    (the "\spacefactor" is saved in "\count@").
%    \begin{macrocode}
\DeclareRobustCommand*{\facesmile}{\@face\smile}
\DeclareRobustCommand*{\facefrown}{\@face\frown}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@face}
%    The low-level command that draws the face ("\bigcirc"), the eyes, and
%    the mouth: the latter is passed as an argument, so it can be a
%    "\smile" or a "\frown".
%    \begin{macrocode}
\@ifdefinable\@face{\def\@face#1{%
  \leavevmode
  \count@\spacefactor
  \hb@xt@ 1em{\hfil$%
    \hb@xt@\z@ {\hss$\bigcirc$\hss}%
    \lower .2ex \hb@xt@\z@ {\hss$\scriptscriptstyle #1$\hss}%
    \raise .3ex \hb@xt@\z@ {\hss${\cdot}\mkern 2mu{\cdot}$\hss}%
  $\hfil}%
  \spacefactor\count@
}}
%    \end{macrocode}
%    \end{macro}
%
%    End of the module for the \packlass{\cdpaddon} package.
%    \begin{macrocode}
%</addon>
%    \end{macrocode}
%
% \section{Definition and configuration files}
%
%    This section contains the ancillary files (definition and
%    configuration files) used by the \packlass{\cdpaddon} package.
%
%    \subsection{The \filedir{\example} file}
%
%    This part of the file goes into the prototype definition file
%    \filedir{\example}.  All comments are left in the code because this
%    file is intended as an example of how to write color definition files
%    for the \packlass{\cdpaddon} package.
%    \begin{macrocode}
%<*example>
%%%
%%% The "\ProvidesFile" command allows LaTeX to check the name and
%%% the release date of the file; if either differs from what the
%%% user requested, a warning is issued when the file is loaded.
%%% This helps to pinpoint old files as well as files which have been
%%% installed incorrectly.  It is not mandatory to include this
%%% command in a file, and you can omit it from your definition files
%%% if you want (but including it is more elegant); however, if you do
%%% leave this command in your definition files, you should modify
%%% both its mandatory and its optional argument so that they reflect
%%% the name and the release date, respectively, of your file.
%%% Note that the extension ".def" must be included in the file name,
%%% and that the date is in the format YYYY/MM/DD.
\ProvidesFile{cdpshues-example.def}[2005/01/01 Printer-dependent file]
%%%
%%% Define here the colors to use to draw the C.D.P. seal;
%%% "slight@col" is the color used to paint the inner of the D and
%%% of the P, "strong@col" is the color used to draw the lines.
%%% The colors are defined by means of the usual "\definecolor"
%%% command, which is part of the standard color package.  The colors
%%% defined here, of course, are just a silly example.
\definecolor{slight@col}{named}{SpringGreen}
\definecolor{strong@col}{named}{OliveGreen}
%</example>
%    \end{macrocode}
%
%    \subsection{The \filedir{\epson} file}
%
%    This part of the file goes into the definition file
%    \filedir{\epson}.
%    \begin{macrocode}
%<*epson>
\ProvidesFile{epson-stylus-740.def}[2005/01/01 Printer-dependent file]
\definecolor{slight@col}{rgb}{.8,1,.8}
\definecolor{strong@col}{rgb}{0,.266667,0}
%</epson>
%    \end{macrocode}
%
%    \subsection{The \filedir{\hplj} file}
%
%    This part of the file goes into the definition file \filedir{\hplj}.
%    \begin{macrocode}
%<*hplj>
\ProvidesFile{hp-laserjet-4500.def}[2005/01/01 Printer-dependent file]
\definecolor{slight@col}{cmyk}{.1,0,.1,0}
\definecolor{strong@col}{cmyk}{.5,0,.5,.5}
%</hplj>
%    \end{macrocode}
%
%    \subsection{The \filedir{\cdpshues} file}
%
%    This part of the file goes into the configuration file
%    \filedir{\cdpshues}.  Again, we leave all comments in the generated
%    file because they are meant to help the final user to modify the file.
%    \begin{macrocode}
%<*config>
%%%
%%% The argument of the "\DeclareCDPSealHuesDefault" command contains
%%% the name (w/o extension) of the default color definition file:
\DeclareCDPSealHuesDefault{cdpshues}

====================
EXPLANATORY COMMENTS
====================

This file is special in that the cdpaddon package stops reading it as
soon as it encounters the first "\DeclareCDPSealHuesDefault" command:
all subsequent lines are ignored, and can hence contain explanatory
comments, just like these.  To save disk space (although, in this era
of gigabytes, this is not a compelling issue!), you can, if you want,
delete all lines in this file except the one which contains the first
occurrence of a "\DeclareCDPSealHuesDefault" command (12 lines above);
but if you do so, please be sure to read them before deleting them!
(Anyway, I think it is a good idea to leave the comments in place.)

The "\DeclareCDPSealHuesDefault" command has one argument, in which
you should put the name of a default file from which the definitions
of the hues for the C.D.P. seal are read when no other file has been
indicated in the options passed to the cdpaddon package.  Note that
the extension ".def" is automatically added to the name; therefore,
you **must** leave it out in the name given as the argument of the
"\DeclareCDPSealHuesDefault" command.

The C.D.P. Bundle comes with some definition files already included;
their names are listed below, without the extension ".def" (each one
is packaged in a "\DeclareCDPSealHuesDefault" command):

\DeclareCDPSealHuesDefault{cdpshues-example}
\DeclareCDPSealHuesDefault{epson-stylus-740}
\DeclareCDPSealHuesDefault{hp-laserjet-4500}

To make one of these files the default one, copy (or move) the line
containing its name to the top of the file, so that its becomes the
first line (yes, even above the opening comments, those four dozens
lines starting with "%%": let us keep things easy!).

If you write a new definition file, you can make it the default by
writing a similar "\DeclareCDPSealHuesDefault" command and putting it
in the first line of this file (above the opening comments, why not).
Remember that only the first such command appearing in this file is
taken into consideration: all subsequent lines are ignored.

%</config>
%    \end{macrocode}
%
% \section{End of input}
%
%    The usual "\endinput" which prevents the \DS\ program from putting
%    garbage into the generated files.
%    \begin{macrocode}
\endinput
%    \end{macrocode}
%
% \Finale
%
