-
Notifications
You must be signed in to change notification settings - Fork 3
/
beamerposter.sty
219 lines (198 loc) · 7.72 KB
/
beamerposter.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
% Copyright 2007 by
% Philippe Dreuw <[email protected]> and
% Thomas Deselaers <[email protected]>
% Slight modifications made in August 2009 by Nathaniel Johnston ([email protected])
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
%
% ChangeLog:
%
% 1.07 - bugfixed custom size handling, portrait or landscape settings are ignored now
% 1.06 - added the type1cm package for scalable math fonts
% 1.05 - added version check for xkeyval package
% 1.04 - added custom size handling
% 1.03 - improved predefined size handling
% 1.02 - minor bugfixes
% 1.01 - bugfixed size handling
% 1.00 - first beamerposter release
%
\def\beamerposter@version{1.07}
\def\beamerposter@date{2008/03/11}
\def\beamerposter@msg{beamerposter: latex-beamer poster extension}
\typeout{Package: \beamerposter@date. v.\beamerposter@version. \beamerposter@msg}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerposter}[\beamerposter@date. v.\beamerposter@version. \beamerposter@msg]
\RequirePackage{xkeyval}[2006/11/18]
\RequirePackage{type1cm} %% get it from ftp://cam.ctan.org/tex-archive/macros/latex/contrib/type1cm.zip
\newif\ifportrait
\newif\ifcustomsize
\newif\ifdebug
\DeclareOptionX{size}[a0]{
\typeout{beamerposter: checking size input, please wait.}
\XKV@cc*+[\val\nr]{#1}{a0b,a0,a1,a2,a3,a4,custom}{%
\typeout{beamerposter: the input \val\ \nr\ was correct, we proceed.}
\ifcase\nr\relax
%a0b
\setlength{\paperwidth}{119cm}
\setlength{\paperheight}{88cm}
\setlength{\textwidth}{116cm}
\setlength{\textheight}{88cm}
\or
%a0
\setlength{\paperwidth}{118.82cm}
\setlength{\paperheight}{83.96cm}
\setlength{\textwidth}{117.82cm}
\setlength{\textheight}{82.96cm}
\or
%a1
\setlength{\paperwidth}{83.96cm}
\setlength{\paperheight}{59.4cm}
\setlength{\textwidth}{82.96cm}
\setlength{\textheight}{58.4cm}
\or
%a2
\setlength{\paperwidth}{59.4cm}
\setlength{\paperheight}{41.98cm}
\setlength{\textwidth}{58.4cm}
\setlength{\textheight}{40.98cm}
\or
%a3
\setlength{\paperwidth}{41.98cm}
\setlength{\paperheight}{29.7cm}
\setlength{\textwidth}{40.98cm}
\setlength{\textheight}{28.7cm}
\or
%a4
\setlength{\paperwidth}{29.7cm}
\setlength{\paperheight}{21.0cm}
\setlength{\textwidth}{28.7cm}
\setlength{\textheight}{20.0cm}
\or
\customsizetrue
\fi
}{%
\PackageWarning{beamerposter}{the input \val\ was incorrect and was ignored.}
}%
\typeout{beamerposter: finished size input check.}
}
\DeclareOptionX{orientation}[portrait]{
\typeout{beamerposter: checking orientation input, please wait.}
\XKV@cc*+[\val\nr]{#1}{portrait,landscape}{%
\typeout{beamerposter: the input \val\ \nr\ was correct, we proceed.}
\ifcase\nr\relax
\portraittrue
\or
\portraitfalse
\fi
}{%
\PackageWarning{beamerposter}{the input \val\ was incorrect and was ignored.}
}%
\typeout{beamerposter: finished orientation check.}
}
\DeclareOptionX{scale}[1.0]{\edef\myfontscale{#1}\typeout{beamerposter: myfontscale=\myfontscale}}
\DeclareOptionX{width}{\edef\customwidth{#1}\typeout{beamerposter: custom poster width=\customwidth}}
\DeclareOptionX{height}{\edef\customheight{#1}\typeout{beamerposter: custom poster height=\customheight}}
\DeclareOptionX{debug}{\typeout{beamerposter: enabled debug mode}\debugtrue}
\DeclareOptionX*{\PackageWarning{beamerposter}{Unknown option ignored: \CurrentOption}}
%\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{beamer}}
\ExecuteOptionsX{size=a0,scale=1.0}
\ProcessOptionsX\relax
\ifdebug
\RequirePackage[debug]{fp}
\else
\RequirePackage{fp}
\fi
%% swap sizes for portrait orientation
\ifportrait
\newdimen\tmp
\setlength{\tmp}{\paperwidth}
\setlength{\paperwidth}{\paperheight}
\setlength{\paperheight}{\tmp}
\setlength{\tmp}{\textwidth}
\setlength{\textwidth}{\textheight}
\setlength{\textheight}{\tmp}
\else\relax
\fi
%% overwrite dimensions if custom size
\ifcustomsize
\setlength{\paperwidth}{\customwidth cm}
\setlength{\paperheight}{\customheight cm}
\FPupn{\resulttextwidth}{1 customwidth -}
\FPupn{\resulttextheight}{1 customheight -}
\setlength{\textwidth}{\resulttextwidth cm}
\setlength{\textheight}{\resulttextheight cm}
\fi
%% Setting proper dimensions for a DIN A0 printer
\setlength{\headheight}{0 cm}
\setlength{\headsep}{0 cm}
\setlength{\topmargin}{-12.7 mm} % -1in +1.47cm
\setlength{\oddsidemargin}{-25.4 mm} % -1in +0.4cm
%% For the page layout
\ifdebug
\typeout{beamerposter: paperwidth=\the\paperwidth, paperheight=\the\paperheight}
\typeout{beamerposter: textwidth=\the\textwidth, textwidth=\the\textheight}
\fi
\geometry{
paperwidth=\the\paperwidth,
paperheight=\the\paperheight,
hmargin=1cm,%
vmargin=0cm,%
head=0.5cm, %
headsep=0pt,%
foot=0.5cm %
}
%% scalable vector fonts
\edef\fontSizeX{14.4}\edef\fontSizeY{18}
\FPupn{\resultscriptsizeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultscriptsizeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\tiny}{\fontsize{\resultscriptsizeX}{\resultscriptsizeY}\selectfont}
\edef\fontSizeX{17.28}\edef\fontSizeY{22}
\FPupn{\resultfootnotesizeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultfootnotesizeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\scriptsize}{\fontsize{\resultfootnotesizeX}{\resultfootnotesizeY}\selectfont}
\edef\fontSizeX{20.74}\edef\fontSizeY{25}
\FPupn{\resultsmallX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultsmallY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\footnotesize}{\fontsize{\resultsmallX}{\resultsmallY}\selectfont}
\edef\fontSizeX{24.88}\edef\fontSizeY{30}
\FPupn{\resultnormalsizeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultnormalsizeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\small}{\fontsize{\resultnormalsizeX}{\resultnormalsizeY}\selectfont}
\edef\fontSizeX{29.86}\edef\fontSizeY{37}
\FPupn{\resultlargeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultlargeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\normalsize}{\fontsize{\resultlargeX}{\resultlargeY}\selectfont}
\edef\fontSizeX{35.83}\edef\fontSizeY{45}
\FPupn{\resultLargeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultLargeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\large}{\fontsize{\resultLargeX}{\resultLargeY}\selectfont}
\edef\fontSizeX{43}\edef\fontSizeY{54}
\FPupn{\resultLARGEX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultLARGEY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\Large}{\fontsize{\resultLARGEX}{\resultLARGEY}\selectfont}
\edef\fontSizeX{51.6}\edef\fontSizeY{64}
\FPupn{\resulthugeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resulthugeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\LARGE}{\fontsize{\resulthugeX}{\resulthugeY}\selectfont}
\edef\fontSizeX{61.92}\edef\fontSizeY{77}
\FPupn{\resultHugeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultHugeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\huge}{\fontsize{\resultHugeX}{\resultHugeY}\selectfont}
\edef\fontSizeX{74.3}\edef\fontSizeY{93}
\FPupn{\resultveryHugeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultveryHugeY}{myfontscale fontSizeY * 2 round}
\renewcommand*{\Huge}{\fontsize{\resultveryHugeX}{\resultveryHugeY}\selectfont}
\edef\fontSizeX{80.3}\edef\fontSizeY{101}
\FPupn{\resultVeryHugeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultVeryHugeY}{myfontscale fontSizeY * 2 round}
\newcommand*{\veryHuge}{\fontsize{\resultVeryHugeX}{\resultVeryHugeY}\selectfont}
\edef\fontSizeX{107}\edef\fontSizeY{134}
\FPupn{\resultVERYHugeX}{myfontscale fontSizeX * 2 round}
\FPupn{\resultVERYHugeY}{myfontscale fontSizeY * 2 round}
\newcommand*{\VeryHuge}{\fontsize{\resultVERYHugeX}{\resultVERYHugeY}\selectfont}
% set the normalfont (default)
\renewcommand*{\normalfont}{\normalsize}