diff options
author | Karl Berry <karl@freefriends.org> | 2010-01-03 23:20:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-01-03 23:20:42 +0000 |
commit | bc4228893e34a9b147b3d349b63f0f28743232b3 (patch) | |
tree | 65c25c6552d564a3167b249df3328d8b6aba6ee2 /Master/texmf-dist/tex | |
parent | 96662256e48807dae530a28c31a897821d23edeb (diff) |
isodoc update (3jan10)
git-svn-id: svn://tug.org/texlive/trunk@16590 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/isodoc/isodoc.cls | 173 |
1 files changed, 111 insertions, 62 deletions
diff --git a/Master/texmf-dist/tex/latex/isodoc/isodoc.cls b/Master/texmf-dist/tex/latex/isodoc/isodoc.cls index fede225ce71..ca288b554f0 100644 --- a/Master/texmf-dist/tex/latex/isodoc/isodoc.cls +++ b/Master/texmf-dist/tex/latex/isodoc/isodoc.cls @@ -22,33 +22,40 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{isodoc}% - [2009/06/15 v0.6 isodoc class for letters and invoices] + [2009/11/16 v0.7 isodoc class for letters and invoices] \ifnum\pdfoutput=1\else\ClassError{isodoc}{Compile me with pdflatex!}{} \fi %% \StopEventually{} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions \LoadClass{article} -\RequirePackage{ctable,marvosym,graphicx} -\RequirePackage[dutch,german,french,american,english]{babel} -\RequirePackage[a4paper,margin=35mm,head=\baselineskip]{geometry} +\RequirePackage{ctable,eurosym,graphicx,stringstrings} +\RequirePackage[dutch,norsk,german,frenchb,american,english]{babel} +\RequirePackage[a4paper,margin=35mm,nofoot,head=\baselineskip]{geometry} \RequirePackage[absolute,overlay]{textpos} \ifdim\paperwidth>\paperheight\TPGrid{297}{210}\else\TPGrid{210}{297}\fi +\definecolor{headcolor}{gray}{0} +\definecolor{headingcolor}{gray}{0} +\definecolor{markercolor}{gray}{0} \RequirePackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \if@twoside - \fancyhead[LE,RO]{\pagetext\ \thepage\ \oftext{} \pageref{LastPageOf\thelettercount}} - \fancyhead[RE,LO]{\totext: \toname\ (\date)} + \fancyhead[LE,RO]{\color{headingcolor}% + \pagetext\ \thepage\ \oftext{} \pageref{LastPageOf\thelettercount}} + \fancyhead[RE,LO]{\color{headingcolor}% + \totext: \toname\ (\date)} \else - \fancyhead[L]{\totext: \toname\ (\date)} - \fancyhead[R]{\pagetext\ \thepage\ \oftext{} \pageref{LastPageOf\thelettercount}} + \fancyhead[L]{\color{headingcolor}% + \totext: \toname\ (\date)} + \fancyhead[R]{\color{headingcolor}% + \pagetext\ \thepage\ \oftext{} \pageref{LastPageOf\thelettercount}} \fi \newif\ifpreamble\preambletrue \AtBeginDocument{\preamblefalse} \definecolor{isodocpink}{rgb}{1,.7,.7} \def\Undefined#1{\colorbox{isodocpink}{Undefined #1}} -\def\@hft{\footnotesize\sffamily} +\def\@hft{\footnotesize\sffamily\color{headcolor}} \define@key{isodoc}{fontpackage}{\def\fontpackage{#1}} \def\fontpackage{lmodern} \def\@xyshift#1,#2@@@{\def\@xshift{#1}\def\@yshift{#2}} @@ -68,6 +75,7 @@ \define@key{isodoc}{german} []{\germandoc} \define@key{isodoc}{american}[]{\americandoc} \define@key{isodoc}{french} []{\frenchdoc} +\define@key{isodoc}{norwegian} []{\norwegiandoc} \define@key{isodoc}{fill} []{\rightskip=1\rightskip} \define@key{isodoc}{nofill}[]{\rightskip=0mm plus 35mm} \rightskip=0mm plus 35mm @@ -92,6 +100,8 @@ \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}{to}{\processto{#1}}\def\toname{Various people} \def\toaddress{\Undefined{to}} \long\def\processto#1{\xproc #1\\@@@\ifx\toaddress\empty @@ -102,6 +112,12 @@ \newif\ifreturn\returnfalse \define@key{isodoc}{noreturn} []{\returnfalse} \define@key{isodoc}{returnaddress}{\def\returnaddress{#1}} +\define@key{isodoc}{header} []{\headertrue} + \newif\ifheader\headertrue +\define@key{isodoc}{noheader}[]{\headerfalse} +\define@key{isodoc}{bodyshift} {\advance\headerpos#1\advance\bodyskip#1mm} + \newdimen\bodyskip\bodyskip=0mm +\newcount\headerpos\headerpos=98 \define@key{isodoc}{footer} []{\footertrue} \newif\iffooter\footerfalse \define@key{isodoc}{nofooter}[]{\footerfalse} @@ -122,6 +138,9 @@ \def\lead{\ifforeign+\areacode-\else\phoneprefix\fi} \define@key{isodoc}{nofold}[]{\yfold=-1mm} \newdimen\yfold\yfold=-1mm +\define@key{isodoc}{foldleft}[]{\xfold=9mm} + \newdimen\xfold\xfold=201mm +\define@key{isodoc}{foldright}[]{\xfold=201mm} \define@key{isodoc}{fold2}[]{\yfold=158mm} \define@key{isodoc}{fold3}[]{\yfold=107mm} \define@key{isodoc}{fold}{\yfold=#1mm} @@ -131,34 +150,18 @@ \def\yourref{} \define@key{isodoc}{yourletter}{\def\yourletter{#1}} \def\yourletter{} -\define@key{isodoc}{date}{\setdate{#1}} +\define@key{isodoc}{date}{\@isomakedate{#1}} \def\date{\Undefined{date}} +\define@key{isodoc}{forcedate}{\def\forcedate{#1}}\def\forcedate{} \define@key{isodoc}{subject}{\def\subject{#1}} \def\subject{} -\def\checkdigit#1{% - \ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi - \ClassError{test}{non-digit-character (#1) in date}{} - \fi -} -\def\newdate#1#2#3#4#5#6#7#8#9\wybo{% - \checkdigit{#1}\checkdigit{#2}\checkdigit{#3}\checkdigit{#4} - \checkdigit{#5}\checkdigit{#6}\checkdigit{#7}\checkdigit{#8} - \ifx\relax#9\relax - \year=#1#2#3#4\month=#5#6\day=#7#8 - \ifnum \month > 12 \ClassError{isodoc}{Illegal date }{}\fi - \ifnum \day > 31 \ClassError{isodoc}{Illegal date }{}\fi - \else - \ClassError{isodoc}{Date must have exactly 8 digits}{} - \fi -} -\def\wybo{} -\def\setdate#1{\newdate #1\wybo\wybo\wybo\wybo\wybo\wybo\wybo\wybo\wybo} +\newcount\openingpos \define@key{isodoc}{opening} {\def\opening{#1}} \def\openingcomma{,} \define@key{isodoc}{openingcomma}{\def\openingcomma{#1}} \def\opening{\Undefined{opening}} \define@key{isodoc}{closing} {\def\closing{#1,}} - \def\closing{\Undefined{closing}} % Best regards, + \def\closing{\Undefined{closing}} % Best regards, \define@key{isodoc}{closingskip}{\closingskip=#1} \newdimen\closingskip\closingskip=2\baselineskip \define@key{isodoc}{autograph}[2]{\def\autographversion{#1}} @@ -240,7 +243,7 @@ \end{textblock} } \Tbox{140}{22}{35}{\noindent - \@hft + \footnotesize\sffamily \ifx\undefined\logoaddress% \ifx\undefined\tbfigures\else\tbfigures\fi \ifx\who\empty\else\who\\\fi @@ -263,6 +266,39 @@ \RequirePackage[T1]{fontenc} \RequirePackage{\fontpackage}\pdfprotrudechars=1 } +\newcount\@isoyear \@isoyear=\year \year=0 +\newcount\@isomonth \@isomonth=\month +\newcount\@isoday \@isoday=\day +\def\@isomakedate#1{% + \def\@isoarg{#1}\def\@isotoday{today} + \ifx\@isoarg\@isotoday + \year=\@isoyear + \month=\@isomonth + \day=\@isoday + \else + \stringlength[q]{\@isoarg} + \ifnum\theresult=10 + \substring[q]{\@isoarg}{5}{5} + \if\thestring-\else\ClassError{isodoc}{ + Illegal date separator: \thestring (must be -)}{}\fi + \substring[q]{\@isoarg}{8}{8} + \if\thestring-\else\ClassError{isodoc}{ + Illegal date separator: \thestring (must be -)}{}\fi + \else + \ifnum\theresult=8\else\ClassError{isodoc}{ + Illegal date: not yyyymmdd | yyyy-mm-dd | today}{}\fi + \fi + \Treatments{0}{0}{0}{1}{0}{0} + \substring[q]{\@isoarg}{1}{$} \let\@isodigits=\thestring \def\@isoarg{\thestring} + \stringlength[q]{\@isodigits} + \ifnum\theresult=8\else\ClassError{isodoc}{Illegal date: must have 8 digits}{}\fi + \substring[q]{\@isoarg}{1}{4} \year=\thestring \def\@isoarg{\@isodigits} + \substring[q]{\@isoarg}{5}{6} \month=\thestring \def\@isoarg{\@isodigits} + \substring[q]{\@isoarg}{7}{8} \day=\thestring \def\@isoarg{\@isodigits} + \ifnum \month > 12 \ClassError{isodoc}{Illegal date: month>12}{}\fi + \ifnum \day > 31 \ClassError{isodoc}{Illegal date: day>31}{}\fi + \fi +} \def\footfield#1#2#3{% \ifx#3\empty\else \Tbox{\footcount}{275}{35}{\noindent @@ -310,6 +346,7 @@ accountname & \accountname\NN accountno & \accountno\NN addresscenter & \addresscenter\NN + addresswidth & \addresswidth\NN areacode & \areacode\NN autograph & \autograph\NN bic & \bic\NN @@ -325,6 +362,7 @@ enclosures & \enclosures\NN fax & \fax\NN fontpackage & \fontpackage\NN + forcedate & \forcedate\NN iban & \iban\NN leftaddress & \leftaddress\NN logoaddress & \logoaddress\NN @@ -352,15 +390,15 @@ \usepackage{hyperref} \year=0 } -\AtBeginDocument{% +\AtEndDocument{% \hypersetup{pdfauthor={\who}, - pdfsubject={\subject}, pdfproducer={isodoc v\fileversion}, } } \def\itable#1{ \begin{tabularx}{\hsize}{@{}X@{\barsep\quad\qquad}r@{}} - \multicolumn{2}{@{}c@{}}{\sffamily\descriptiontext\hfill \amounttext (\currency)}\ML + \multicolumn{2}{@{}c@{}}{\sffamily\descriptiontext\hfill + \amounttext (\currency)}\ML #1 \end{tabularx} } @@ -372,15 +410,15 @@ \newcount\footcount \newcommand{\invoice}[2][]{% \closingfalse - \hypersetup{pdftitle={invoice to \toname\ dated \today}} \def\barsep{\raisebox{-1.5ex}[0pt][0pt]{\rule{.05em}{4ex}}}% \letter[#1,opening=\invoicetext,openingcomma={},closing={},signature={}]{% \Tbox{35}{127}{140}{#2} } } \newcommand{\letter}[2][]{{ % extra brace keeps option changes local - \hypersetup{pdftitle={letter to \toname\ dated \today}} \setkeys{isodoc}{#1} + \hypersetup{pdftitle={letter to \toname\ dated \today}, + pdfsubject={\subject}} \label{LastPageOf\thelettercount} \newpage \addtocounter{lettercount}{1} @@ -388,39 +426,48 @@ \setcounter{footnote}{0} \logo { \parskip=0pt\parindent=0pt - \begin{textblock}{70}[0,.5](\xaddress,\addresscenter)% + \begin{textblock}{\addresswidth}[0,.5](\xaddress,\addresscenter)% \ifreturn {\def\\{\unskip\enspace\textbullet\enspace\ignorespaces}% - \sffamily\scriptsize\bfseries\returnaddress + \sffamily\bfseries\scriptsize\returnaddress }\\[-.8\baselineskip] \rule{\hsize}{.2pt}\\ \fi \toname\\\toaddress \end{textblock} } - \ifx\subject\empty\else% - \Tbox{35}{108}{105}{\noindent - \begin{tabularx}{\hsize}{@{}l>{\raggedright}X@{}} - \@hft\subjecttext&\subject - \end{tabularx} + \openingpos=\headerpos + \ifheader + \advance\openingpos12 + \advance\bodyskip12mm + \Tbox{35}{\headerpos}{35}{\noindent + {\@hft\yourlettertext}\\ + \yourletter } + \Tbox{70}{\headerpos}{35}{\noindent + {\@hft\yourreftext}\\ + \raggedright\yourref + } + \Tbox{105}{\headerpos}{35}{\noindent + {\@hft\ourreftext}\\ + \raggedright\ourref + } + \Tbox{140}{\headerpos}{35}{\noindent + {\@hft\datetext}\\ + \ifx\forcedate\empty% + \ifnum\year=0\Undefined{date}\else\date\fi + \else\forcedate\fi + } + \ifx\subject\empty\else% + \advance\openingpos10 + \advance\bodyskip10mm + \Tbox{35}{108}{105}{\noindent + \begin{tabularx}{\hsize}{@{}l>{\raggedright}X@{}} + \@hft\subjecttext&\subject + \end{tabularx} + } + \fi \fi - \Tbox{35}{98}{35}{\noindent - {\@hft\yourlettertext}\\ - \yourletter - } - \Tbox{70}{98}{35}{\noindent - {\@hft\yourreftext}\\ - \raggedright\yourref - } - \Tbox{105}{98}{35}{\noindent - {\@hft\ourreftext}\\ - \raggedright\ourref - } - \Tbox{140}{98}{35}{\noindent - {\@hft\datetext}\\ - \ifnum\year=0\Undefined{date}\else\date\fi - } \footcount=35 \iffooter \footfield{\websitetext}{}{\website} @@ -430,8 +477,8 @@ \footfield{\emailtext}{}{\email} \fi { \parskip=0pt\parindent=0pt - \begin{textblock*}{3mm}(201mm,\yfold)% - \rule{\hsize}{.2pt} + \begin{textblock*}{3mm}(\xfold,\yfold)% + {\color{markercolor}\rule{\hsize}{.2pt}} \end{textblock*} } \ifx\undefined\accepttype\else\accept\fi @@ -527,7 +574,9 @@ {\wacceptct} {\ocrb\acceptcents} } -\def\set@lang#1{\ifpreamble\AtBeginDocument{\selectlanguage{#1}}\else\selectlanguage{#1}\fi} +\def\set@lang#1{% + \ifpreamble\AtBeginDocument{\selectlanguage{#1}}% + \else\selectlanguage{#1}\fi} \def\dutchdoc{% \set@lang{dutch} \def\yourlettertext{Uw brief van} @@ -718,7 +767,7 @@ \def\Vattext{T.V.A.} \def\Totaltext{Total} } -\def\norskdoc{% +\def\norwegiandoc{% \set@lang{norsk} \def\yourlettertext{Deres brev av} \def\yourreftext{Deres ref:} |