diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/isodoc/isodoc.dtx | 210 |
1 files changed, 119 insertions, 91 deletions
diff --git a/Master/texmf-dist/source/latex/isodoc/isodoc.dtx b/Master/texmf-dist/source/latex/isodoc/isodoc.dtx index 4049de35da6..338986adaf0 100644 --- a/Master/texmf-dist/source/latex/isodoc/isodoc.dtx +++ b/Master/texmf-dist/source/latex/isodoc/isodoc.dtx @@ -35,7 +35,7 @@ Execute the inst script with the --help option for more information. %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<class>\ProvidesClass{isodoc}% %<*class> - [2014/02/01 v1.03 isodoc class for letters and invoices] + [2014/02/27 v1.04 isodoc class for letters and invoices] %</class> %<class>\ifx\pdfoutput\undefined\else% %<class>\ifnum\pdfoutput=1\else\ClassError{isodoc}{Compile me with pdflatex or xelatex!}{} @@ -55,8 +55,7 @@ Execute the inst script with the --help option for more information. pdftitle = The isodoc class, pdfauthor = Wybo Dekker, pdfsubject = {Preparation of letters and invoices}, - pdfkeywords = { - letter, + pdfkeywords = {letter, invoice, key=value options, NEN1026 @@ -64,10 +63,6 @@ Execute the inst script with the --help option for more information. bookmarksopen, hidelinks } - -%\parindent0pt\parskip1ex -%\PageIndex -%\IndexPrologue{\section*{Index}} \newcommand{\FIG}[3]{ % pdfname label caption \ctable[label={#2},caption={#3},figure,botcap,framerule=.5pt]{@{}c@{}}{}{% \includegraphics[width=\textwidth]{#1} @@ -257,25 +252,35 @@ Execute the inst script with the --help option for more information. % - changed definitions for fancy headings and footings to allow for easy % adaptation in style files. % } +% \changes{v1.04}{2014/02/17}{ +% - footers and copyto did not work correctly.\\ +% - closingskip option removed; use dimen signatureskip in style file.\\ +% - some skips now have own dimen for easier adaptation in style file. +% } % \DoNotIndex{% -% \ , \", \', \@auxout, \AtBeginDocument, \AtEndDocument, \Cbox, \CurrentOption, -% \DeclareOption, \DescribeMacro, \LARGE, \Large, \LoadClass, \ML, \NN, -% \PassOptionsToClass, \ProcessOptions, \RequirePackage, \TPGrid, \Tbox, \\, \^, -% \`, \aa, \addtocounter, \advance, \barsep, \baselineskip, \begin, \bfseries, +% \ , \", \', \@auxout, \AtBeginDocument, \AtEndDocument, \Cbox, +% \CurrentOption, \DeclareOption, \DescribeMacro, \ForEachX, \IfInteger, +% \IfStrEq, \LARGE, \Large, \LoadClass, \ML, \NN, \PassOptionsToClass, +% \ProcessOptions, \RequirePackage, \StrLeft, \StrMid, \StrRight, +% \StrSubstitute, \TPGrid, \Tbox, \Undefined, \\, \^, \`, \aa, +% \addtocounter, \advance, \barsep, \baselineskip, \begin, \bfseries, % \bgroup, \clearpage, \cmidrule, \colorbox, \csname, \def, \define@key, % \definecolor, \egroup, \else, \empty, \end, \endcsname, \enspace, -% \expandafter, \fancyhead, \fancyhf, \fi, \filedat, \fileversion, -% \footnotesize, \geometry, \hfill, \hsize, \hspace, \ht, \if@twoside, -% \ifcase, \ifdim, \ifnum, \ifx, \ignorespaces, \immediate, \includegraphics, -% \lastpage@putlabel, \let, \long, \multicolumn, \newcommand, \newcount, -% \newdimen, \newenvironment, \newif, \newlabel, \noindent, \number, \o, \or, -% \pageref, \pagestyle, \paperheight, \paperwidth, \par, \parindent, \parskip, -% \pdfinfo, \qquad, \quad, \raggedright, \raisebox, \relax, -% \rightskip, \rule, \scriptsize, \scshape, \selectlanguage, \setbox, -% \setcounter, \setkeys, \sffamily, \space, \string, \tbfigures, \textbf, -% \textbullet, \thepage, \thispagestyle, \undefined, \unskip, \usepackage, -% \vbox, \vfill, \vspace, \write -% } +% \expandafter, \fancyfoot, \fancyhead, \fancyhf, \fboxsep, \fi, \filedat, +% \fileversion, \fill, \fontencoding, \fontfamily, \fontseries, \fontshape, +% \footnotesize, \gdef, \geometry, \hbox, \hfill, \hline, \hsize, \hspace, +% \ht, \hypersetup, \if@twoside, \ifcase, \ifdim, \ifnum, \ifx, +% \ignorespaces, \immediate, \includegraphics, \label, \lastpage@putlabel, +% \lccode, \let, \long, \lowercase, \mbox, \multicolumn, \newcommand, +% \newcount, \newcounter, \newdimen, \newenvironment, \newfont, \newif, +% \newlabel, \noindent, \number, \o, \or, \pageref, \pagestyle, +% \paperheight, \paperwidth, \par, \parindent, \parskip, \pdfinfo, \qquad, +% \quad, \raggedright, \raisebox, \relax, \rightskip, \rule, \sbox, +% \scriptsize, \scshape, \selectfont, \selectlanguage, \setbox, +% \setcounter, \setkeys, \setlength, \sffamily, \space, \string, +% \tbfigures, \textbf, \textbullet, \textsf, \thepage, \thislevelitem, +% \thispagestyle, \undefined, \unskip, \usepackage, \value, \vbox, \vfill, +% \vskip, \vspace, \wd, \write, \z@, % } % % \GetFileInfo{isodoc.dtx} % @@ -493,6 +498,7 @@ Execute the inst script with the --help option for more information. % bullets.\NN % } % +% \newpage % \OPTS{Header fields}{Under the address window, a header is printed. The % page is vertically divided in six columns, one each for the left and right % margins, and four which, in the header, @@ -543,34 +549,40 @@ Execute the inst script with the --help option for more information. % \T{closingcomma = ...}& by default, the closing phrase is followed by a comma, but you % can change that here.\NN % \T{signature = ...} & Betty\NN -% \T{autograph = ...} & \begin{minipage}[t]{\hsize} +% \T{autograph = ...} & \parbox[t]{\hsize}{% % This keyword can have one of the 10 values 0--9:\\[-\baselineskip] % \begin{compactitem} % \item [0:] no autograph; the \T{signature} appears right under -% the \T{closing}. This is the default if the \T{autograph} option -% is not used (using it without a value is equivalent to -% \T{autograph=2}). +% the \T{closing}. This is the default if the \T{autograph} option +% is not used (using it without a value is equivalent to +% \T{autograph=2}). % \item [1:] generates extra whitespace between -% \T{signature} and \T{closing} for a hand-written -% autograph. Change with the \T{closingskip} key. +% \T{signature} and \T{closing} for a hand-written +% autograph. The amount of whitespace is +% |\signatureskip|.\footnote{Change its value preferably in +% a style file.} % \item [2--9:] inserts one of eight autograph images -% which, with the \C{autograph} command, -% may have been defined in the style file.\\\mbox{} +% which, with the \C{autograph} command, +% may have been defined in the style file. % \end{compactitem} -% \end{minipage} +% } % \NN % \T{enclosures = ...} & This keyword can be used to add a note, at the end of % the document, which starts with \textbf{Enclosure:} % followed by the value of the keyword. Multiple % enclosures can be separated with \C{}\C{} commands. If % those are found, the starting text will be -% \textbf{Enclosures:}.\NN -% \T{copyto = ...} & This keyword can be used to add a note, at the end of -% the document, which starts with \textbf{Copy to:} -% followed by the value of the keyword. Multiple -% entries can be separated with \C{}\C{} commands.\NN -% \T{closingskip = ...} & white space between signature and closing. The -% default is \T{2}\C{baselineskip}.\NN +% \textbf{Enclosures:}. It appears under the closing, with a white +% line in between.\footnote{The whitespace in between can be influenced +% (preferable in a style file) with the dimen |\enclosureskip|, default +% |\baselineskip|. Alternatively, set |\encldowntrue| to move the +% enclosures to the bottom of the page.}\NN +% \T{copyto = ...} & This keyword can be used to add a note, at the end of the document, +% which starts with \textbf{Copy to:} followed by the value of the keyword. +% Multiple entries can be separated with \C{}\C{} commands. +% It appears under the enclosures or, if those are absent, the closing, +% with a white line in between.\footnote{The whitespace in between can +% be influenced with the dimen |\copytoskip|, default |\baselineskip|}\NN % } % % \OPTS{Footer fields}{If the \T{footer} option is used, up to five footer fields are shown @@ -621,6 +633,7 @@ Execute the inst script with the --help option for more information. % from the top of the paper.\NN % } % +% \newpage % \OPTS{Payment data}{In invoices you probably want to make clear where you want % your debtor to transfer his money to. You can do so by calling % the \C{accountdata} command, which generates a little table containing these data. @@ -816,7 +829,6 @@ Execute the inst script with the --help option for more information. % the image, expressed as an integer percentage of the image % \textsl{height}. % \end{compactenum} -% \FIG{examples/letter/letter.pdf}{letter1}{Minimal letter example} % % \DescribeMacro{\logo} % The |\logo| command is internally used to define the default logo; you can @@ -847,7 +859,9 @@ Execute the inst script with the --help option for more information. % \bigskip\\ % If you need other symbols, then please email me. % +% \newpage % \section{Usage: letters} +% \FIG{examples/letter/letter.pdf}{letter1}{Minimal letter example} % % Usage of the class is best explained by example. % \subsection{A simple letter} @@ -869,7 +883,7 @@ Execute the inst script with the --help option for more information. % is an example of such a style file: % \verbinput{examples/letter/letter.sty} % So in the style file, too, |\setupdocument| is used to register -% information that will common to almost all of my letters. The +% information that will be common to almost all of my letters. The % |\autograph| command sets up an autograph, based on an image file. Apart % from the code shown here, a style file can contain definitions for more % autographs, and a definition for a logo. Without the latter, a default logo is @@ -877,36 +891,33 @@ Execute the inst script with the --help option for more information. % and |signature| in the style file, and that I did not override those in the % letter's source. % -% \FIG{examples/logoletter/logo1.pdf}{logo1}{Long letter example with a non-standard logo, page 1} -% \FIG{examples/logoletter/logo2.pdf}{logo2}{Long letter example with a non-standard logo, page 2} -% % The letter source example shown above, in combination with this style example, % compiles to the letter shown in figure~\ref{letter1}. % This example illustrates some aspects of isodoc: % \begin{compactitem} % \item At the top, you see the default letterhead (logo). You can create % your own logo by redefining the |\logo| command. - +% % \item Under it is the address. It has a return address in script sized % sans serif boldface over it, because the |return| key has been used. A % return address is useful if you send your letters in a standard window % envelope. The positioning of the address is done in the style file, using % the |addresscenter| and |leftaddress| or |rightaddress| keywords. - +% % \item The paper is vertically divided in six equally wide columns. The % outer two columns are the left and right margins, the second to fifth % columns contain header and footer fields. - +% % \item The ``Your reference'' and ``Our reference'' fields have not been % set (with the |yourref| and |ourref| keys) and therefore stay empty by % default, the date field has also not been set, but it should be. % Therefore, the default value is ``Undefined date'', and a warning is % issued by a pink background. - +% % \item A folding mark has been printed in the extreme right margin, such % that on folding the paper along it, it will correctly fit in a 220 x 110 % mm envelope; this has been achieved by using the |fold3| key. - +% % \item In between closing (\textsl{Best regards,}) and signature % (\textsl{W.H.~Dekker}) an autograph has been placed. This was done by % setting the option |autograph|, which has a default value of 2. @@ -914,15 +925,20 @@ Execute the inst script with the --help option for more information. % for white space where an autograph can be placed with a pen after % printing, or one of the values |2-9|, which may have been associated with % other autograph images. In this case, I have used an autograph image in -% which I have drawn the boundary box and the \textsl{outdent}, -% \textsl{closing}, and \textsl{signature} positions defined in the -% |\autograph| command (see the section \textsl{Commands}) with red lines. +% which I have drawn the boundary box and the \textsl{height} (argument 2), +% \textsl{closing} (3), \textsl{signature} (4), and \textsl{outdent} (5) +% positions defined in the |\autograph| command (see the section +% \textsl{Commands}) with red lines. +% % \item The bottom of the letter has (up to) four fields with contact % information. This is useful if your logo does not show that % information. If it does, you can omit these fields by using the % |nofooter| key, or by not using the |footer| key, depending on the % default set in the style file. - +% +% \item Note that the footer fields include a cellphone field, but the +% cellphone number has not been defined, which results in an error message. +% % \end{compactitem} % % \subsection{Multiple letters, redefined logo} @@ -933,7 +949,8 @@ Execute the inst script with the --help option for more information. % (|logoletter.sty|): % \verbinput{examples/logoletter/logoletter.sty} % \label{logoredef} -% \FIG{examples/invoice/invoice.pdf}{invoice}{Invoice example} +% \FIG{examples/logoletter/logo1.pdf}{logo1}{Long letter example with a non-standard logo, page 1} +% \FIG{examples/logoletter/logo2.pdf}{logo2}{Long letter example with a non-standard logo, page 2} % The letter source does not use the |autograph| key, so the default value of % |2| is used; we write it in Dutch and use % a larger text, just to see what happens if more than one page is generated: @@ -947,6 +964,7 @@ Execute the inst script with the --help option for more information. % % \section{Usage: invoices} % \subsection{A simple invoice} +% \FIG{examples/invoice/invoice.pdf}{invoice}{Invoice example} % \FIG{examples/accept/accept.pdf}{accept}{Invoice example with accept form} % % Invoices (can) have the same structure as letters, except that the |\opening| @@ -1024,7 +1042,7 @@ Execute the inst script with the --help option for more information. % weren't: % \begin{macrocode} \definecolor{isodocpink}{rgb}{1,.7,.7} -\def\Undefined#1{\fboxsep1pt\colorbox{isodocpink}{Undefined #1}} +\def\Undefined#1{\fboxsep1pt\colorbox{isodocpink}{\strut Undefined #1}} % \end{macrocode} % A small sans serif font is used for header and footer field names and the % sender's address information. The idea is that this is used for all @@ -1052,7 +1070,6 @@ Execute the inst script with the --help option for more information. \define@key{isodoc}{vertical}[\verticaltrue]{\verticaltrue} \define@key{isodoc}{novertical}[\verticaltrue]{\verticalfalse} \newif\ifvertical\verticaltrue - % \end{macrocode} % Several items in the letter/invoice will be different in documents that are to % be sent abroad; this is set with the |foreign| option, false by default: @@ -1214,7 +1231,7 @@ Execute the inst script with the --help option for more information. % The default is the have no footer. % \begin{macrocode} \define@key{isodoc}{footorder} {\def\@footorder{#1}} - \def\@footorder{website;@phone;@cellphone;email} + \def\@footorder{website;phone;cellphone;email} \define@key{isodoc}{footer} []{\footertrue} \newif\iffooter\footerfalse \define@key{isodoc}{nofooter}[]{\footerfalse} @@ -1239,17 +1256,19 @@ Execute the inst script with the --help option for more information. \def\phoneprefix{0} \define@key{isodoc}{phone} {\def\phone{#1}} \def\phone{} - \def\@phone{\Undefined{@phone}} + \def\@phone{\Undefined{phone}} \define@key{isodoc}{cellphone} {\def\cellphone{#1}} \def\cellphone{} - \def\@cellphone{\Undefined{@cellphone}} + \def\@cellphone{\Undefined{cellphone}} \define@key{isodoc}{fax} {\def\fax{#1}} \def\fax{} - \def\@fax{\Undefined{@fax}} + \def\@fax{\Undefined{fax}} \define@key{isodoc}{website} {\def\website{#1}} - \def\website{\Undefined{website}} + \def\website{} + \def\@website{\Undefined{website}} \define@key{isodoc}{email} {\def\email{#1}} - \def\email{\Undefined{email}} + \def\email{} + \def\@email{\Undefined{email}} % \end{macrocode} % \subsubsection{Folding mark} % \DescribeMacro{nofold} @@ -1340,18 +1359,27 @@ Execute the inst script with the --help option for more information. % \end{macrocode} % \subsubsection{Closing, autograph, signature} % \DescribeMacro{closing} -% \DescribeMacro{closingskip} % The closing, something like `Best regards', is set by the |closing| option; -% the default is `Undefined closing'. It will be preceded by a vertical skip, -% which can be set by the |closingskip| option, which is |2\baselineskip| by -% default: +% the default is `Undefined closing'. It will be separated from the text with whitespace, +% which can be changed, preferably in a style file, with the |closingskip| length, which is +% |2\baselineskip| by default. % \begin{macrocode} \define@key{isodoc}{closing} {\def\closing{#1}} \def\closing{\Undefined{closing}} \define@key{isodoc}{closingcomma}{\def\@closingcomma{#1}} \def\@closingcomma{,} -\define@key{isodoc}{closingskip}{\closingskip=#1} - \newdimen\closingskip\closingskip=2\baselineskip +\define@key{isodoc}{closingskip}{\ClassError{isodoc}{The closingskip option has been removed + in version 1.04; instead set the signatureskip length, + preferably in a style file}} +% \end{macrocode} +% Some skips/booleans defined here to make it easier to redefine them in a style file. +% They precede the closing, copyto and enclosers and have no corresponding options (yet). +% \begin{macrocode} + \newdimen\closingskip\closingskip=\baselineskip + \newdimen\signatureskip\signatureskip=2\baselineskip + \newdimen\copytoskip\copytoskip=\baselineskip + \newdimen\enclosureskip\enclosureskip=\baselineskip + \newif\ifencldown\encldownfalse % \end{macrocode} % \DescribeMacro{autograph} % The autograph is either just a newline, or a vertical spacing where you can @@ -1827,9 +1855,11 @@ Execute the inst script with the --help option for more information. \ifx\phone \empty\else\def\@phone {\isodoc@lead\phone} \fi \ifx\cellphone\empty\else\def\@cellphone{\isodoc@lead\cellphone}\fi \ifx\fax \empty\else\def\@fax {\isodoc@lead\fax} \fi + \ifx\website \empty\else\def\@website {\website} \fi + \ifx\email \empty\else\def\@email {\email} \fi % \end{macrocode} % By now, a language should have been chosen; if not, issue a warning -% and set the language to the default: -n-GB +% and set the language to the default: -en-GB % \begin{macrocode} \ifx\yourlettertext\undefined% \ClassWarning{isodoc}{You did not use the language option; using the default: en-GB} @@ -1915,11 +1945,11 @@ Execute the inst script with the --help option for more information. \footcount=35 \iffooter \ForEachX{;}{% - \setbox0=\hbox{\csname\thislevelitem\endcsname} + \setbox0=\hbox{\csname @\thislevelitem\endcsname} \ifdim\wd0=0pt\else \Tbox{\footcount}{\footerpos}{35}{\noindent {\@hft\csname\thislevelitem text\endcsname}\\ - \csname\thislevelitem\endcsname + \csname @\thislevelitem\endcsname } \fi \advance\footcount35 @@ -1935,12 +1965,12 @@ Execute the inst script with the --help option for more information. \vspace{\textskip mm} \thispagestyle{empty} \noindent\ignorespaces#2 - \ifclosing - \par\noindent\begin{minipage}[t]{\hsize} - \parindent=0pt\parskip=\baselineskip + \ifclosing{\\[\closingskip] + \parindent=0pt\parskip=\baselineskip\noindent + \begin{minipage}[t]{\hsize} \ifcase\autographversion \par\closing\@closingcomma\\\signature % 0: closing on the next line - \or\par\closing\@closingcomma\\[\closingskip]\signature % 1: whiteskip + \or\par\closing\@closingcomma\\[\signatureskip]\signature % 1: whiteskip \or\autographA \or\autographB \or\autographC @@ -1953,25 +1983,23 @@ Execute the inst script with the --help option for more information. \par\Undefined{autograph: \autographversion}\\ \fi \end{minipage} - \fi - \ifx\enclosures\empty\else - \par\noindent\begin{minipage}[t]{\hsize} - \parindent=0pt\parskip=\baselineskip - \vfill + }\fi + \ifencldown\vspace*{\fill}\fi + \ifx\enclosures\empty\else{\\[\enclosureskip] + \noindent + \begin{minipage}[t]{\hsize} \setbox1=\vbox{\enclosures}% - \textbf{\ifdim\ht1>\baselineskip\enclosurestext\else\enclosuretext\fi}% - \\\enclosures + \textbf{\ifdim\ht1>\baselineskip\enclosurestext\else\enclosuretext\fi}\\ + \enclosures \end{minipage} - \fi - \ifx\copyto\empty\else - \par\noindent\begin{minipage}[t]{\hsize} - \parindent=0pt\parskip=\baselineskip - \ifx\enclosures\empty\vfill\else\\[2ex]\fi - \setbox1=\vbox{\copyto}% - \textbf{\copytotext}% - \\\copyto + }\fi + \ifx\copyto\empty\else{\\[\copytoskip] + \noindent + \begin{minipage}[t]{\hsize} + \textbf{\copytotext}\\ + \copyto \end{minipage} - \fi + }\fi \label{LastPageOf\thelettercount} }} % \end{macrocode} |