diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/cdpbundl/cdpbundl.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/cdpbundl/cdpbundl.dtx | 876 |
1 files changed, 645 insertions, 231 deletions
diff --git a/Master/texmf-dist/source/latex/cdpbundl/cdpbundl.dtx b/Master/texmf-dist/source/latex/cdpbundl/cdpbundl.dtx index e74d31c7c6d..01d80c3291d 100644 --- a/Master/texmf-dist/source/latex/cdpbundl/cdpbundl.dtx +++ b/Master/texmf-dist/source/latex/cdpbundl/cdpbundl.dtx @@ -5,7 +5,7 @@ % % This file is part of a work named "C.D.P. Bundle". % -% Copyright (C) 1999-2005 by Gustavo MEZZETTI <mezzetti@math.unipd.it>. +% Copyright (C) 1999-2006 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 @@ -31,10 +31,12 @@ % \fi % % \def\filename{cdpbundl.dtx} -% \def\fileversion{0.33} -% \def\filedate{2005/01/01} -% \def\docdate {2005/01/01} -% \def\doclongdate{January~1, 2005} +% \def\fileversion{0.34} +% \def\filedate{2006/01/01} +% \def\docdate {2006/01/01} +% \def\doclongdate{January~1, 2006} +% +% \CheckSum{4829} % % \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} @@ -45,8 +47,13 @@ % \protect\packlass{\protect\articoletteracdp} class and of the % \protect\packlass{\protect\cdpaddon} package to make it compatible % with the \protect\packlass{\protect\hyperref} package} +% \changes{0.34}{2006 Jan 01}{Improved interaction with the +% \protect\packlass{\protect\hyperref} package} +% \changes{0.34}{2006 Jan 01}{Corrected positioning of floats +% in float pages} +% \changes{0.34}{2006 Jan 01}{Added \protect\texttt{\protect\bslash place} +% command} % -% \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 @@ -73,7 +80,7 @@ % \DoNotIndex{\setlength,\setcounter,\addtolength} % \DoNotIndex{\expandafter,\do,\relax,\advance,\multiply,\divide} % \DoNotIndex{\DeclareOption,\ExecuteOptions,\ProcessOptions} -% \DoNotIndex{\",\.\@} +% \DoNotIndex{\",\.,\@} % % \IndexPrologue{ % \section{\indexname} @@ -81,6 +88,7 @@ % is described, the ones underlined to the code line of the % definition, the rest to the code lines where the entry is used. % } +% \setcounter{IndexColumns}{2} % % \GlossaryPrologue{\section{Change History}} % @@ -117,6 +125,9 @@ % \newcommand*{\fopz}{$} % \newcommand*{\packlass}[1]{{\normalfont\ttfamily #1}} % \newcommand*{\filedir}[1]{{\normalfont\ttfamily #1}} +% \newcommand*{\env}[1]{{\normalfont\ttfamily #1}} +% \newcommand*{\cnt}[1]{{\normalfont\ttfamily #1}} +% \newcommand*{\sty}[1]{{\normalfont\ttfamily #1}} % \newcommand*{\eqref}[1]{(\ref{#1})} % % \DeclareFixedFont{\lhnss}{OT1}{cmss}{m}{n} {12} @@ -131,7 +142,7 @@ % 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 +% Copyright \copyright~1999--2006 by G.~Mezzetti % (see page~\pageref{S:Copy}).} % } % \author{G. Mezzetti} @@ -164,7 +175,7 @@ % \label{S:Copy} % \vspace{-\parskip} % -% Copyright \copyright~1999--2005 by Gustavo \textsc{Mezzetti}. All +% Copyright \copyright~1999--2006 by Gustavo \textsc{Mezzetti}. All % rights are reserved, except as noted below. % % This document has been produced by feeding to a \LaTeX\ typesetting @@ -255,13 +266,13 @@ % 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. +% but they can do 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 +% went through so many deep revisions, that by now it retains % 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 @@ -294,7 +305,7 @@ % 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, +% part, however, specifies to what extent, and under what conditions, % you are allowed to use and distribute the classes and packages % presented in this document. % @@ -389,7 +400,7 @@ % 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 +% seal. This happens because different printers may render color hues % in different ways, sometimes producing surprising results. % % The configuration mechanism works as follows. For each printer @@ -407,12 +418,12 @@ % % 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). +% 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 +% the \textsl{\LaTeX book} \cite[Section~7.3 and +% Subsection~C.14.3]{LaTeXbook} for information on colors and the % "\definecolor" command. % % The file \filedir{\example}, too, contains comments which explain @@ -481,7 +492,7 @@ % % 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 +% may 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 @@ -489,10 +500,10 @@ % 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: +% The \filedir{\cdpshues} file included in the C.D.P. Bundle contains +% comments that help you to modify it in order to declare your +% personal default color definition file. The recommended way of +% doing this is: % \begin{enumerate} % ^^A ( paren match % \renewcommand*{\labelenumi}{\theenumi)} @@ -546,15 +557,18 @@ % 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! +% seal in a file in Encapsulated PostScript (EPS) format called +% \filedir{\adiseal.eps}, unless PDF output is being generated, in +% which case a file in Portable Document Format (PDF) named +% \filedir{adiseal.pdf} is searched for instead. 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 whether a file you have got 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 @@ -636,11 +650,13 @@ %\address{ % Revinu~J. \textsc{Drofnats}\\ % Department of Farm Ecology\\ -% University of St.\thinspace Anford\\ +% University of St.\,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 +%\signature{R.~J. Drofnats\\Professor} +%\date{January~1, 2006} % as usual, date is optional, default is \today +%% Place where the letter is written (optional): +%\place{St.\,Anford} % %% Since we are writing in English, we redefine a couple of words: %\renewcommand*{\subjectname}{Subject:} @@ -661,9 +677,7 @@ % 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,} +%\opening{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 @@ -831,10 +845,10 @@ % % \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 +% only the standard \LaTeX\ fonts, so that the output is 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 +% PostScript commands: this improves 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 @@ -972,11 +986,6 @@ \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". @@ -986,8 +995,8 @@ % 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 +\hfuzz = 0pt +\vfuzz = 0pt % \end{macrocode} % Now input this same file, using \DS\ conventions. % \begin{macrocode} @@ -1040,12 +1049,12 @@ % will eventually be removed, I hope! % \begin{macrocode} \ProvidesClass{letteracdp} - [2005/01/01 v0.33 (**incomplete**)] + [2006/01/01 v0.34 (**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, +\typeout{Copyright (C) 1999-2006 by Gustavo MEZZETTI, all rights reserved.} % \end{macrocode} % @@ -1063,9 +1072,9 @@ % \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}: +% Define the following macros near the beginning of the code, so it +% will be easy to change them. The first one is the full name of the +% \emph{Coordinamento}: % \begin{macrocode} \newcommand*\Coordinamento{% Coordinamento dei Dottorandi e dei Dottori di Ricerca @@ -1074,7 +1083,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\CoordinamentoWWW} -% The second is its web address: +% The second one is its web address: % \begin{macrocode} \newcommand*\CoordinamentoWWW{% http://www.dei.unipd.it/\string~assdott/% @@ -1191,7 +1200,7 @@ % \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 +% The \cnt{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. @@ -1200,37 +1209,37 @@ % \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 +% 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: \cnt{addrlabelrows} holds +% the number of rows % \begin{macrocode} \newcounter{addrlabelrows} % \end{macrocode} % \counterindex{addrlabelcolumns} -% and \texttt{addrlabelcolumns} holds the number of columns. +% and \cnt{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 +% The \cnt{addrlabelrows} and \cnt{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 +% (\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 \cnt{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 +% while the \cnt{totallabel} counter holds the global index of a % label, that is, the index of the label in the whole document. % \begin{macrocode} \newcounter{totallabel} @@ -1351,24 +1360,24 @@ % 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, +% a paper format, like A5, that normally does not allow them. 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 +% 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. +% 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 checks 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} @@ -1684,6 +1693,15 @@ \do\@signature@style % \end{macrocode} % \end{macro} +% \begin{macro}{\@place} +% The place where the letter is written: starting from version~0.34, +% this macro is used as the default value for the optional argument of +% "\@makeopening", "\makedate", etc. It is logically and functionally +% analogous to "\@date". +% \begin{macrocode} +\do\@place +% \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 @@ -1711,7 +1729,7 @@ % \end{macrocode} % \end{macro} % -% The following macros are defined only inside a \texttt{subject} +% The following macros are defined only inside a \env{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 @@ -1750,9 +1768,8 @@ % 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. +% This is the penalty inserted at the beginning of a \env{sender} +% environment---the environment used to typeset the sender address. % \begin{macrocode} \do\@b@frompenalty % \end{macrocode} @@ -1765,7 +1782,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\@e@frompenalty} -% This is the penalty inserted at the end of a \texttt{sender} +% This is the penalty inserted at the end of a \env{sender} % environment. % \begin{macrocode} \do\@e@frompenalty @@ -1773,7 +1790,7 @@ % \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 +% \env{addressee} environment---the environment used to typeset the % addressee address. % \begin{macrocode} \do\@b@topenalty @@ -1787,21 +1804,21 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\@e@topenalty} -% This is the penalty inserted at the end of an \texttt{addressee} +% This is the penalty inserted at the end of an \env{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} +% This is the penalty inserted at the beginning of a \env{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} +% This is the penalty inserted at the end of a \env{subject} % environment. % \begin{macrocode} \do\@e@subjpenalty @@ -1871,24 +1888,24 @@ % 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. +% part that appears both in the \ldots\sty{letterhead} and in the +% \sty{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. +% part contained in "\@logo@box@base" to obtain the seal as it appears +% in the \sty{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. +% part contained in "\@logo@box@base" to obtain the seal embedded +% in the \ldots\sty{letterhead} page styles. % \begin{macrocode} \newsavebox\@logo@box@addL % \end{macrocode} @@ -1902,10 +1919,10 @@ % \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. +% This holds the footer used in the \sty{firstletterhead} and +% \sty{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} @@ -1915,14 +1932,14 @@ % 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 +% to expand the token "\and" anywhere but inside the \env{sender}, +% \env{addressee}, and \env{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 +% 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} @@ -1933,9 +1950,9 @@ % 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, +% Only inside an \env{addressee} environment, the token "\andcc" may +% 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}} @@ -1971,7 +1988,7 @@ % 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. +% current \ldots\env{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 @@ -1996,8 +2013,8 @@ %\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 +% inside an \env{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 @@ -2007,9 +2024,9 @@ % 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. +% 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} @@ -2025,9 +2042,7 @@ % 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). +% "\subjectnamegap" space is not taken into account. % \begin{macrocode} \newcommand*\subjectnamegap{.5em} % \end{macrocode} @@ -2059,12 +2074,12 @@ % 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 +% \env{signatureenv} environment (the environment one uses to typeset +% the signature); it is the responsability of the surrounding +% \ldots\env{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 +% an \env{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. @@ -2322,6 +2337,11 @@ % \subsection{Option processing} % % Nothing special to note here. +% +% \emph{Begin to think (v.~0.34):} should I change the defaults as +% follows: \opz{boldsubject} in place of \opz{mediumsubject}, +% \opz{italicsignature} in place of \opz{uprightsignature}, +% \opz{shortindent} in place of \opz{indent}? % \begin{macrocode} \ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,% mediumsubject,uprightsignature,noPS,indent,105x37labels} @@ -2343,9 +2363,8 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \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. +% If the \packlass{eepic} package is not available, force the switch +% to false and warn the user. % \begin{macrocode} \IfFileExists{eepic.sty}{% \RequirePackage{eepic}% @@ -2369,27 +2388,40 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % % \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! +% Some of the following initializations could have been put in the +% \emph{Initial code} section, but some others require that the code +% for the options have already been executed. % % \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). +% 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 other ones. Since "\date" is a kernel +% command, an explicative comment is left in % the code too. % \begin{macrocode} %% Command \date redefined to make changes to date local. \def\date#1{\def\@date{#1}} % \end{macrocode} % \end{macro} % +% \begin{macro}{\place} +% This command records the place where the letter is written (added +% in version~0.34): it is analogous to "\date". Starting from +% version~0.34, this should be used instead of the optional argument +% of "\opening", "\makedate", etc.\ (however, the optional argument of +% those commands may still be used, for compatibility). Note that the +% comma is added automatically, but only if the argument of "\place" +% is nonempty. +% \begin{macrocode} +\newcommand*\place[1]{% + \ifx \@empty #1\@empty % if #1 is empty + \let\@place\@empty + \else + \def\@place{#1,}% + \fi +} +% \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. @@ -2407,7 +2439,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \end{macrocode} % \end{macro} % \begin{macro}{\thelabel} -% The printed form of the \texttt{label} counter is changed to include +% The printed form of the \cnt{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 @@ -2439,15 +2471,15 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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} +% and the subject are wrapped up in a \ldots\env{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. +% when a \env{sender}, \env{addressee}, or \env{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 @@ -2654,8 +2686,8 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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: +% To sum up, the strategy for setting the page layout parameters is +% the following: % % \begin{enumerate} % @@ -3042,8 +3074,8 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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 +% 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} @@ -3425,8 +3457,9 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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. +% executed as the last thing (just before "\@begin@letter@hook"). Other +% arguments will be picked up by the "\x@baseletter" or +% "\y@baseletter" macro. % \begin{macrocode} \newenvironment{baseletter}[2]{% #1% @@ -3441,7 +3474,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \cleardoubleemptypage \c@page\@ne \refstepcounter{letter}% - \typeout{Letter \number\c@letter}% + \typeout{\lettername \space \number\c@letter}% \interlinepenalty 200 % smaller than the TeXbook value \parskip\medskipamount % \end{macrocode} @@ -3543,7 +3576,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \@baseletter }} \@ifdefinable\y@baseletter{\long\def\y@baseletter#1{% - \@cut@andcc #1\andcc @@@% + \@cut@andcc #1\andcc\@@@ \def\theaddresseeaddress{#1}% \@baseletter }} @@ -3567,16 +3600,16 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \the\@lett@decl \@begin@letter@hook } -\@ifdefinable\@cut@andcc{\long\def\@cut@andcc#1\andcc#2@@@{% - \@cut@and #1\and @@@% +\@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@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@nl{\long\def\@cut@nl#1\\#2\@@@{% + \@cut@par #1\par\@@@% }} -\@ifdefinable\@cut@par{\long\def\@cut@par#1\par#2@@@{% +\@ifdefinable\@cut@par{\long\def\@cut@par#1\par#2\@@@{% \def\theaddresseename{#1}% }} \newcommand*\stopbreaks{% @@ -3919,14 +3952,31 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} }{% \endnormalpresentation } +% \end{macrocode} +% +% \begin{environment}{normalpresentation} +% The environment for making a normal presentation: +% \begin{macrocode} \newenvironment*{normalpresentation}{% \cleardoublepage \@setup@pres }{% - \par +% \end{macrocode} +% \changes{0.34}{2006 Jan 01}{At the end of the environment, +% changed \protect\texttt{\protect\bslash par} into +% \protect\texttt{\protect\bslash @@par}} +% Changed the following line from "\par" to "\@@par" (v.~0.34): +% \begin{macrocode} + \@@par \addpenalty\@e@prespenalty \addvspace\belowpresentationvspace } +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\@nofoldwarning} +% Warning issued when folded presentations are not allowed: +% \begin{macrocode} \@ifdefinable\@nofoldwarning{\def\@nofoldwarning{% \ClassWarning{\@letteracdp}{% The paper format you chose does not allow\MessageBreak @@ -3936,59 +3986,213 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} Warning issued% }% }} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{foldedpresentation} +% The environment for making a folded presentation, possibly +% splitting it into two parts: the part the actually fits in the folded +% flap, and the other, which is merged with the text below the +% folding. I~think it's better to include some comments here. +% \begin{macrocode} \newenvironment*{foldedpresentation}{% +% \end{macrocode} +% Are folded letters currently allowed? +% \begin{macrocode} \if@do@fold@ +% \end{macrocode} +% \emph{Yes.} First, assure that we are at the beginning of a page; +% note that \emph{numbered} pages, here, are inserted if there is a gap +% to fill in. +% \begin{macrocode} \cleardoublepage +% \end{macrocode} +% The contents of the presentation will be saved in "\box0": set up +% parameters, color support\ldots +% \begin{macrocode} \setbox\z@\vbox\bgroup \@setup@pres +% \end{macrocode} +% \changes{0.34}{2006 Jan 01}{Added setting of +% \protect\texttt{\protect\bslash boxmaxdepth} +% at the beginning of the environment} +% Added the following line (v.~0.34), even if the depth of "\box0" +% will be checked later: +% \begin{macrocode} + \boxmaxdepth\maxdepth +% \end{macrocode} +% \ldots color support, we were saying\ldots +% \begin{macrocode} \color@begingroup +% \end{macrocode} +% The reason for this "\penalty" will be explained later~($*$): +% \begin{macrocode} \penalty-\@M - \prevdepth\z@ +% \end{macrocode} +% \changes{0.34}{2006 Jan 01}{Removed a superfluous setting of +% \protect\texttt{\protect\bslash prevdepth} +% from the beginning of the environment} +% Removed the following line (v.~0.34): we have no need to insert +% interline glue here, and it is even wrong to do it; we will insert the +% "\topskip" glue below with a trick (which, in any case, would remove +% the---incorrect---interline glue inserted here). Why did I include +% this redundant statement? +%\begin{verbatim} +%\prevdepth\z@ +%\end{verbatim} +% \begin{macrocode} \else +% \end{macrocode} +% \emph{No.} Inform the user and substitute a normal presentation. +% \begin{macrocode} \@nofoldwarning \normalpresentation \fi }{% +% \end{macrocode} +% +% When the presentation ends, if we were making a folded +% presentation\ldots +% \begin{macrocode} \if@do@fold@ +% \end{macrocode} +% \ldots finish off the box\ldots +% \begin{macrocode} \@@par \color@endgroup +% \end{macrocode} +% \ldots and save its "\prevdepth" for later. +% \begin{macrocode} \global\dimen@i\prevdepth +% \end{macrocode} +% Insert the equivalent of "\foldingfilbreak[0]": if possible, the +% "\vsplit" that will later split the presentation should try to split +% it here (\emph{i.e.}, not to split it at all). +% \begin{macrocode} \@f@ldingfilbreak\@fold@basepenalty +% \end{macrocode} +% But "\vsplit" might prefer to split the box at the implicit +% "\penalty-10000" inserted at its end; avoid this, since it would +% defeat the "\vfil" of "\@f@ldingfilbreak":\nobreak\space($**$) +% \begin{macrocode} \vskip\maxdimen % "discourage" the break at the \penalty-10000 +% \end{macrocode} +% End of "\vbox". +% \begin{macrocode} \egroup +% \end{macrocode} +% Now "\box0" contains the presentation, but it lacks the due +% "\topskip" glue atop. Of course, we could have inserted the +% equivalent (in normal circumstances) of the "\topskip" glue by +% setting \[ "\prevdepth" := "\topskip"-"\baselineskip" \] at the +% beginning of "\box0", but this does not work always, since it could +% insert the "\lineskip" glue instead. We are admittedly whimsical +% here, but, in order to achieve exactly the same result yielded by +% the "\topskip" glue machinery operated in the main vertical list, we +% use the following trick of "\vsplit"'ting "\box0" to \texttt{0pt}. +% A legal breakpoint exists for this: it is the "\penalty-10000" +% inserted above in~($*$)! This breakpoint comes first in "\box0" and +% it is mandatory, so the "\vsplit" operation will stop immediately +% (without consuming time); nothing will be actually split off, +% everything will remain in "\box0", but with "\splittopskip" glue +% added at the top! Moreover, although we set "\boxmaxdepth" inside +% "\box0", we check again for possible excess depth (can't figure out +% how it could creep in, however). So: +% \begin{macrocode} \splitmaxdepth\maxdepth \splittopskip\topskip \setbox\tw@\vsplit\z@ to\z@ +% \end{macrocode} +% The real splitting of the presentation is done by the following +% "\vsplit": the baseline of the first line possibly remaining in +% "\box0" after the "\vsplit" must be at a distance of +% "\@below@folding@skip" from the folding, plus the "\parskip" glue +% and, of course, the normal interline glue (we are in mid-page now). +% \begin{macrocode} \splittopskip\baselineskip \advance\splittopskip\@below@folding@skip \advance\splittopskip\parskip \setbox\tw@\vsplit\z@ to\@folding@ht +% \end{macrocode} +% Now "\box2" contains the part of the presentation that does fit +% in the folded flap; we append this box to the page (actually, it is the +% first thing contributed since the "\cleardoublepage"). Since +% this box already includes "\topskip" glue at the +% top, no further interline glue must be inserted above it. +% \begin{macrocode} \nointerlineskip \box\tw@ +% \end{macrocode} +% Thanks to the above setting of "\splitmaxdepth", we are sure that +% the depth of the previous box is small; so the following line will +% take us exactly on the edge of the fold, with null depth\ldots +% \begin{macrocode} {\baselineskip\@above@folding@margin \nobreak\null}% +% \end{macrocode} +% \ldots where we insert a costly, yet feasible breakpoint. +% \begin{macrocode} \penalty\@highpenalty +% \end{macrocode} +% If everything fitted in the folded flap, nothing remained in +% "\box0". +% \begin{macrocode} \ifvoid\z@ +% \end{macrocode} +% In that case, just leave appropriate blank space (the "\prevdepth" +% is already zero, so the interline glue of the following line will be +% correct). +% \begin{macrocode} \vskip\@below@folding@skip +% \end{macrocode} +% Otherwise, take the part that did not fit out of "\box0"\ldots +% \begin{macrocode} \else \unvbox\z@ +% \end{macrocode} +% \ldots so it is now in the list of ``recent contributions'' +% ("\unvbox" does not exercise the page builder); remove the +% "\vskip\maxdimen" added in~($**$) just to fool "\vsplit", as well as +% the items added by the virtual "\foldingfilbreak[0]". +% \begin{macrocode} \unskip % remove "\vskip\maxdimen" \unpenalty % remove "\penalty\@fold@basepenalty" \unskip % remove "\vskip \dimen@ plus 1fil minus ..." \unskip % remove "\vskip -\skip@" \unpenalty % remove "\penalty 10000" +% \end{macrocode} +% Now the list of ``recent contributions'' contains exactly what the +% user put in the presentation (and did not fit in the folded flap). +% Restore "\prevdepth" and conclude as if it were a normal +% presentation: this makes a perfectly seamless join with the +% following material, as if the folded presentation had been a normal +% one, extending down to this spot in the page. ^^A ( paren match +% Not bad, uhu?~:-) +% \begin{macrocode} \prevdepth\dimen@i \addpenalty\@e@prespenalty \addvspace\belowpresentationvspace +% \end{macrocode} +% Ah, yes, also inform the user of what happened: +% \begin{macrocode} \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 +% \end{macrocode} +% If we were not making a folded presentation, then conclude a +% normal one. +% \begin{macrocode} \else \endnormalpresentation \fi } +% \end{macrocode} +% \end{environment} +% +% Back to uncommented code. +% \begin{macrocode} \newcommand*\iffoldedallowed{% \if@do@fold@ \expandafter\@firstoftwo @@ -4004,6 +4208,11 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \makesubject\relax \end{normalpresentation}% } +% \end{macrocode} +% +% \begin{macro}{\@f@ldingfilbreak} +% The ``upper half'' of "\@foldingfilbreak". +% \begin{macrocode} \@ifdefinable\@f@ldingfilbreak{\def\@f@ldingfilbreak#1{% \ifdim\prevdepth<\maxdepth \dimen@ -\prevdepth @@ -4016,6 +4225,10 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \vskip \dimen@ \@plus 1fil\@minus \@above@folding@shrink \penalty #1% }} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} \@ifdefinable\@foldingfilbreak{\def\@foldingfilbreak#1#2{\par \@f@ldingfilbreak#1% \vskip -\dimen@ \@plus -1fil\@minus -\@above@folding@shrink @@ -4036,8 +4249,8 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \@esphack \fi } -\newcommand*\foldingfilbreak[2][\z@]{% - \@foldingfilbreak{\@fold@getpen{#1}}{#2}% +\newcommand*\foldingfilbreak[1][\z@]{% + \@foldingfilbreak{\@fold@getpen{#1}}% } \newcommand*\makefoldedpresentation{% \if@do@fold@ @@ -4074,9 +4287,9 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \nobreak\medskip \fi }} -\newcommand*\makedate [1][]{\@make@date{#1}NN} -\newcommand*\maketopdate [1][]{\@make@date{#1}NY} -\newcommand*\makebottomdate[1][]{\@make@date{#1}YN} +\newcommand*\makedate [1][\@place]{\@make@date{#1}NN} +\newcommand*\maketopdate [1][\@place]{\@make@date{#1}NY} +\newcommand*\makebottomdate[1][\@place]{\@make@date{#1}YN} \@ifdefinable\@empty@signature{\def\@empty@signature{% \ClassWarning{\@letteracdp}{% Empty signature% @@ -4174,7 +4387,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \@opening }% } -\newcommand*\@opening[1][]{% +\newcommand*\@opening[1][\@place]{% \makepresentation \maketopdate[#1]% \@cdp@reserved @@ -4254,11 +4467,63 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \newcommand*\PS{% \ps\@ifstar{\@PS@rubber}{\@PS@rigid}% } +% \end{macrocode} +% +% \begin{macro}{\stopletter} +% User-level hook invoked (before anything else) when a letter ends. +% \begin{macrocode} \newcommand*\stopletter{} % \end{macrocode} +% \end{macro} % % \subsubsection{Address labels} % +% This part of the code should probably be detached and put in a +% separte file to be loaded on demand. +% +% The general idea is the following: +% \begin{itemize} +% \item +% a \env{labels} (or \env{baselabels}, see below) environment +% produces one or more sheets of address labels; +% \item +% inside \env{labels}, several \env{labelgroup} environments wrap up +% the address labels pertaining to each letter (a letter may have +% several address labels associated with it, if it has several +% addressees); +% \item +% inside each \env{labelgroup} environment, individual labels are +% produced with the "\basemlabel" command. +% \end{itemize} +% The \env{labels} environment takes care of such things like jumping +% to a new page, etc.; the \env{labelgroup} environment merely changes +% the way address labels are numbered, but does not otherwise affect +% the printout. +% +% The user may either: +% \begin{enumerate} +% \renewcommand*{\theenumi}{(\Alph{enumi})} +% \renewcommand*{\labelenumi}{\theenumi} +% \item\label{autolabels} +% include a "\makelabels" declaration in the preamble, to have +% address labels generated automatically via the \filedir{.aux} +% file; in this case, appropriate commands are written in the +% \filedir{.aux} file by each +% \env{baseletter} environment, which, when the \filedir{.aux} file +% is re-read at the "\end{document}", automatically generate the +% required environments and commands (\env{labels}, +% \env{labelgroup}, etc.); \emph{or} +% \item\label{handlabels} +% produce the address labels ``by hand'', including directly in the +% source file, where (s)he want the address label sheets to appear, a +% \env{labels} environment, containing the appropriate +% \env{labelgroup} environments, containing, in turn, the individual +% "\basemlabel" commands. +% \end{enumerate} +% In principle, it is also possible to mix \ref{autolabels} +% and~\ref{handlabels} (and to have several \env{labels} +% environments, too), but this has no practical utility. +% % \begin{macrocode} \newcommand*\returnaddress{\thesenderaddress} \@ifdefinable\@emptyaddrlabels@err{\def\@emptyaddrlabels@err{% @@ -4294,6 +4559,14 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \@emptyaddrlabels@err \fi\fi } +% \end{macrocode} +% +% \begin{environment}{baselabels} +% This is the actual environment for producing sheets of address +% labels: the \env{labels} environment (see below) is simply a wrapper +% that offers to the user the opportunity of changing some settings +% before invoking \env{baselabels}. +% \begin{macrocode} \newenvironment*{baselabels}{% \cleardoubleemptypage \c@page\@ne @@ -4350,7 +4623,28 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} }{% \@killglue\clearpage } +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{labels} +% It is the user-level environment for producing one or more sheets of address labels. +% Its default definition simply invokes \env{baselables}, but the +% user may redefine it to set some style parameters. For example: +%\begin{verbatim} +%\renewenvironment{labels}{% +% \baselabels +% \setlength\fboxrule{.2pt}% +% \addtolength\fboxsep{-2\fboxrule}% +%}{\endbaselabels} +%\end{verbatim} +% will draw a thin border around each address label. +% \begin{macrocode} \newenvironment*{labels}{\baselabels}{\endbaselabels} +% \end{macrocode} +% \end{environment} +% +% Back to uncommented code. +% \begin{macrocode} \let\@beginlabels=\relax \let\@endlabels=\relax \newenvironment*{labelgroup}{\stepcounter{letter}}{} @@ -4371,7 +4665,18 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \stepcounter{totallabel}% \stepcounter{label}% } +% \end{macrocode} +% +% \begin{macro}{\ifactuallabel} +% Macro for the user: "\ifactuallabel{"\meta{FOO}"}{"\meta{BAR}"}" +% executes \meta{FOO} if the label is not being skipped, \meta{BAR} +% otherwise. +% \begin{macrocode} \let\ifactuallabel\@firstoftwo +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} \newcommand\basemlabel[2]{% \begingroup \def\startaddrlabel{\par @@ -4526,6 +4831,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \newcommand*\enclname {Allegati:} \newcommand*\PSname {P.S.:} \newcommand*\headtoname {A:} +\newcommand*\lettername {Lettera} \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 @@ -4554,8 +4860,8 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \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, + [2006/01/01 v0.34 (development)] +%% \typeout{Copyright (C) 1999-2006 by Gustavo MEZZETTI, %% all rights reserved.} % \end{macrocode} % @@ -4577,6 +4883,21 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \do\if@loX@in@toc@ % \end{macrocode} % +% \begin{macro}{\@letter@bookmark} +% Support for pdf\TeX\slash\packlass{\hyperref}. If pdf\TeX\ is +% being used to typeset the document, if the \packlass{\hyperref} +% package is loaded, and if the user does not ask us to avoid it, we +% shall generate a ``level~0'' bookmark for each letter we shall +% typeset (sections are of level~1, so they will be bookmarked under +% letters). This command serves to this purpose: it is defined either +% as "\@gobbletwo", if such bookmarks are \emph{not} being generated, +% or as a suitable invocation of "\pdfbookmark" if they are. To begin +% with, we set the former alternative, which makes it act as a no-op. +% \begin{macrocode} +\@ifdefinable\@letter@bookmark{\let\@letter@bookmark\@gobbletwo} +% \end{macrocode} +% \end{macro} +% % Space above and below captions for figures and tables. % \begin{macrocode} \newlength\abovecaptionskip @@ -4605,20 +4926,51 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \@toc@in@toc@false \@loX@in@toc@false } +% \end{macrocode} +% The option \opz{letterbookmarks} causes the bookmarks for letters to +% be generated. Upon expansion, the 2~arguments of +% "\@letter@bookmark" will become arguments of "\pdfbookmark". We +% also need to ask the \packlass{\hyperref} package to generate closed +% bookmarks. Note that the user can later overwrite this setting; +% note also that nothing will happen if \packlass{\hyperref} is not +% loaded later. +% \begin{macrocode} +\DeclareOption{letterbookmarks}{% + \def\@letter@bookmark{\pdfbookmark[0]}% + \PassOptionsToPackage{bookmarksopen=false}{hyperref}% +} +% \end{macrocode} +% The option \opz{noletterbookmarks} supresses the bookmarks for +% letters. +% \begin{macrocode} +\DeclareOption{noletterbookmarks}{% + \let\@letter@bookmark\@gobbletwo +} +% \end{macrocode} +% The option \opz{openletterbookmarks} causes the bookmarks for +% letters to be generated and to be presented open to the reader. We +% ask the \packlass{\hyperref} package to generate open bookmarks, but +% only one level deep. Note that the user can later overwrite this +% setting. This is made the default option, below. +% \begin{macrocode} +\DeclareOption{openletterbookmarks}{% + \def\@letter@bookmark{\pdfbookmark[0]}% + \PassOptionsToPackage{bookmarksopen,bookmarksopenlevel=1}{hyperref}% +} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{letteracdp}} % \end{macrocode} % % \subsection{Option processing} % % \begin{macrocode} -\ExecuteOptions{plaintoc} +\ExecuteOptions{plaintoc,openletterbookmarks} \ProcessOptions\relax % \end{macrocode} % % \subsection{Class loading} % % \begin{macrocode} -\LoadClass{letteracdp}[2005/01/01] +\LoadClass{letteracdp}[2006/01/01] % \end{macrocode} % % \subsection{Main code} @@ -4634,20 +4986,33 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \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}. +% Stuff for dealing with the \packlass{\hyperref} package. The +% problem is our non-standard hierarchy of sectioning commands, with +% paragraphs placed directly below sections. In this version (0.34) we +% choose a different approach than the one we adopted in version 0.33, +% redefining "\theHparagraph"; of course, this must be done +% \emph{after} \packlass{\hyperref} has been loaded, and we could not +% find any better place for this than the "\AtBeginDocument" hook. +% Within the same hook, we also redefine "\theHsection" (the counter +% used by \packlass{\@hyperref} to generate hyperlinks to sections) so +% that sections with the same number, but included in different +% letters, will have different anchors; we fix the bookmark level for +% paragraphs, too. +% \begin{macrocode} +\AtBeginDocument{% + \def\theHletter{\arabic{letter}}% + \@ifpackageloaded{hyperref}{% + \def\theHparagraph{\theHsection.\arabic{paragraph}}% + \def\theHsection{\theHletter.\arabic{section}}% + \def\toclevel@paragraph{2}% + }{% +% \end{macrocode} +% If the \packlass{\@hyperref} package is not loaded, we assure that +% "\@letter@bookmarks" acts as a no-op: % \begin{macrocode} -\newcounter{subsection} -\newcounter{subsubsection} + \let\@letter@bookmark\@gobbletwo + }% +} % \end{macrocode} % % \begin{macro}{\hyper@last} @@ -4657,12 +5022,13 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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 +% "\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 (because it looks for \filedir{.toc}, \filedir{.lof}, +% etc.\ files, not for, say, \filedir{.toc1}, etc.), so\ldots % \begin{macrocode} \@ifdefinable\hyper@last{\let\hyper@last\relax} % \end{macrocode} @@ -4697,7 +5063,24 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \@nobreakfalse \endgroup } +% \end{macrocode} +% +% The "\@begin@letter@hook" macro is invoked whenever a letter +% starts; we want (possibly, see above) a bookmark to be generated for +% the letter. Note that we use "\theletter" for the letter number +% presented to the user, and "\theHletter" for the number used to +% generate the anchor. +% \begin{macrocode} \g@addto@macro\@begin@letter@hook{% + \edef\@cdp@reserved{% + \noexpand\@letter@bookmark + {\lettername\space\theletter}{letter.\theHletter}% + }% + \@cdp@reserved +% \end{macrocode} +% +% Actions for closing a set of toc/lof/lot file and opening another: +% \begin{macrocode} \if@filesw {\escapechar\m@ne \immediate\write\@out@table@list{\string\}^^J\string\{}% @@ -4706,6 +5089,10 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} {\string\@deferred@clopen{\number\c@letter}}% \fi } +% \end{macrocode} +% +% Uncommented code. +% \begin{macrocode} \@ifdefinable\@deferred@open {\let\@deferred@open \@gobble} \@ifdefinable\@deferred@close {\let\@deferred@close \@empty} \@ifdefinable\@deferred@clopen{\let\@deferred@clopen\@gobble} @@ -4768,7 +5155,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \begin{macrocode} \@ifdefinable\@addfullstop{\long\def\@addfullstop#1{% {\nonfrenchspacing\ignorespaces#1\unskip - \ifnum\spacefactor>\@m \else.\fi \/}% + \ifnum \spacefactor>\@m \else.\fi \/}% }} \newcommand*\nopunct{\spacefactor 1001\relax} % \end{macrocode} @@ -4792,17 +5179,27 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \setlength \dblfloatsep {\bigskipamount} \@msetlength\dbltextfloatsep {2}{\bigskipamount} \setlength \@fptop {\z@ plus 1 fil} -\setlength \@fpsep {\bigskipamount} +\setlength \@fpsep {1\bigskipamount plus 2 fil} \setlength \@fpbot {\z@ plus 1 fil} -\setlength \@dblfptop {\z@ plus 1 fil} -\setlength \@dblfpsep {\bigskipamount} -\setlength \@dblfpbot {\z@ plus 1 fil} +\setlength \@dblfptop {\@fptop} +\setlength \@dblfpsep {\@fpsep} +\setlength \@dblfpbot {\@fpbot} \setlength\abovecaptionskip{\medskipamount} \setlength\belowcaptionskip{\z@skip} % \end{macrocode} % % \subsubsection{Title, section heads, figures, bibliography\ldots} % +% \begin{macro}{\maketitle} +% Without the \packlass{\@hyperref} package, the "\maketitle" +% command can take the same optional argument as "\maketopdate", for +% specifying a short string to be prepended to the date; and in this +% case, the new "\place" declaration will be automatically honored. +% But the former feature will break if \packlass{\@hyperref} is +% loaded, and no remedy seems feasible for this, since +% \packlass{\@hyperref} assumes that "\maketitle" hasn't got any +% arguments. Note also that a period is automatically added to the +% title. % \begin{macrocode} \newcommand*\maketitle{% \begingroup @@ -4817,6 +5214,11 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \setcounter{footnote}{\z@}% \maketopdate } +% \end{macrocode} +% \end{macro} +% +% Uncommented code. +% \begin{macrocode} \setcounter{secnumdepth}{\tw@} \def\@seccntformat#1{\csname the#1\endcsname .\enspace} \ifcase \@ptsize\relax @@ -4966,6 +5368,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \section{The code for the \packlass{\adiseal} package} % % This part of the file goes into \filedir{\adiseal.sty}. +% \emph{Very obsolete:} eliminate? % \begin{macrocode} %<*adipk> % \end{macrocode} @@ -4975,7 +5378,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1998/06/01] % LaTeX2e is required! \ProvidesPackage{adiseal} - [2005/01/01 v0.33 (development)] + [2006/01/01 v0.34 (development)] \@ifdefinable\@adiseal{\def\@adiseal{adiseal}} % \end{macrocode} % @@ -4994,25 +5397,35 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} } % \end{macrocode} % \end{macro} +% % \begin{macro}{\@seal@graph@file} +% \changes{0.34}{2006 Jan 01}{Got rid of the \filedir{.eps} extension +% in the name of the file of the ADI seal: thus, the extension +% \filedir{.eps} or \filedir{.pdf} will be automatically supplied +% by the \packlass{epsgif} package according to the actual +% typesetting engine employed (\TeX\ or pdf\TeX)} % 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. +% made accessible to the user. \emph{Note:} the image must be contained +% in a file in Encapsulated PostScript format or, for pdf\TeX, in +% Portable Document Format, and it should be exactly \( 60\,\mbox{bp} \) +% wide by \( 42\,\mbox{bp} \) tall. The appropriate file extension +% will be supplied by the \packlass{epsfig} package. % \begin{macrocode} \@ifdefinable\@seal@graph@file{\def\@seal@graph@file{% - adiseal.eps% must be an Encapsulated PostScript file + adiseal% must be an EPS or a PDF file }} % \end{macrocode} % \end{macro} % +% \begin{macro}{\if@use@pixmap@} % 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} +% \end{macro} % % \begin{macro}{\@temp@adiseal} % A ``scratch'' macro, used as a temporary storage in the sequel. @@ -5065,7 +5478,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} }% } \if@use@pixmap@ - \IfFileExists{\@seal@graph@file}{% + \IfFileExists{\@seal@graph@file.eps}{% \IfFileExists{epsfig.sty}{% \RequirePackage{epsfig}% }{% @@ -5186,14 +5599,14 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} %<*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 +% 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 +% It should be time to expunge this file from the Bundle, perhaps +% [v0.33], but it is also true that it occupies so few % bytes\ldots\space(that is, an entire block of the disk!). % % \subsection{Identification} @@ -5201,7 +5614,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1998/06/01] % LaTeX2e is required! \ProvidesClass{lettcdpadi} - [2005/01/01 v0.33 (development)] + [2006/01/01 v0.34 (development)] % \end{macrocode} % % \subsection{Initial code} @@ -5225,8 +5638,8 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \subsection{Class and package loading} % % \begin{macrocode} -\LoadClass{letteracdp}[2005/01/01] -\RequirePackage{adiseal}[2005/01/01] +\LoadClass{letteracdp}[2006/01/01] +\RequirePackage{adiseal}[2006/01/01] % \end{macrocode} % % \subsection{Main code} @@ -5251,7 +5664,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1998/06/01] % LaTeX2e is required! \ProvidesPackage{cdpaddon} - [2005/01/01 v0.33 (development)] + [2006/01/01 v0.34 (development)] \@ifdefinable\@cdpaddon{\def\@cdpaddon{cdpaddon}} % \end{macrocode} % @@ -5316,7 +5729,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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@a#1printer:#2,#3\@@@{% \def\@temp@cdpaddon@b{#1}% \ifx\@temp@cdpaddon@b\@empty \def\@cdpaddon@printer{#2}% @@ -5333,7 +5746,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % a \opz{printer:}\ldots\ option requesting a color definition file. % \begin{macrocode} \DeclareOption*{% - \expandafter\@temp@cdpaddon@a\CurrentOption,printer:,@@@% + \expandafter\@temp@cdpaddon@a\CurrentOption,printer:,\@@@% } % \end{macrocode} % @@ -5718,11 +6131,12 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} \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} +% The following line has been removed from the code, since the +% bookmark level for paragraphs is now fixed in the file +% \filedir{\articoletteracdp.cls} (v.~0.34). +%\begin{verbatim} +%\def\toclevel@paragraph{2} +%\end{verbatim} % If hyperlinks are not requested, we can release "\@temp@cdpaddon@a" % right now. % \begin{macrocode} @@ -5764,16 +6178,16 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % ``transparent'' to the "\spacefactor", just like parentheses % (the "\spacefactor" is saved in "\count@"). % \begin{macrocode} -\DeclareRobustCommand*{\facesmile}{\@face\smile} -\DeclareRobustCommand*{\facefrown}{\@face\frown} +\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". +% 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 +% either a "\smile" or a "\frown". % \begin{macrocode} \@ifdefinable\@face{\def\@face#1{% \leavevmode @@ -5819,7 +6233,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} %%% 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] +\ProvidesFile{cdpshues-example.def}[2006/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 @@ -5838,7 +6252,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % \filedir{\epson}. % \begin{macrocode} %<*epson> -\ProvidesFile{epson-stylus-740.def}[2005/01/01 Printer-dependent file] +\ProvidesFile{epson-stylus-740.def}[2006/01/01 Printer-dependent file] \definecolor{slight@col}{rgb}{.8,1,.8} \definecolor{strong@col}{rgb}{0,.266667,0} %</epson> @@ -5849,7 +6263,7 @@ mediumsubject,uprightsignature,noPS,indent,105x37labels} % 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] +\ProvidesFile{hp-laserjet-4500.def}[2006/01/01 Printer-dependent file] \definecolor{slight@col}{cmyk}{.1,0,.1,0} \definecolor{strong@col}{cmyk}{.5,0,.5,.5} %</hplj> |