Exact Layout With Latex: Implementing A Letterhead
Exact Layout With Latex: Implementing A Letterhead
Exact Layout With Latex: Implementing A Letterhead
NAJAAR 2004
\unitlength=1bp
\begin{picture}(..,..)(..,..)
picture commands
\end{picture}
67
68
Siep Kroonenberg
MAPS 31
\unitlength=1bp
\begin{picture}(12,15)(0,-5)
\put(0,0){\line(1,0){12}}
\put(0,0){\makebox(0,0)[bl]{p}}
\end{picture}
\setbox\pbox=\hbox{p\\q}%
\setbox\qbox=\vbox{p\\q}%
\setbox\rbox=\vtop{p\\q}%
produces: p
\put(0,0){\line(1,0){40}}
\put(0,0){\makebox(0,0)[bl]%
{\smash{\box\pbox}}}
\put(20,0){\makebox(0,0)[bl]%
{\smash{\box\qbox}}}
\put(30,0){\makebox(0,0)[bl]%
{\smash{\box\rbox}}}
\end{picture}
p
q p
q
\def\@frominfo{%
This Isme \\
MyStreet 99 \\
9999 ZZ MyCity \\
Phone 0123456789}
\newbox\frombox
\newbox\logobox
\newbox\tobox
\def\makeletterhead{%
\setbox\frombox=\vtop{\@frominfo}%
\setbox\logobox=\hbox{%
\includegraphics[width=1in]{logo}}%
\setbox\tobox=\vtop{\@toname \\\@toaddress}%
\unitlength=1bp
\begin{picture}(300,126)
\put(280,192){\makebox(0,0)[bl]%
{\smash{\box\logobox}}}
\put(280,180){\makebox(0,0)[bl]%
{\smash{\box\frombox}}}
\put(0,180){\makebox(0,0)[bl]%
{\smash{\box\tobox}}}
\end{picture}}
NAJAAR 2004
1
2
3
4
5
Some
6 Body
Business
Deparment
7
Room
8 000
HisStreet
111
9
AA 10
0000 HisTown
Some
11Country
This Isme
MyStreet 99
9999 ZZ MyCity
Phone 0123456789
12
13
14
15
16
17
18
19
20
21
22
MyCity,
23 December 6, 2004
24
Dear25Some,
26
Regards,
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
69
70
Siep Kroonenberg
MAPS 31
the third line. Without this line, you need a script such
as epstopdf for conversion.
You can place it on the page as part of the page
header code:
\textwidth=360bp
\def\ps@debug{%
\def\@oddhead{%
\smash{\raisebox{-705bp}%
{\includegraphics{grid}}}}%
\let\@oddfoot\@empty}
\pagestyle{debug}
\pagestyle{empty}
%<*debug>
\def\ps@debug{%
\def\@oddhead{%
\smash{\raisebox{-705bp}{\includegraphics{grid}}}}%
\let\@oddfoot\@empty}
\pagestyle{debug}
%</debug>
If you cant sort out the exact value of the first raisebox
parameter then just use trial and error.
Removing debug code with docstrip
In this simplified example, there is only one piece of
code that needs removing. In more complex cases, you
can mark the debug code
%<*debug>
...
%</debug>
\parindent=0bp
\parskip=12bp
\def\@toname{}
\def\toname#1{\def\@toname{#1}}
\long\def\@toaddress{}
\long\def\toaddress#1{\long\def\@toaddress{#1}}
\def\@frominfo{%
This Isme \\
MyStreet 99 \\
9999 ZZ MyCity \\
Phone 0123456789}
\newbox\frombox
\newbox\logobox
\newbox\tobox
\def\makeletterhead{%
\setbox\frombox=\vtop{\@frominfo}%
\setbox\logobox=\hbox{\includegraphics[width=1in]{logo}}%
\setbox\tobox=\vtop{\@toname \\\@toaddress}%
\unitlength=1bp
\begin{picture}(300,127)
\put(280,192){\makebox(0,0)[bl]{\smash{\box\logobox}}}
\put(280,180){\makebox(0,0)[bl]{\smash{\box\frombox}}}
\put(0,180){\makebox(0,0)[bl]{\smash{\box\tobox}}}
\end{picture}}
Notes
1. Scribus, to be precise, Linux answer to QuarkXPress and
InDesign. Url: http://ahnews.music.salford.ac.uk/
scribus/
2. Available from http://tex.aanhet.net/utils/. It is
written in Perl/Tk.
3. A more complete discussion can be found in Victor Eijkhouts TEX by topic book, which can be downloaded for free
from http://www.eijkhout.net/tbt/
Siep Kroonenberg
[email protected]