~ubuntu-branches/ubuntu/maverick/texlive-extra/maverick

« back to all changes in this revision

Viewing changes to texmf-dist/doc/latex/fax/fax.unx

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-05-05 09:18:38 UTC
  • mfrom: (1.1.8 upstream) (3.1.12 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090505091838-n4cyrz5wncwsu0ml
Tags: 2007.dfsg.17-2ubuntu1
* Merge with Debian unstable; remaining Ubuntu changes:
  - Drop texpower Recommends to Suggests. It is in universe, and drags in
    context and xpdf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
% (c) Copyright on FAX.CLS written by J.B.Rhebergen and J.H.M. de Jonge.
2
 
%
3
 
% You are allowed to make modification to this FAX.CLS and redistribute it
4
 
% under the following conditions:
5
 
%   1) You leave this top message intact.
6
 
%   2) You send me an updated version with your changes and an
7
 
%      explanation/motivation.
8
 
%   3) You ask no money for it.
9
 
%
10
 
% This document class comes with no waranty whatsoever! Comments and
11
 
% suggestion are most welcome.
12
 
%
13
 
% Mail me at: J.B.Rhebergen@ET.TUDelft.NL
14
 
%         or: rheberg@morra.et.tudelft.nl
15
 
%
16
 
% Happy Texing!
17
 
%
18
 
% Jan Rhebergen
19
 
%
20
 
\NeedsTeXFormat{LaTeX2e}
21
 
\ProvidesClass{fax}[1995/07/18 v1.0 by: J.B. Rhebergen & J.H.M. de Jonge]
22
 
\IfFileExists{lastpage.sty}{\RequirePackage{lastpage}}{%
23
 
  \typeout{Warning: I did not find lastpage.sty,
24
 
  use \string\setcounter{\string\faxpages}{..} instead!}}
25
 
 
26
 
\newif\if@note\@notefalse
27
 
\newif\if@topsep\@topseptrue
28
 
 
29
 
\newcommand{\slsf}{\sffamily\slshape}
30
 
\newcommand{\bsf}{\sffamily\bfseries}
31
 
 
32
 
\newcommand{\@lstpgno}{%
33
 
  \@ifundefined{r@LastPage}{0}{%
34
 
    \expandafter\expandafter\expandafter
35
 
    \@cdr\csname r@LastPage\endcsname
36
 
    \@nil}%
37
 
}
38
 
 
39
 
\newcommand{\@to}{\typeout{Warning: The \string{\to} command is not defined!}}
40
 
\newcommand{\@from}{\IfFileExists{from.fax}{\input{from.fax}}{%
41
 
  \typeout{Warning: I did not find from.fax, use \string\from{..} in your document!}}}
42
 
\newcommand{\@note}{\IfFileExists{note.fax}{\input{note.fax}}{%
43
 
  \typeout{Warning: I did not find note.fax, use \string\note{..} in your document!}}}
44
 
\newcommand{\@fxtxt}{{\Large\sc Tele-Fax Message}}
45
 
\newcommand{\@dtxt}{Date:}
46
 
\newcommand{\@ntxt}{Note:}
47
 
\newcommand{\@ptxt}{page}
48
 
\newcommand{\@pptxt}{pages}
49
 
 
50
 
\newcommand{\@nothing}{}
51
 
