add logo_file support to welcome_letter and fix leaving temp files around for invoice...
[freeside.git] / conf / welcome_letter
1 %% file: random_latex
2 %% Purpose: Multipage template for welcome letters
3 %% 
4 %% Based on work by
5 %% 
6 %% Mark Asplen-Taylor
7 %% Asplen Management Ltd
8 %% www.asplen.co.uk
9 %%
10 %% Kristian Hoffman
11 %%
12 %% Changes
13 %%      0.1     6/19/07 Created
14
15 \documentclass[letterpaper]{article}
16
17 \hyphenpenalty=5000
18 \usepackage{fancyhdr,lastpage,ifthen,afterpage}
19 \usepackage{graphicx}                   % required for logo graphic
20
21 \addtolength{\voffset}{-0.0cm}          % top margin to top of header
22 \addtolength{\hoffset}{-0.6cm}          % left margin on page
23 \addtolength{\topmargin}{-1.25cm}       % top margin to top of header
24 \setlength{\headheight}{2.0cm}          % height of header
25 \setlength{\headsep}{1.0cm}             % between header and text
26 \setlength{\footskip}{1.0cm}            % bottom of footer from bottom of text
27
28 %\addtolength{\textwidth}{2.1in}        % width of text
29 \setlength{\textwidth}{19.5cm}
30 \setlength{\textheight}{19.5cm}
31 \setlength{\oddsidemargin}{-0.9cm}      % odd page left margin
32 \setlength{\evensidemargin}{-0.9cm}     % even page left margin
33
34 \renewcommand{\headrulewidth}{0pt}
35 \renewcommand{\footrulewidth}{0pt}
36
37 % Adjust the inset of the mailing address
38 \newcommand{\addressinset}[1][]{\hspace{1.0cm}}
39
40 % Adjust the inset of the return address and logo
41 \newcommand{\returninset}[1][]{\hspace{-0.25cm}}
42
43 % New command for address lines i.e. skip them if blank
44 \newcommand{\addressline}[1]{\ifthenelse{\equal{#1}{}}{}{#1\newline}}
45
46 % Remove plain style header/footer
47 \fancypagestyle{plain}{
48   \fancyhead{}
49 }
50 \fancyhf{}
51
52 % Define fancy header/footer for first and subsequent pages
53
54 \fancyfoot[R]{
55   \ifthenelse{\equal{\thepage}{1}}
56   { % First page
57     ~
58   }
59   { % ... pages
60     \small{\thepage\ of \pageref{LastPage}}
61   }
62 }
63
64 \fancyhead[L]{
65   \ifthenelse{\equal{\thepage}{1}}
66   { % First page
67     \returninset
68     \makebox{
69       \begin{tabular}{ll}
70         \includegraphics{[@-- $logo_file --@]} &
71         \begin{minipage}[b]{5.5cm}
72 [@-- $returnaddress --@]
73         \end{minipage}
74       \end{tabular}
75     }
76   }
77   { % ... pages
78     %\includegraphics{[@-- $logo_file --@]}     % Uncomment if you want the logo on all pages.
79   }
80 }
81
82 \pagestyle{fancy}
83
84
85 %% Font options are:
86 %%      bch     Bitsream Charter
87 %%      put     Utopia
88 %%      phv     Adobe Helvetica
89 %%      pnc     New Century Schoolbook
90 %%      ptm     Times
91 %%      pcr     Courier
92
93 \renewcommand{\familydefault}{phv}
94
95
96 \begin{document}
97 %
98 \begin{tabular}{ll}
99 \addressinset \rule{0cm}{0cm} &
100 \makebox{
101 \begin{minipage}[t]{5.0cm}
102 \vspace{0.25cm}
103 \textbf{[@-- $payname --@]}\\
104 \addressline{[@-- $company --@]}
105 \addressline{[@-- $address1 --@]}
106 \addressline{[@-- $address2 --@]}
107 \addressline{[@-- $city --@], [@-- $state --@]~~[@-- $zip --@]}
108 \addressline{[@-- $country --@]}
109 \end{minipage}}
110 \end{tabular}
111 \vspace{1.5cm}
112 \\
113 %  Your content goes here
114 Dear [@-- $first --@] [@-- $last --@]:\\
115 \\
116   Thank you for choosing [@-- $company_name --@].  We aim to meet all of your
117   needs.  Please do not hesitate to contact us for any additional
118   services or assistance.\\
119
120 \end{document}
121