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/tex | |
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/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/isodoc/isodoc.cls | 161 |
1 files changed, 82 insertions, 79 deletions
diff --git a/Master/texmf-dist/tex/latex/isodoc/isodoc.cls b/Master/texmf-dist/tex/latex/isodoc/isodoc.cls index d9689397b54..870e1def5fd 100644 --- a/Master/texmf-dist/tex/latex/isodoc/isodoc.cls +++ b/Master/texmf-dist/tex/latex/isodoc/isodoc.cls @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{isodoc}% - [2013/11/26 v1.02 isodoc class for letters and invoices] + [2014/02/01 v1.03 isodoc class for letters and invoices] \ifx\pdfoutput\undefined\else% \ifnum\pdfoutput=1\else\ClassError{isodoc}{Compile me with pdflatex or xelatex!}{} \fi\fi @@ -37,7 +37,7 @@ \ProcessOptions \LoadClass{article} \RequirePackage{ctable,color,tabularx,graphicx,xstring,calc} -\RequirePackage{forarray} +\RequirePackage{forarray,longtable} \RequirePackage[nofoot,head=\baselineskip]{geometry} \RequirePackage[absolute,overlay]{textpos} \geometry{papersize={210mm,297mm},margin=35mm} @@ -49,7 +49,7 @@ \pagestyle{fancy} \AtBeginDocument{\addtolength{\headheight}{\baselineskip}} \definecolor{isodocpink}{rgb}{1,.7,.7} -\def\Undefined#1{\colorbox{isodocpink}{Undefined #1}} +\def\Undefined#1{\fboxsep1pt\colorbox{isodocpink}{Undefined #1}} \def\@hft{\footnotesize\sffamily\color{headcolor}} \def\@xyshift#1,#2@@@{\def\@xshift{#1}\def\@yshift{#2}} \define@key{isodoc}{shift}{% @@ -73,9 +73,13 @@ \define@key{isodoc}{fill} []{\rightskip=1\rightskip} \define@key{isodoc}{nofill}[]{\rightskip=0mm plus 35mm} \rightskip=0mm plus 35mm +\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}} @@ -92,10 +96,10 @@ \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} \define@key{isodoc}{to}{\processto{#1}}\def\toname{Various people} \def\toaddress{\Undefined{to}} \long\def\processto#1{\xproc #1\\@@@\ifx\toaddress\empty @@ -115,24 +119,24 @@ \newcount\subjectpos \newcount\openingpos \newcount\textskip -\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} \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}} @@ -152,17 +156,17 @@ \define@key{isodoc}{yourletter}{\def\yourletter{#1}} \def\yourletter{} \define@key{isodoc}{date}{\@isomakedate{#1}} -\define@key{isodoc}{forcedate}{\def\forcedate{#1}}\def\forcedate{} +\define@key{isodoc}{forcedate}{\def\@forcedate{#1}}\def\@forcedate{} \define@key{isodoc}{subject}{\def\subject{#1}} \def\subject{} \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{,} \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 \define@key{isodoc}{autograph}[2]{\def\autographversion{#1}} @@ -174,6 +178,7 @@ \define@key{isodoc}{copyto} {\def\copyto{#1}} \def\copyto{} \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}} @@ -254,12 +259,12 @@ \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% } } \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 @@ -268,14 +273,14 @@ } \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 } \def\returnaddress{% \ifx\undefined\tbfigures\else\tbfigures\fi % when using osf-txfonts... just for me @@ -307,14 +312,14 @@ \ifnum\day > 31 \ClassError{isodoc}{Illegal date: day>31}{}\fi } \def\date{% - \ifx\forcedate\empty% + \ifx\@forcedate\empty% \ifnum\year=0\Undefined{date}\else\@isodate\fi - \else\forcedate\fi + \else\@forcedate\fi } \def\accountdata{ \textbf{\accountdatatext:}\\ \begin{tabular}{@{}rl@{}} - \ifx\term\undefined\else + \ifx\term\empty\else \termtext: & \term\ \daystext\\ \fi \ifx\accounto\undefined\else @@ -340,68 +345,66 @@ \fi \end{tabular} } +\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} } +\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}} +\def\@isodocfootL{} +\def\@isodocfootC{} +\def\@isodocfootR{} \def\isodoc@bara{\raisebox{-1ex}{\rule{0pt}{3ex}}} \def\isodoc@barb{\rule{0pt}{2.7ex}} \def\isodoc@barc{\rule{0pt}{1ex}} @@ -409,13 +412,13 @@ \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 @@ -440,9 +443,9 @@ \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 \ifx\yourlettertext\undefined% \ClassWarning{isodoc}{You did not use the language option; using the default: en-GB} \isodoc@enGB% @@ -459,21 +462,21 @@ \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 { \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 @@ -528,7 +531,7 @@ } \fi \advance\footcount35 - }{\footorder} + }{\@footorder} \fi { \parskip=0pt\parindent=0pt \begin{textblock*}{3mm}(\xfold,\yfold)% @@ -536,7 +539,7 @@ \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 @@ -544,8 +547,8 @@ \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 |