diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-31 22:28:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-31 22:28:02 +0000 |
commit | 8e334f60a6c746a40471e99900181d7ca3b06ccc (patch) | |
tree | 9820ada46e0fe16bacffc76206cd5d406a2a7f54 /Master/texmf-dist/source/latex | |
parent | 9e47118de1279ba0a04f879b2bf3f29f07bbe0fc (diff) |
isodoc (31jan14)
git-svn-id: svn://tug.org/texlive/trunk@32833 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/isodoc/isodoc.dtx | 199 |
1 files changed, 114 insertions, 85 deletions
diff --git a/Master/texmf-dist/source/latex/isodoc/isodoc.dtx b/Master/texmf-dist/source/latex/isodoc/isodoc.dtx index 5bf62b5c6ff..4049de35da6 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> - [2013/11/26 v1.02 isodoc class for letters and invoices] + [2014/02/01 v1.03 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!}{} @@ -237,7 +237,7 @@ Execute the inst script with the --help option for more information. % - added pdfauthor and pdfcreator (isodoc) to pdf-comment\\ % - reorganized documentation directory and install script % } -% \changes{v1.01}{2013/11/22}{ +% \changes{v1.01}{2013/11/26}{ % - vattext was missing in all language files\\ % - aus $\Rightarrow$ von; subjecttext $\Rightarrow$ empty for de-DE\\ % - closing parts in minipages for better page break\\ @@ -248,6 +248,15 @@ Execute the inst script with the --help option for more information. % - more instructions for first line of address\\ % - phone number prefix +nn\textbackslash, instead of +nn{-}- % } +% \changes{v1.02}{2013/11/22}{ +% - installing in correct dirs, so texdoc finds the doc\\ +% - more comment +% } +% \changes{v1.03}{2014/02/01}{ +% - added logo and nologo options\\ +% - changed definitions for fancy headings and footings to allow for easy +% adaptation in style files. +% } % \DoNotIndex{% % \ , \", \', \@auxout, \AtBeginDocument, \AtEndDocument, \Cbox, \CurrentOption, % \DeclareOption, \DescribeMacro, \LARGE, \Large, \LoadClass, \ML, \NN, @@ -407,8 +416,13 @@ Execute the inst script with the --help option for more information. % You can define the latter either explicitly with the \T{logoaddress} option, % or let it automatically be created from the contents of the options \T{who}, \T{street}, % \T{prezip}, \T{zip}, \T{city}, \T{country}, and \T{foreign}, as far as you have defined those. -% Definition in parts can be useful if you need -% them elsewhere in your document.}{ +% Definition in parts can be useful if you need them elsewhere in your document.}{ +% \T{logo} & Switches the logo on; this is the default, but still useful if +% you have used the |nologo| option in your style file.\NN +% \T{nologo} & Switches the logo off. This is useful if you have defined your +% own logo and have letter paper preprinted with that logo. You can +% then use |nologo| for the paper version and |logo| for a \textsc{pdf} +% to be sent by email.\NN % \T{company = ...} & Your company name as it should appear in the logo (if % you use the default logo) and in the return address % (where it may get overridden by the \T{returnaddress} @@ -970,7 +984,7 @@ Execute the inst script with the --help option for more information. % |color|, and |xkeyval|. |eurosym| is used for the euro symbol. % \begin{macrocode} \RequirePackage{ctable,color,tabularx,graphicx,xstring,calc} -\RequirePackage{forarray} +\RequirePackage{forarray,longtable} % \end{macrocode} % % Since the name of the package contains 'iso', make the page A4. @@ -1010,7 +1024,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{\colorbox{isodocpink}{Undefined #1}} +\def\Undefined#1{\fboxsep1pt\colorbox{isodocpink}{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 @@ -1093,9 +1107,13 @@ Execute the inst script with the --help option for more information. % hanging under the rule. % Its contents are defined by the following options: % \begin{macrocode} +\define@key{isodoc}{logo}[\@isodoclogotrue]{\@isodoclogotrue} +\define@key{isodoc}{nologo}[\@isodoclogofalse]{\@isodoclogofalse} + \newif\if@isodoclogo\@isodoclogotrue \define@key{isodoc}{company} {\def\company{#1}} \def\company{\Undefined{company}} \define@key{isodoc}{logoaddress}{\def\logoaddress{#1}} + \def\logoaddress{} \define@key{isodoc}{who} {\def\who{#1}} \def\who{\Undefined{who}} \define@key{isodoc}{street} {\def\street{#1}} @@ -1126,10 +1144,10 @@ Execute the inst script with the --help option for more information. \define@key{isodoc}{leftaddress} []{\def\xaddress{35}} \def\xaddress{35} \define@key{isodoc}{rightaddress}[]{\def\xaddress{105}} -\define@key{isodoc}{addresscenter} {\def\addresscenter{#1}} - \def\addresscenter{63.5} -\define@key{isodoc}{addresswidth} {\def\addresswidth{#1}} - \def\addresswidth{70} +\define@key{isodoc}{addresscenter} {\def\@addresscenter{#1}} + \def\@addresscenter{63.5} +\define@key{isodoc}{addresswidth} {\def\@addresswidth{#1}} + \def\@addresswidth{70} % \end{macrocode} % \DescribeMacro{to} % The |to| option takes the addressee's address lines. Use |\\| to @@ -1195,8 +1213,8 @@ Execute the inst script with the --help option for more information. % A footer is switched on or off with the |footer| and |nofooter| options. % The default is the have no footer. % \begin{macrocode} -\define@key{isodoc}{footorder} {\def\footorder{#1}} - \def\footorder{website;phone;cellphone;email} +\define@key{isodoc}{footorder} {\def\@footorder{#1}} + \def\@footorder{website;@phone;@cellphone;email} \define@key{isodoc}{footer} []{\footertrue} \newif\iffooter\footerfalse \define@key{isodoc}{nofooter}[]{\footerfalse} @@ -1217,17 +1235,17 @@ Execute the inst script with the --help option for more information. % \begin{macrocode} \define@key{isodoc}{areacode} {\def\areacode{#1}} \def\areacode{\Undefined{areacode}} -\define@key{isodoc}{phone} {\def\isodoc@phone{#1}} - \def\isodoc@phone{} - \def\phone{\Undefined{phone}} \define@key{isodoc}{phoneprefix}{\def\phoneprefix{#1}} \def\phoneprefix{0} -\define@key{isodoc}{cellphone} {\def\isodoc@cellphone{#1}} - \def\isodoc@cellphone{} - \def\cellphone{\Undefined{cellphone}} -\define@key{isodoc}{fax} {\def\isodoc@fax{#1}} - \def\isodoc@fax{} - \def\fax{\Undefined{fax}} +\define@key{isodoc}{phone} {\def\phone{#1}} + \def\phone{} + \def\@phone{\Undefined{@phone}} +\define@key{isodoc}{cellphone} {\def\cellphone{#1}} + \def\cellphone{} + \def\@cellphone{\Undefined{@cellphone}} +\define@key{isodoc}{fax} {\def\fax{#1}} + \def\fax{} + \def\@fax{\Undefined{@fax}} \define@key{isodoc}{website} {\def\website{#1}} \def\website{\Undefined{website}} \define@key{isodoc}{email} {\def\email{#1}} @@ -1300,7 +1318,7 @@ Execute the inst script with the --help option for more information. % If you know what you do you can substitute anything you like for the date by % using the |forcedate| option instead of |date|: % \begin{macrocode} -\define@key{isodoc}{forcedate}{\def\forcedate{#1}}\def\forcedate{} +\define@key{isodoc}{forcedate}{\def\@forcedate{#1}}\def\@forcedate{} % \end{macrocode} % \DescribeMacro{subject} % The subject is empty by default and will be typeset only if you give it a value. @@ -1317,8 +1335,8 @@ Execute the inst script with the --help option for more information. % \begin{macrocode} \define@key{isodoc}{opening} {\def\opening{#1}} \def\opening{\Undefined{opening}} -\define@key{isodoc}{openingcomma}{\def\openingcomma{#1}} - \def\openingcomma{,} +\define@key{isodoc}{openingcomma}{\def\@openingcomma{#1}} + \def\@openingcomma{,} % \end{macrocode} % \subsubsection{Closing, autograph, signature} % \DescribeMacro{closing} @@ -1330,8 +1348,8 @@ Execute the inst script with the --help option for more information. % \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}{closingcomma}{\def\@closingcomma{#1}} + \def\@closingcomma{,} \define@key{isodoc}{closingskip}{\closingskip=#1} \newdimen\closingskip\closingskip=2\baselineskip % \end{macrocode} @@ -1379,6 +1397,7 @@ Execute the inst script with the --help option for more information. % payment: % \begin{macrocode} \define@key{isodoc}{term} [30]{\def\term{#1}} + \def\term{} \define@key{isodoc}{accountno} {\def\accountno{#1}} \define@key{isodoc}{routingno} {\def\routingno{#1}} \define@key{isodoc}{accountname}{\def\accountname{#1}} @@ -1522,7 +1541,7 @@ Execute the inst script with the --help option for more information. \setlength{\iso@signpos}{#2*(#4-#3)/100} \hspace*{\iso@outdent}\raisebox{\iso@down}[0pt][0pt]{\includegraphics[height=#2]{#6}}% \\[\baselineskip]% - \closing\closingcomma\\[\iso@signpos]\\[-2\baselineskip]% + \closing\@closingcomma\\[\iso@signpos]\\[-2\baselineskip]% \signature% } } @@ -1535,7 +1554,7 @@ Execute the inst script with the --help option for more information. % \DescribeMacro{\logo} % \begin{macrocode} \newcommand{\zippedcity}{\ifcityzip\city\ \prezip\ \zip\else\prezip\ \zip\ \city\fi} -\newcommand{\logo}{% +\newcommand{\logo}{\if@isodoclogo% { \parskip=0pt\parindent=0pt \begin{textblock}{140}[0,1](35,20)% \textsf{\LARGE\company}\\[-1.7ex] % large company name @@ -1544,14 +1563,14 @@ Execute the inst script with the --help option for more information. } \Tbox{140}{22}{35}{\noindent \footnotesize\sffamily - \ifx\undefined\logoaddress% + \ifx\empty\logoaddress% \ifx\undefined\tbfigures\else\tbfigures\fi \ifx\who\empty\else\who\\\fi \ifx\street\empty\else\street\\\fi \zippedcity \ifforeign\\\country\fi \else\logoaddress\fi - } + }\fi } % \end{macrocode} % \DescribeMacro{\returnaddress} @@ -1616,9 +1635,9 @@ Execute the inst script with the --help option for more information. % was used. % \begin{macrocode} \def\date{% - \ifx\forcedate\empty% + \ifx\@forcedate\empty% \ifnum\year=0\Undefined{date}\else\@isodate\fi - \else\forcedate\fi + \else\@forcedate\fi } % \end{macrocode} % \DescribeMacro{\accountdata} @@ -1627,7 +1646,7 @@ Execute the inst script with the --help option for more information. \def\accountdata{ \textbf{\accountdatatext:}\\ \begin{tabular}{@{}rl@{}} - \ifx\term\undefined\else + \ifx\term\empty\else \termtext: & \term\ \daystext\\ \fi \ifx\accounto\undefined\else @@ -1658,68 +1677,77 @@ Execute the inst script with the --help option for more information. % current values of most keys. % \DescribeMacro{\showkeys} % \begin{macrocode} +\def\@isodocmp#1{\begin{minipage}[t]{\hsize}\mbox{}#1\\[-1.8ex]\mbox{}\end{minipage}} +\def\@isodocun#1{\ifx#1\undefined (undefined, so not shown)\else#1\fi} \def\showkeys{% - \begin{tabular}{rl} + \begin{longtable}{rl} acceptaccount & \acceptaccount\NN acceptaddress & \acceptaddress\NN acceptcents & \acceptcents\NN - acceptdesc & \acceptdesc\NN + acceptdesc & \@isodocmp{\acceptdesc}\NN acceptdescription & \acceptdescription\NN accepteuros & \accepteuros\NN acceptreference & \acceptreference\NN - accountname & \ifx\accountname\undefined (undefined, so not shown)% - \else\accountname\fi\NN - accountno & \ifx\accountno\undefined (undefined, so not shown)% - \else\accountno\fi\NN + accountname & \@isodocun{\accountname}\NN + accountno & \@isodocun{\accountno}\NN areacode & \areacode\NN - bic & \ifx\bic\undefined (undefined, so not shown)% - \else\bic\fi\NN + bic & \@isodocun{\bic}\NN cellphone & \cellphone\NN chamber & \chamber\NN city & \city\NN closing & \closing\NN company & \company\NN + copyto & \@isodocmp{\copyto}\NN country & \country\NN countrycode & \countrycode\NN currency & \currency\NN date & \date\NN email & \email\NN - enclosures & \begin{minipage}[t]{\hsize} - \mbox{}\enclosures\\[-1.5ex] - \end{minipage}\NN - copyto & \begin{minipage}[t]{\hsize} - \mbox{}\copyto \\[-1.5ex] - \end{minipage}\NN + enclosures & \@isodocmp{\enclosures}\NN fax & \fax\NN - iban & \ifx\iban\undefined (undefined, so not shown) - \else\iban\fi\NN + iban & \@isodocun{\iban}\NN + logoaddress & \@isodocmp{\logoaddress}\NN opening & \opening\NN ourref & \ourref\NN phone & \phone\NN - returnaddress & \begin{minipage}[t]{\hsize} - \mbox{}\returnaddress\\[-1.5ex] - \end{minipage}\NN - routingno & \ifx\routingno\undefined (undefined, so not shown) - \else\routingno\fi\NN - signature & \signature\NN + phoneprefix & \phoneprefix\NN + returnaddress & \@isodocmp{\returnaddress}\NN + routingno & \@isodocun{\routingno}\NN + signature & \@isodocmp{\signature}\NN street & \street\NN subject & \subject\NN - toaddress & \begin{minipage}[t]{\hsize} - \mbox{}\toaddress\\[-1.5ex] - \end{minipage}\NN - toname & \toname\NN - vatno & \ifx\vatno\undefined (undefined, so not shown) - \else\vatno\fi\NN + term & \term\NN + vatno & \@isodocun{\vatno}\NN website & \website\NN who & \who\NN yourletter & \yourletter\NN yourref & \yourref\NN zip & \zip\NN - \end{tabular} + \end{longtable} } \AtEndOfClass{% \usepackage{hyperref} } +% \end{macrocode} +% \DescribeMacro{@isodocheadXX} +% We define the heading parts here in order to allow for easy adaptations in style files. +% \begin{macrocode} +\def\@isodocheadL{\totext:{} \toname{} (\date)} +\def\@isodocheadC{} +\def\@isodocheadR{\pagetext\ \thepage\ \oftext{} + \begin{NoHyper}\pageref{LastPageOf\thelettercount}\end{NoHyper} +} +\def\@isodocheadbox#1{\mbox{\color{headingcolor}#1}} +% \end{macrocode} +% \DescribeMacro{@isodocfootXX} +% We define the footing parts here in order to allow for easy adaptations in style files. +% Note that, if you redefine any of these, you will probably have to create some footer +% space with |\geometry{foot}|. +% \begin{macrocode} +\def\@isodocfootL{} +\def\@isodocfootC{} +\def\@isodocfootR{} +% \end{macrocode} % \DescribeMacro{\itable} % |\itable| inserts an invoice table; arg1 should be the rows of the table. % \begin{macrocode} @@ -1730,24 +1758,25 @@ Execute the inst script with the --help option for more information. \ifvertical \begin{tabularx}{\hsize}{@{}X|r@{}}% \sffamily\descriptiontext & - \sffamily \amounttext (\currency)\isodoc@bara\\\hline\\[-5.6ex] + \sffamily \amounttext\,(\currency)\isodoc@bara\\\hline\\[-5.4ex] \isodoc@barb #1% \end{tabularx} \else \begin{tabularx}{\hsize}{@{}Xr@{}}% \sffamily\descriptiontext & - \sffamily \amounttext (\currency)\isodoc@bara\\\hline\\[-5.6ex] + \sffamily \amounttext\,(\currency)\isodoc@bara\\\hline\\[-5.6ex] \isodoc@barb #1% \end{tabularx} \fi } +% \end{macrocode} % \DescribeMacro{\iitem} % |\iitem| inserts an invoice item in the |\itable|. % It inserts |\\arg1 & % arg2|: % \begin{macrocode} \def\iitem#1#2{\\#1\ignorespaces} -% \DescribeMacro{\itotal} % \end{macrocode} +% \DescribeMacro{\itotal} % |\itotal| inserts an invoice total in the |\itable|.\\ % The optional argument replaces |\totaltext|. % \begin{macrocode} @@ -1795,9 +1824,9 @@ Execute the inst script with the --help option for more information. \setcounter{section}{0} \setkeys{isodoc}{#1} \def\isodoc@lead{\ifforeign+\areacode\,\else\phoneprefix\fi} - \ifx\isodoc@phone\empty\else\def\phone{\isodoc@lead\isodoc@phone}\fi - \ifx\isodoc@cellphone\empty\else\def\cellphone{\isodoc@lead\isodoc@cellphone}\fi - \ifx\isodoc@fax\empty\else\def\fax{\isodoc@lead\isodoc@fax}\fi + \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 % \end{macrocode} % By now, a language should have been chosen; if not, issue a warning % and set the language to the default: -n-GB @@ -1818,25 +1847,25 @@ Execute the inst script with the --help option for more information. \setcounter{footnote}{0} \fancyhf{} \if@twoside - \fancyhead[LE,RO]{\color{headingcolor}% - \pagetext\ \thepage\ \oftext{} - \begin{NoHyper}\pageref{LastPageOf\thelettercount}\end{NoHyper}} - \fancyhead[RE,LO]{\color{headingcolor}% - \totext: \toname\ (\date)} + \fancyhead[LE,RO]{\@isodocheadbox{\@isodocheadR}} + \fancyhead[RE,LO]{\@isodocheadbox{\@isodocheadL}} + \fancyfoot[LE,RO]{\@isodocheadbox{\@isodocfootR}} + \fancyfoot[RE,LO]{\@isodocheadbox{\@isodocfootL}} \else - \fancyhead[L]{\color{headingcolor}% - \mbox{\totext: \toname\ (\date)}} - \fancyhead[R]{\color{headingcolor}% - \pagetext\ \thepage\ \oftext{} - \begin{NoHyper}\pageref{LastPageOf\thelettercount}\end{NoHyper}} + \fancyhead[L]{\@isodocheadbox{\@isodocheadL}} + \fancyhead[R]{\@isodocheadbox{\@isodocheadR}} + \fancyfoot[L]{\@isodocheadbox{\@isodocfootL}} + \fancyfoot[R]{\@isodocheadbox{\@isodocfootR}} \fi + \fancyhead[C]{\@isodocheadbox{\@isodocheadC}} + \fancyfoot[C]{\@isodocheadbox{\@isodocfootC}} \logo % \end{macrocode} -% addresscenter is the center, vertically, of the to-address block: +% @addresscenter is the center, vertically, of the to-address block: % xaddress should be 1 or 3 for left- and right address windows % \begin{macrocode} { \parskip=0pt\parindent=0pt - \begin{textblock}{\addresswidth}[0,.5](\xaddress,\addresscenter)% + \begin{textblock}{\@addresswidth}[0,.5](\xaddress,\@addresscenter)% \ifreturn {\def\\{\unskip\enspace\textbullet\enspace\ignorespaces}% \sffamily\bfseries\scriptsize\returnaddress @@ -1881,7 +1910,7 @@ Execute the inst script with the --help option for more information. \advance\textskip-12 \fi % \end{macrocode} -% Create the footfields that occur in |\footorder|, starting at the left; +% Create the footfields that occur in |\@footorder|, starting at the left; % \begin{macrocode} \footcount=35 \iffooter @@ -1894,7 +1923,7 @@ Execute the inst script with the --help option for more information. } \fi \advance\footcount35 - }{\footorder} + }{\@footorder} \fi { \parskip=0pt\parindent=0pt \begin{textblock*}{3mm}(\xfold,\yfold)% @@ -1902,7 +1931,7 @@ Execute the inst script with the --help option for more information. \end{textblock*} } \ifx\undefined\accepttype\else\accept\fi - \noindent\Tbox{35}{\openingpos}{140}{\opening\openingcomma} + \noindent\Tbox{35}{\openingpos}{140}{\opening\@openingcomma} \vspace{\textskip mm} \thispagestyle{empty} \noindent\ignorespaces#2 @@ -1910,8 +1939,8 @@ Execute the inst script with the --help option for more information. \par\noindent\begin{minipage}[t]{\hsize} \parindent=0pt\parskip=\baselineskip \ifcase\autographversion - \par\closing\closingcomma\\\signature % 0: closing on the next line - \or\par\closing\closingcomma\\[\closingskip]\signature % 1: whiteskip + \par\closing\@closingcomma\\\signature % 0: closing on the next line + \or\par\closing\@closingcomma\\[\closingskip]\signature % 1: whiteskip \or\autographA \or\autographB \or\autographC |