\newcommand{\mymsg}[1]{\renewcommand{\@fxtxt}{#1}}
52
 
\renewcommand{\to}[1]{\renewcommand{\@to}{#1}}
53
 
\newcommand{\from}[1]{\renewcommand{\@from}{#1}}
54
 
\newcommand{\note}[1]{\renewcommand{\@note}{#1}}
55
 
 
56
 
\DeclareOption{dutch}{
57
 
  \renewcommand{\@from}{\IfFileExists{van.fax}{\input{van.fax}}{%
58
 
    \typeout{Warning: I did not find van.fax, use \string\from{..} in your document!}}}
59
 
  \renewcommand{\@note}{\IfFileExists{nb.fax}{\input{nb.fax}}{%
60
 
    \typeout{Warning: I did not find nb.fax, use \string\note{..} in your document!}}}
61
 
  \renewcommand{\@fxtxt}{{\Large\sc Fax Boodschap}}
62
 
  \renewcommand{\@dtxt}{Datum:}
63
 
  \renewcommand{\@ntxt}{NB:}
64
 
  \renewcommand{\@ptxt}{pagina}
65
 
  \renewcommand{\@pptxt}{paginas}}
66
 
 
67
 
\DeclareOption{note}{\@notetrue}
68
 
\DeclareOption{nosep}{\@topsepfalse}
69
 
 
70
 
\DeclareOption*{\IfFileExists{artikel3.cls}
71
 
                 {\PassOptionsToClass{\CurrentOption}{artikel3}}
72
 
                 {\PassOptionsToClass{\CurrentOption}{article}}}
73
 
 
74
 
\ProcessOptions
75
 
 
76
 
\IfFileExists{artikel3.cls}{\LoadClass{artikel3}}{%
77
 
\typeout{Warning: I did not find artikel3.cls, I loaded article.cls instead!}
78
 
\LoadClass{article}}
79
 
 
80
 
\newlength{\faxtopsep}
81
 
\setlength{\faxtopsep}{3ex}
82
 
\newcounter{faxpages}
83
 
 
84
 
\AtBeginDocument{
85
 
\sf
86
 
\newlength{\@framewd}
87
 
\setlength{\@framewd}{\textwidth}
88
 
\newlength{\@sep}
89
 
\setlength{\@sep}{0.5em}
90
 
\addtolength{\@framewd}{-0.5\@sep}
91
 
\newbox\@thin
92
 
\newbox\@frombx
93
 
\newbox\@tobx
94
 
\setbox\@frombx=\hbox{\@from}
95
 
\setbox\@tobx=\hbox{\@to}
96
 
\newdimen\@thinht
97
 
\newdimen\@thindp
98
 
\@thinht=\ht\@frombx
99
 
\@thindp=\dp\@frombx
100
 
\newdimen\@tmpdim
101
 
\@tmpdim=\ht\@tobx
102
 
\ifdim\@tmpdim>\@thinht
103
 
  \@thinht=\@tmpdim
104
 
\fi
105
 
\@tmpdim=\dp\@tobx
106
 
\ifdim\@tmpdim>\@thindp
107
 
  \@thindp=\@tmpdim
108
 
\fi
109
 
\setbox\@thin=\hbox{\vrule width 0mm height \@thinht depth \@thindp}
110
 
\begin{center}
111
 
\ifx\@fxtxt\@nothing\relax\else\@fxtxt\strut\\\fi
112
 
\framebox[0.5\@framewd][t]{\copy\@thin\copy\@tobx}\hfill%
113
 
\framebox[0.5\@framewd][t]{\copy\@thin\copy\@frombx}\\
114
 
\nointerlineskip
115
 
\vspace{0.5\@sep}
116
 
\framebox[0.5\@framewd]{{\bsf \@dtxt} \today\strut}\hfill
117
 
\ifcase\@lstpgno
118
 
    \framebox[0.5\@framewd]{{\bsf Fax:} \thefaxpages\ page(s)\strut}\\
119
 
  \or
120
 
    \framebox[0.5\@framewd]{{\bsf Fax:} \pageref{LastPage} \@ptxt\strut}\\
121
 
  \else
122
 
    \framebox[0.5\@framewd]{{\bsf Fax:} \pageref{LastPage} \@pptxt\strut}\\
123
 
  \fi
124
 
\if@note
125
 
    \nointerlineskip
126
 
    \vspace{0.5\@sep}
127
 
    \addtolength{\@framewd}{-1em}
128
 
    \framebox[\textwidth][c]{\hfill
129
 
    \begin{minipage}{\@framewd}\fbox{\small\bsf \@ntxt} \@note\strut\hfill
130
 
    \end{minipage}\hfill}
131
 
  \fi
132
 
\end{center}
133
 
\if@topsep\vspace{\faxtopsep}\fi
134
 
}