Debian Codegraph @

texmf-dist/tex/latex/tikzposter/tikzposter.cls

raw
1 %%
2 %% This is file `tikzposter.cls',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% tikzposter.dtx (with options: `tikzposter.cls')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2014 by Pascal Richter, Elena Botoeva, Richard Barnard, and Dirk Surmann
12 %%
13 %% This file may be distributed and/or modified under the
14 %% conditions of the LaTeX Project Public License, either
15 %% version 2.0 of this license or (at your option) any later
16 %% version. The latest version of this license is in:
17 %%
18 %% http://www.latex-project.org/lppl.txt
19 %%
20 %% and version 2.0 or later is part of all distributions of
21 %% LaTeX version 2013/12/01 or later.
22 %%
23
24
25
26
27
28
29
30
31 \NeedsTeXFormat{LaTeX2e}
32 \ProvidesClass{tikzposter}[2014/01/15 v2.0 LaTeX document class for Posters]
33
34 % --------------------------------------- %
35 % Loading Packages
36 \usepackage{xkeyval}
37 \usepackage{calc}
38 \usepackage{ifthen}
39 \usepackage{ae}
40 \usepackage{xstring}
41 \usepackage{etoolbox}
42 \usepackage{tikz}
43 \usetikzlibrary{shapes,decorations,shadows,backgrounds,calc,fadings,fit}
44 \usetikzlibrary{decorations.pathmorphing}
45 \usepgflibrary{arrows}
46
47 % --------------------------------------- %
48 % Paper parameter
49 \newif\ifTP@hugefontsize
50 \newdimen\TP@innermargin
51 \newdimen\TP@visibletextwidth
52 \newdimen\TP@visibletextheight
53
54 % Title parameter
55 \newdimen\TP@titlewidth
56 \newdimen\titlewidth
57 \newdimen\TP@titlelinewidth
58 \newdimen\titlelinewidth
59 \def\titleroundedcorners{}
60 \newdimen\titleinnersep
61 \newdimen\TP@titleinnersep
62 \newdimen\TP@titletotopverticalspace
63 \newdimen\titletotopverticalspace
64 \newdimen\TP@titletoblockverticalspace
65 \newdimen\TP@titleheight
66 \newdimen\titleheight
67 \newdimen\titlegraphicheight
68 \newdimen\titleposleft
69 \newdimen\titleposright
70 \newdimen\titlepostop
71 \newdimen\titleposbottom
72 \newdimen\TP@titlegraphictotitledistance
73 \def\TP@titletextscale{1}
74
75 % Maketitle parameter
76 \def\@title{~}
77 \def\title#1{\gdef\@title{\scalebox{\TP@titletextscale}{#1}}}
78 \def\@author{~}
79 \def\@institute{~}
80 \def\@titlegraphic{~}
81
82 % Affection parameter
83 \newif\ifTP@showlatexaffection
84
85 % Column parameter
86 \newif\ifTP@columnEnvironment
87 \TP@columnEnvironmentfalse
88 \newif\ifTP@subcolumnEnvironment
89 \TP@subcolumnEnvironmentfalse
90 \newdimen\TP@colspace
91 \newdimen\TP@coltop
92 \newdimen\TP@colbottom
93 \newdimen\TP@colcenter
94 \newdimen\colwidth
95
96 % Subcolumn parameter
97 \newdimen\TP@subcolspace
98 \newdimen\TP@subcoltop
99 \newdimen\TP@subcolbottom
100 \newdimen\TP@subcolcenter
101 \newdimen\subcolwidth
102
103 % Block parameter
104 \newdimen\TP@blockverticalspace
105 \newdimen\TP@blockcenter
106 \newdimen\TP@blocktitleinnersep
107 \newdimen\blocktitleinnersep
108 \newdimen\TP@blockbodyinnersep
109 \newdimen\blockbodyinnersep
110 \newbox\TP@blocktitlebox
111 \newbox\TP@blockbodybox
112 \def\TP@blocktitleAlignment{}
113 \newif\ifBlockHasTitle
114 \newdimen\TP@blocktitlewidth
115 \newdimen\TP@blockbodywidth
116 \newdimen\TP@blockbodyheight
117 \newdimen\TP@blocktitleheight
118 \newdimen\TP@blocktop
119 \newdimen\TP@blocktitleoffsetx
120 \newdimen\TP@blocktitleoffsety
121 \newdimen\TP@blockbodyoffsetx
122 \newdimen\TP@blockbodyoffsety
123 \newdimen\TP@blockbodyverticalshift
124 \def\blockroundedcorners{}
125 \newdimen\blocklinewidth
126
127 % Innerblock parameter
128 \newdimen\TP@innerblockcenter
129 \newdimen\TP@innerblocktitleinnersep
130 \newdimen\innerblocktitleinnersep
131 \newdimen\TP@innerblockbodyinnersep
132 \newdimen\innerblockbodyinnersep
133 \newbox\TP@innerblocktitlebox
134 \newbox\TP@innerblockbodybox
135 \def\TP@innerblocktitleAlignment{}
136 \newif\ifInnerblockHasTitle
137 \newdimen\TP@innerblocktitlewidth
138 \newdimen\TP@innerblockbodywidth
139 \newdimen\TP@innerblockbodyheight
140 \newdimen\TP@innerblocktitleheight
141 \newdimen\TP@innerblocktitleoffsetx
142 \newdimen\TP@innerblocktitleoffsety
143 \newdimen\TP@innerblockbodyoffsetx
144 \newdimen\TP@innerblockbodyoffsety
145 \newdimen\TP@innerblockbodyverticalshift
146 \def\innerblockroundedcorners{}
147 \newdimen\innerblocklinewidth
148
149 % Coloredbox parameter
150 \newbox\TP@coloredbox
151 \newdimen\TP@coloredboxwidth
152 \def\TP@coloredboxroundedcorners{}
153 \newdimen\TP@coloredboxlinewidth
154 \newdimen\TP@coloredboxinnersep
155 \newdimen\TP@coloredboxheight
156
157 % Note parameter
158 \newdimen\TP@noteinnersep
159 \newdimen\noteinnersep
160 \newdimen\TP@notetargetoffsetx
161 \newdimen\TP@notetargetoffsety
162 \def\TP@noteangle{}
163 \newdimen\TP@noteradius
164 \newdimen\TP@notewidth
165 \newdimen\TP@noteheight
166 \newif\ifNoteHasConnection
167 \newbox\TP@notebox
168 \def\noterotate{}
169 \def\noteroundedcorners{}
170 \newdimen\notelinewidth
171
172 % --------------------------------------- %
173 % Declaring options
174 \DeclareOptionX{12pt}{\TP@hugefontsizefalse \PassOptionsToClass{\CurrentOption}{extarticle}}
175 \DeclareOptionX{14pt}{\TP@hugefontsizefalse \PassOptionsToClass{\CurrentOption}{extarticle}}
176 \DeclareOptionX{17pt}{\TP@hugefontsizefalse \PassOptionsToClass{\CurrentOption}{extarticle}}
177 \DeclareOptionX{20pt}{\TP@hugefontsizefalse \PassOptionsToClass{\CurrentOption}{extarticle}}
178 \DeclareOptionX{25pt}{\TP@hugefontsizetrue}
179 \DeclareOptionX{fleqn}{\PassOptionsToClass{\CurrentOption}{extarticle}}
180 \DeclareOptionX{leqno} {\PassOptionsToClass{\CurrentOption}{extarticle}}
181 \DeclareOptionX{a0paper}{\PassOptionsToPackage{\CurrentOption}{geometry}}
182 \DeclareOptionX{a1paper}{\PassOptionsToPackage{\CurrentOption}{geometry}}
183 \DeclareOptionX{a2paper}{\PassOptionsToPackage{\CurrentOption}{geometry}}
184 \DeclareOptionX{landscape}{\PassOptionsToPackage{\CurrentOption}{geometry}}
185 \DeclareOptionX{portrait}{\PassOptionsToPackage{\CurrentOption}{geometry}}
186 \DeclareOptionX{margin}[20mm]{\PassOptionsToPackage{margin=#1}{geometry}}
187 \DeclareOptionX{innermargin}{\TP@innermargin=#1}
188 \DeclareOptionX{colspace}{\TP@colspace=#1}
189 \DeclareOptionX{subcolspace}{\TP@subcolspace=#1}
190 \DeclareOptionX{blockverticalspace}{\TP@blockverticalspace=#1}
191 \DeclareOptionX*{{\PackageWarning{tikzposter}{Unknown Option \CurrentOption.}}}
192
193 % Executing options
194 \ExecuteOptionsX{
195 25pt,
196 a0paper,
197 portrait,
198 margin=0mm,
199 innermargin=15mm,
200 colspace=15mm,
201 subcolspace=8mm,
202 blockverticalspace=15mm
203 }
204 \ProcessOptionsX \relax
205 \LoadClass{extarticle}
206 \RequirePackage{geometry}
207 \ifTP@hugefontsize
208 \input{a0size.sty}
209 \renewcommand{\tiny}{\fontsize{12}{14}\selectfont}
210 \renewcommand{\scriptsize}{\fontsize{14.4}{18}\selectfont}
211 \renewcommand{\footnotesize}{\fontsize{17.28}{22}\selectfont}
212 \renewcommand{\small}{\fontsize{20.74}{25}\selectfont}
213 \renewcommand{\normalsize}{\fontsize{24.88}{30}\selectfont}
214 \renewcommand{\large}{\fontsize{29.86}{37}\selectfont}
215 \renewcommand{\Large}{\fontsize{35.83}{45}\selectfont}
216 \renewcommand{\LARGE}{\fontsize{43}{54}\selectfont}
217 \renewcommand{\huge}{\fontsize{51.6}{64}\selectfont}
218 \renewcommand{\Huge}{\fontsize{61.92}{77}\selectfont}
219 \fi
220 \normalsize
221 \pagestyle{empty}
222 \setlength{\TP@visibletextwidth}{\textwidth-2\TP@innermargin}
223 \setlength{\TP@visibletextheight}{\textheight-2\TP@innermargin}
224 \pgfdeclarelayer{backgroundlayer}
225 \pgfdeclarelayer{notelayer}
226 \pgfsetlayers{backgroundlayer,main,notelayer}
227
228 % --------------------------------------- %
229 % Background styles
230 \gdef\definebackgroundstyle#1#2{\expandafter\gdef\csname TP@backgroundstyle#1\endcsname{#2}}
231
232 \gdef\usebackgroundstyle#1{
233 \ifcsname TP@backgroundstyle#1\endcsname
234 \gdef\TP@backgroundstyle{\csname TP@backgroundstyle#1\endcsname} % save macro
235 \else
236 \PackageWarning{tikzposter}{Unknown backgroundstyle `#1'.}
237 \fi
238 }
239
240 % --------------------------------------- %
241 % Title styles
242 \gdef\definetitlestyle#1#2#3{
243 \expandafter\gdef\csname TP@titlestyle#1Defaultvalues\endcsname{\gpresetkeys{title}{#2}{}}
244 \expandafter\gdef\csname TP@titlestyle#1\endcsname{#3}
245 }
246
247 \define@key{title}{width}{\TP@titlewidth=#1 \titlewidth=#1}
248 \define@key{title}{roundedcorners}{\gdef\titleroundedcorners{#1}}
249 \define@key{title}{linewidth}{\TP@titlelinewidth=#1 \titlelinewidth=#1}
250 \define@key{title}{innersep}{\TP@titleinnersep=#1 \titleinnersep=#1}
251 \define@key{title}{titletotopverticalspace}{\TP@titletotopverticalspace=#1 \titletotopverticalspace=#1}
252 \define@key{title}{titletoblockverticalspace}{\TP@titletoblockverticalspace=#1}
253 \define@key{title}{titlegraphictotitledistance}{\TP@titlegraphictotitledistance=#1}
254 \define@key{title}{titletextscale}{\TP@titletextscale=#1}
255 \newcommand\usetitlestyle[2][]{
256 \ifcsname TP@titlestyle#2\endcsname
257 \csname TP@titlestyle#2Defaultvalues\endcsname\gpresetkeys{title}{#1}{} % call macro
258 \gdef\TP@titlestyle{\csname TP@titlestyle#2\endcsname} % save macro
259 \else
260 \PackageWarning{tikzposter}{Unknown titlestyle `#2'.}
261 \fi
262 }
263
264 % --------------------------------------- %
265 % Title
266 \gdef\TP@maketitle{
267 \centering
268 \vbox{
269 \@titlegraphic
270 \\[\TP@titlegraphictotitledistance]
271 \centering
272 \color{titlefgcolor}
273 {\bfseries \Huge \sc \@title \par}
274 \vspace*{1em}
275 {\huge \@author \par}
276 \vspace*{1em}
277 {\LARGE \@institute}
278 }
279 }
280
281 \gdef\institute#1{\gdef\@institute{#1}}
282 \gdef\titlegraphic#1{\gdef\@titlegraphic{#1}}
283
284 \newenvironment{settitle}{
285 \makeatletter
286 \renewcommand{\TP@maketitle}
287 }{
288 \makeatother
289 }
290
291 \renewcommand\maketitle[1][]{ % #1 keys
292 \normalsize
293 \setkeys{title}{#1}
294 % Title dummy to get title height
295 \node[transparent,inner sep=\TP@titleinnersep, line width=\TP@titlelinewidth, anchor=north, minimum width=\TP@visibletextwidth-2\TP@titleinnersep]
296 (TP@title) at ($(0, 0.5\textheight-\TP@titletotopverticalspace)$) {\parbox{\TP@titlewidth-2\TP@titleinnersep}{\TP@maketitle}};
297 \draw let \p1 = ($([email protected])-([email protected])$) in node {
298 \setlength{\TP@titleheight}{\y1}
299 \setlength{\titleheight}{\y1}
300 \global\TP@titleheight=\TP@titleheight
301 \global\titleheight=\titleheight
302 };
303
304 % Compute title position
305 \setlength{\titleposleft}{-0.5\titlewidth}
306 \setlength{\titleposright}{\titleposleft+\titlewidth}
307 \setlength{\titlepostop}{0.5\textheight-\TP@titletotopverticalspace}
308 \setlength{\titleposbottom}{\titlepostop-\titleheight}
309
310 % Title style (background)
311 \TP@titlestyle
312
313 % Title node
314 \node[inner sep=\TP@titleinnersep, line width=\TP@titlelinewidth, anchor=north, minimum width=\TP@visibletextwidth-2\TP@titleinnersep]
315 at (0,0.5\textheight-\TP@titletotopverticalspace) {\parbox{\TP@titlewidth-2\TP@titleinnersep}{\TP@maketitle}};
316
317 % Settings for blocks
318 \normalsize
319 \setlength{\TP@blocktop}{\titleposbottom-\TP@titletoblockverticalspace}
320 }
321
322 % --------------------------------------- %
323 % Block styles
324 \gdef\defineblockstyle#1#2#3{
325 \expandafter\gdef\csname TP@blockstyle#1Defaultvalues\endcsname{\gpresetkeys{block}{#2}{}}
326 \expandafter\gdef\csname TP@blockstyle#1\endcsname{#3}
327 }
328
329 \define@key{block}{titlewidthscale}{\setlength{\TP@blocktitlewidth}{#1\TP@blocktitlewidth}}
330 \define@key{block}{bodywidthscale}{\setlength{\TP@blockbodywidth}{#1\TP@blockbodywidth}}
331 \define@boolkey{block}{titleleft}[true]{\ifKV@block@titleleft \gdef\TP@blocktitleAlignment{\raggedright} \fi}
332 \define@boolkey{block}{titlecenter}[true]{\ifKV@block@titlecenter \gdef\TP@blocktitleAlignment{\centering} \fi}
333 \define@boolkey{block}{titleright}[true]{\ifKV@block@titleright \gdef\TP@blocktitleAlignment{\raggedleft} \fi}
334 \define@key{block}{titleoffsetx}{\TP@blocktitleoffsetx=#1}
335 \define@key{block}{titleoffsety}{\TP@blocktitleoffsety=#1}
336 \define@key{block}{bodyoffsetx}{\TP@blockbodyoffsetx=#1}
337 \define@key{block}{bodyoffsety}{\TP@blockbodyoffsety=#1}
338 \define@key{block}{bodyverticalshift}{\TP@blockbodyverticalshift=#1}
339 \define@key{block}{roundedcorners}{\gdef\blockroundedcorners{#1}}
340 \define@key{block}{linewidth}{\blocklinewidth=#1}
341 \define@key{block}{titleinnersep}{\TP@blocktitleinnersep=#1 \blocktitleinnersep=#1}
342 \define@key{block}{bodyinnersep}{\TP@blockbodyinnersep=#1 \blockbodyinnersep=#1}
343
344 \newcommand\useblockstyle[2][]{
345 \ifcsname TP@blockstyle#2\endcsname
346 \csname TP@blockstyle#2Defaultvalues\endcsname\gpresetkeys{block}{#1}{} % call macro
347 \gdef\TP@blockstyle{\csname TP@blockstyle#2\endcsname} % save macro
348 \else
349 \PackageWarning{tikzposter}{Unknown blockstyle `#2'.}
350 \fi
351 }
352
353 % --------------------------------------- %
354 % Block
355 \newcommand\block[3][]{ % #1 keys #2 title #3 text
356 % Block position
357 \normalsize
358 \ifTP@subcolumnEnvironment
359 \TP@blocktitlewidth=\subcolwidth
360 \TP@blockbodywidth=\subcolwidth
361 \TP@blockcenter=\TP@subcolcenter
362 \else
363 \ifTP@columnEnvironment
364 \TP@blocktitlewidth=\colwidth
365 \TP@blockbodywidth=\colwidth
366 \TP@blockcenter=\TP@colcenter
367 \else
368 \setlength\TP@blocktitlewidth{\TP@visibletextwidth}
369 \setlength\TP@blockbodywidth{\TP@visibletextwidth}
370 \TP@blockcenter=0pt
371 \fi
372 \fi
373
374 % Set parameter
375 \setkeys{block}{#1}
376
377 % Settings for Subcolumns
378 \ifTP@subcolumnEnvironment \else \ifTP@columnEnvironment \else
379 \setlength\TP@blocktitlewidth{\TP@blocktitlewidth-\blocklinewidth}
380 \setlength\TP@blockbodywidth{\TP@blockbodywidth-\blocklinewidth}
381 \TP@blockcenter=0pt
382 \fi \fi
383
384 % Get height of title
385 \ifstrempty{#2}{
386 \BlockHasTitlefalse
387 \setlength{\TP@blocktitleheight}{0pt}
388 }{
389 \BlockHasTitletrue
390 \setbox\TP@blocktitlebox=\hbox{%
391 \pgfinterruptpicture%
392 \parbox{\TP@blocktitlewidth-2\TP@blocktitleinnersep}{%
393 \bf\LARGE\color{blocktitlefgcolor}\TP@blocktitleAlignment#2\par\normalsize}%
394 \endpgfinterruptpicture%
395 }%
396 \setlength{\TP@blocktitleheight}{\ht\TP@blocktitlebox + \dp\TP@blocktitlebox +2\TP@blocktitleinnersep}
397 }
398
399 % Get height of body
400 \setbox\TP@blockbodybox=\hbox{
401 \pgfinterruptpicture%
402 \parbox{\TP@blockbodywidth-2\TP@blockbodyinnersep-\TP@blockbodyoffsetx}{%
403 \vspace*{\TP@blockbodyverticalshift}\large\color{blockbodyfgcolor}#3\par\normalsize}%
404 \endpgfinterruptpicture%
405 }%
406 \setlength{\TP@blockbodyheight}{\ht\TP@blockbodybox + \dp\TP@blockbodybox +2\TP@blockbodyinnersep}
407
408 % Set coordinates
409 \node[minimum width=\TP@blocktitlewidth, minimum height=\TP@blocktitleheight, anchor=center] (blocktitle)%
410 at (\TP@blockcenter+\TP@blocktitleoffsetx, {\[email protected]\TP@blocktitleheight+\TP@blocktitleoffsety}){};
411 \ifBlockHasTitle
412 \node[minimum width=\TP@blockbodywidth, minimum height=\TP@blockbodyheight, anchor=center] (blockbody)%
413 at (\TP@blockcenter+\TP@blockbodyoffsetx, {\TP@blocktop-\[email protected]\TP@blockbodyheight+\TP@blockbodyoffsety}){};
414 \else
415 \node[minimum width=\TP@blockbodywidth, minimum height=\TP@blockbodyheight, anchor=center] (blockbody)%
416 at (\TP@blockcenter+\TP@blockbodyoffsetx, {\TP@blocktop-\[email protected]\TP@blockbodyheight}){};
417 \fi
418
419 % Draw style
420 \TP@blockstyle
421
422 % Draw text
423 \ifBlockHasTitle
424 \node[text width=\TP@blocktitlewidth-2\TP@blocktitleinnersep, inner sep=\TP@blocktitleinnersep, anchor=center]%
425 at (blocktitle){\box\TP@blocktitlebox};
426 \fi
427 \node[text width=\TP@blockbodywidth-2\TP@blockbodyinnersep, inner sep=\TP@blockbodyinnersep, anchor=center]%
428 at (blockbody){\box\TP@blockbodybox};
429
430 % Set position parameter
431 \draw let \p1 = (blockbody.south) in node {
432 \setlength{\TP@blocktop}{\y1-\TP@blockverticalspace}
433 \global\TP@blocktop=\TP@blocktop
434 };
435 \ifTP@subcolumnEnvironment
436 \setlength{\TP@subcolbottom}{\minof{\TP@subcolbottom}{\TP@blocktop}}
437 \global\TP@subcolbottom=\TP@subcolbottom
438 \else
439 \ifTP@columnEnvironment
440 \setlength{\TP@colbottom}{\minof{\TP@colbottom}{\TP@blocktop}}
441 \global\TP@colbottom=\TP@colbottom
442 \fi
443 \fi
444 }
445
446 % --------------------------------------- %
447 % Innerblock styles
448 \gdef\defineinnerblockstyle#1#2#3{
449 \expandafter\gdef\csname TP@innerblockstyle#1Defaultvalues\endcsname{\gpresetkeys{innerblock}{#2}{}}
450 \expandafter\gdef\csname TP@innerblockstyle#1\endcsname{#3}
451 }
452
453 \define@key{innerblock}{titlewidth}{\setlength{\TP@innerblocktitlewidth}{#1}}
454 \define@key{innerblock}{bodywidth}{\setlength{\TP@innerblockbodywidth}{#1}}
455 \define@key{innerblock}{titlewidthscale}{\setlength{\TP@innerblocktitlewidth}{#1\TP@innerblocktitlewidth}}
456 \define@key{innerblock}{bodywidthscale}{\setlength{\TP@innerblockbodywidth}{#1\TP@innerblockbodywidth}}
457 \define@boolkey{innerblock}{titleleft}[true]{\ifKV@innerblock@titleleft \gdef\TP@innerblocktitleAlignment{\raggedright} \fi}
458 \define@boolkey{innerblock}{titlecenter}[true]{\ifKV@innerblock@titlecenter \gdef\TP@innerblocktitleAlignment{\centering} \fi}
459 \define@boolkey{innerblock}{titleright}[true]{\ifKV@innerblock@titleright \gdef\TP@innerblocktitleAlignment{\raggedleft} \fi}
460 \define@key{innerblock}{titleoffsetx}{\TP@innerblocktitleoffsetx=#1}
461 \define@key{innerblock}{titleoffsety}{\TP@innerblocktitleoffsety=#1}
462 \define@key{innerblock}{bodyoffsetx}{\TP@innerblockbodyoffsetx=#1}
463 \define@key{innerblock}{bodyoffsety}{\TP@innerblockbodyoffsety=#1}
464 \define@key{innerblock}{bodyverticalshift}{\TP@innerblockbodyverticalshift=#1}
465 \define@key{innerblock}{roundedcorners}{\gdef\innerblockroundedcorners{#1}}
466 \define@key{innerblock}{linewidth}{\innerblocklinewidth=#1}
467 \define@key{innerblock}{titleinnersep}{\TP@innerblocktitleinnersep=#1 \innerblocktitleinnersep=#1}
468 \define@key{innerblock}{bodyinnersep}{\TP@innerblockbodyinnersep=#1 \innerblockbodyinnersep=#1}
469 \define@key{innerblock}{titlebgcolor}{\definecolor{innerblocktitlebgcolor}{named}{#1}}
470 \define@key{innerblock}{titlefgcolor}{\definecolor{innerblocktitlefgcolor}{named}{#1}}
471 \define@key{innerblock}{bodybgcolor}{\definecolor{innerblockbodybgcolor}{named}{#1}}
472 \define@key{innerblock}{bodyfgcolor}{\definecolor{innerblockbodyfgcolor}{named}{#1}}
473
474 \newcommand\useinnerblockstyle[2][]{
475 \ifcsname TP@innerblockstyle#2\endcsname
476 \csname TP@innerblockstyle#2Defaultvalues\endcsname\gpresetkeys{innerblock}{#1}{} % call macro
477 \gdef\TP@innerblockstyle{\csname TP@innerblockstyle#2\endcsname} % save macro
478 \else
479 \PackageWarning{tikzposter}{Unknown innerblockstyle `#2'.}
480 \fi
481 }
482
483 % --------------------------------------- %
484 % Innerblock
485 \newcommand\innerblock[3][]{ % #1 keys #2 title #3 text
486 % Settings for Innerblock
487 \definecolor{innerblocktitlebgcolorTemp}{named}{innerblocktitlebgcolor}
488 \definecolor{innerblocktitlefgcolorTemp}{named}{innerblocktitlefgcolor}
489 \definecolor{innerblockbodybgcolorTemp}{named}{innerblockbodybgcolor}
490 \definecolor{innerblockbodyfgcolorTemp}{named}{innerblockbodyfgcolor}
491 \setlength{\TP@innerblocktitlewidth}{\linewidth}
492 \setlength{\TP@innerblockbodywidth}{\linewidth}
493 \setkeys{innerblock}{#1}
494
495 \begin{tikzpicture}
496
497 % Get center in x-direction
498 \pgfmathsetlength{\TP@innerblockcenter}{max(\TP@innerblocktitlewidth,\TP@innerblockbodywidth)/2}
499
500 % Get height of title
501 \ifstrempty{#2}{
502 \InnerblockHasTitlefalse
503 \setlength{\TP@innerblocktitleheight}{0pt}
504 }{
505 \InnerblockHasTitletrue
506 \setbox\TP@innerblocktitlebox=\hbox{%
507 \pgfinterruptpicture%
508 \parbox{\TP@innerblocktitlewidth-2\TP@innerblocktitleinnersep}{%
509 \bf\color{innerblocktitlefgcolor}\TP@innerblocktitleAlignment#2\par\normalsize}%
510 \endpgfinterruptpicture%
511 }
512 \setlength{\TP@innerblocktitleheight}{\ht\TP@innerblocktitlebox + \dp\TP@innerblocktitlebox +2\TP@innerblocktitleinnersep}
513 }
514
515 % Get height of body
516 \setbox\TP@innerblockbodybox=\hbox{
517 \pgfinterruptpicture%
518 \parbox{\TP@innerblockbodywidth-2\TP@innerblockbodyinnersep-\TP@innerblockbodyoffsetx}{%
519 \vspace*{\TP@innerblockbodyverticalshift}%
520 \color{innerblockbodyfgcolor}#3\par\normalsize}%
521 \endpgfinterruptpicture%
522 }%
523 \setlength{\TP@innerblockbodyheight}{\ht\TP@innerblockbodybox + \dp\TP@innerblockbodybox +2\TP@innerblockbodyinnersep}
524
525 % Set coordinates
526 \node[minimum width=\TP@innerblocktitlewidth, minimum height=\TP@innerblocktitleheight, anchor=center] (innerblocktitle)
527 at (\TP@innerblockcenter+\TP@innerblocktitleoffsetx, {-0.5\TP@innerblocktitleheight+\TP@innerblocktitleoffsety}) {};%
528 \ifInnerblockHasTitle
529 \node[minimum width=\TP@innerblockbodywidth, minimum height=\TP@innerblockbodyheight, anchor=center] (innerblockbody)
530 at (\TP@innerblockcenter+\TP@innerblockbodyoffsetx, {-\[email protected]\TP@innerblockbodyheight+\TP@innerblockbodyoffsety}) {};%
531 \else
532 \node[minimum width=\TP@innerblockbodywidth, minimum height=\TP@innerblockbodyheight, anchor=center] (innerblockbody)
533 at (\TP@innerblockcenter+\TP@innerblockbodyoffsetx, {-\[email protected]\TP@innerblockbodyheight}) {};%
534 \fi
535
536 % Draw style
537 \TP@innerblockstyle
538
539 % Draw text
540 \ifInnerblockHasTitle
541 \node[text width=\TP@innerblocktitlewidth-2\TP@innerblocktitleinnersep, inner sep=\TP@innerblocktitleinnersep, anchor= center]
542 at (innerblocktitle) {\box\TP@innerblocktitlebox};%
543 \fi
544 \node[text width=\TP@innerblockbodywidth-2\TP@innerblockbodyinnersep, inner sep=\TP@innerblockbodyinnersep, anchor= center]
545 at (innerblockbody) {\box\TP@innerblockbodybox};%
546 \end{tikzpicture}
547
548 % Reset colors
549 \definecolor{innerblocktitlebgcolor}{named}{innerblocktitlebgcolorTemp}
550 \definecolor{innerblocktitlefgcolor}{named}{innerblocktitlefgcolorTemp}
551 \definecolor{innerblockbodybgcolor}{named}{innerblockbodybgcolorTemp}
552 \definecolor{innerblockbodyfgcolor}{named}{innerblockbodyfgcolorTemp}
553 }
554
555 % --------------------------------------- %
556 % Coloredbox
557 \define@key{coloredbox}{width}{\setlength{\TP@coloredboxwidth}{#1}}
558 \define@key{coloredbox}{roundedcorners}{\gdef\TP@coloredboxroundedcorners{#1}}
559 \define@key{coloredbox}{linewidth}{\TP@coloredboxlinewidth=#1}
560 \define@key{coloredbox}{innersep}{\TP@coloredboxinnersep=#1}
561 \define@key{coloredbox}{bgcolor}{\definecolor{coloredboxbgcolorTemp}{named}{#1}}
562 \define@key{coloredbox}{fgcolor}{\definecolor{coloredboxfgcolorTemp}{named}{#1}}
563 \define@key{coloredbox}{framecolor}{\definecolor{coloredboxframecolorTemp}{named}{#1}}
564
565 \newcommand\coloredbox[2][]{ % #1 keys #2 text
566 % Settings for coloredbox
567 \setlength{\TP@coloredboxwidth}{\TP@blocktitlewidth-4\TP@blocktitleinnersep}
568 \setkeys{coloredbox}{%
569 width={\linewidth}, roundedcorners=15, linewidth=3.5pt, innersep=10pt,
570 bgcolor=notebgcolor, fgcolor=notefgcolor, framecolor=notebgcolor, #1}
571
572 \begin{tikzpicture}
573 % Get height of text
574 \setbox\TP@coloredbox=\hbox{
575 \pgfinterruptpicture%
576 \parbox{\TP@coloredboxwidth-2\TP@coloredboxinnersep}{%
577 \color{coloredboxfgcolorTemp}#2\par\normalsize}%
578 \endpgfinterruptpicture%
579 }%
580 \setlength{\TP@coloredboxheight}{\ht\TP@coloredbox + \dp\TP@coloredbox +2\TP@coloredboxinnersep}
581
582 % Set coordinates
583 \node[minimum width=\TP@coloredboxwidth, minimum height=\TP@coloredboxheight, anchor=center] (coloredbox)
584 at (0.5\TP@coloredboxwidth, -0.5\TP@coloredboxheight) {};%
585
586 % Draw style
587 \begin{scope}[line width=\TP@coloredboxlinewidth, rounded corners=\TP@coloredboxroundedcorners]
588 \draw[color=coloredboxframecolorTemp, fill=coloredboxbgcolorTemp] (coloredbox.south west) rectangle (coloredbox.north east);
589 \end{scope}
590
591 % Draw text
592 \node[text width=\TP@coloredboxwidth-2\TP@coloredboxinnersep, inner sep=\TP@coloredboxinnersep, anchor= center]
593 at (coloredbox) {\box\TP@coloredbox};%
594 \end{tikzpicture}
595
596 % Reset colors
597 \definecolor{coloredboxbgcolor}{named}{coloredboxbgcolorTemp}
598 \definecolor{coloredboxfgcolor}{named}{coloredboxfgcolorTemp}
599 }
600
601 % --------------------------------------- %
602 % Note styles
603 \gdef\definenotestyle#1#2#3{
604 \expandafter\gdef\csname TP@notestyle#1Defaultvalues\endcsname{\gpresetkeys{note}{#2}{}}
605 \expandafter\gdef\csname TP@notestyle#1\endcsname{#3}
606 }
607
608 \define@key{note}{targetoffsetx}{\TP@notetargetoffsetx=#1}
609 \define@key{note}{targetoffsety}{\TP@notetargetoffsety=#1}
610 \define@key{note}{angle}{\def\TP@noteangle{#1}}
611 \define@key{note}{radius}{\TP@noteradius=#1}
612 \define@key{note}{width}{\TP@notewidth=#1}
613 \define@boolkey{note}{connection}[true]{\NoteHasConnectiontrue \ifKV@note@connection \NoteHasConnectiontrue \else \NoteHasConnectionfalse \fi}
614 \define@key{note}{rotate}{\gdef\noterotate{#1}}
615 \define@key{note}{roundedcorners}{\gdef\noteroundedcorners{#1}}
616 \define@key{note}{linewidth}{\notelinewidth=#1}
617 \define@key{note}{innersep}{\TP@noteinnersep=#1 \noteinnersep=#1}
618 \newcommand\usenotestyle[2][]{
619 \ifcsname TP@notestyle#2\endcsname
620 \csname TP@notestyle#2Defaultvalues\endcsname\gpresetkeys{note}{#1}{} % call macro
621 \gdef\TP@notestyle{\csname TP@notestyle#2\endcsname} % save macro
622 \else
623 \PackageWarning{tikzposter}{Unknown notestyle `#2'.}
624 \fi
625 }
626
627 % --------------------------------------- %
628 % Note
629 \newcommand\note[2][]{ % #1 keys #2 text
630 \normalsize
631 \setkeys{note}{#1}
632
633 % Note box
634 \setbox\TP@notebox=\hbox{%
635 \pgfinterruptpicture%
636 \parbox{\TP@notewidth-2\TP@noteinnersep}{\color{notefgcolor}#2\par\normalsize}%
637 \endpgfinterruptpicture%
638 }%
639 \setlength{\TP@noteheight}{\ht\TP@notebox + \dp\TP@notebox +2\TP@noteinnersep}
640 \pgfmathsetlength{\TP@noteheight}{max(\TP@noteheight,80pt)}
641
642 % Set note coordinates
643 \node (notetarget) at ($(blockbody)+(\TP@notetargetoffsetx,\TP@notetargetoffsety)$){};
644 \node[minimum width=\TP@notewidth, minimum height=\TP@noteheight, anchor=center,rotate=\noterotate] (notecenter)
645 at ($(notetarget)+({\TP@noteradius*cos(\TP@noteangle)},{\TP@noteradius*sin(\TP@noteangle)})$){};%
646
647 % Draw note
648 \begin{pgfonlayer}{notelayer}
649 \TP@notestyle
650 % Draw note text
651 \node[text width=\TP@notewidth-2\TP@noteinnersep, inner sep=\TP@noteinnersep, anchor=center,rotate=\noterotate]%
652 at (notecenter){\box\TP@notebox};
653 \end{pgfonlayer}
654 }
655
656 % --------------------------------------- %
657 % Color palette
658 \gdef\definecolorpalette#1#2{\expandafter\gdef\csname TP@colorpalette#1\endcsname{#2}}
659
660 \gdef\usecolorpalette#1{
661 \ifcsname TP@colorpalette#1\endcsname
662 \csname TP@colorpalette#1\endcsname % call macro
663 \else
664 \PackageWarning{tikzposter}{Unknown color palette `#1'.}
665 \fi
666 }
667
668 % --------------------------------------- %
669 % Color style
670 \gdef\definecolorstyle#1#2#3{
671 \expandafter\gdef\csname TP@colorstyle#1Defaultvalues\endcsname{#2}
672 \expandafter\gdef\csname TP@colorstyle#1\endcsname{#3}
673 }
674
675 \define@key{colors}{colorOne}{\colorlet{colorOne}{#1}}
676 \define@key{colors}{colorTwo}{\colorlet{colorTwo}{#1}}
677 \define@key{colors}{colorThree}{\colorlet{colorThree}{#1}}
678 \define@key{colors}{colorPalette}{\usecolorpalette{#1}}
679
680 \newcommand\usecolorstyle[2][]{ % #1 keys #2 macroname
681 \ifcsname TP@colorstyle#2\endcsname
682 \csname TP@colorstyle#2Defaultvalues\endcsname % call macro
683 \setkeys{colors}{#1} % set keys
684 \csname TP@colorstyle#2\endcsname % call macro
685 \else
686 \PackageWarning{tikzposter}{Unknown color style `#2'.}
687 \fi
688 }
689
690 % --------------------------------------- %
691 % Layouttheme
692 \gdef\definelayouttheme#1#2{\expandafter\gdef\csname TP@layouttheme#1\endcsname{#2}}
693
694 \gdef\usetheme#1{
695 % Layout theme
696 \ifcsname TP@layouttheme#1\endcsname
697 \csname TP@layouttheme#1\endcsname % call macro
698 \else
699 \PackageWarning{tikzposter}{Unknown layouttheme `#1'.}
700 \fi
701 }
702
703 % Input Style and Theme Files
704 \input{tikzposterColorpalettes}
705 \input{tikzposterColorstyles}
706 \input{tikzposterBackgroundstyles}
707 \input{tikzposterTitlestyles}
708 \input{tikzposterBlockstyles}
709 \input{tikzposterInnerblockstyles}
710 \input{tikzposterNotestyles}
711 \input{tikzposterLayoutthemes}
712
713 % Set Default theme
714 \usetheme{Default}
715
716 % --------------------------------------- %
717 % Columns environment
718 \newenvironment{columns}{
719 \TP@columnEnvironmenttrue
720 \setlength{\TP@colcenter}{-0.5\TP@visibletextwidth-\[email protected]\blocklinewidth}
721 \global\TP@colcenter=\TP@colcenter
722 \global\TP@coltop=\TP@blocktop
723 \global\TP@colbottom=\TP@blocktop
724 \colwidth=0pt
725 }{
726 \TP@columnEnvironmentfalse
727 \global\TP@blocktop=\TP@colbottom
728 }
729
730 % Column
731 \gdef\column#1{ % #1: relative width
732 \ifTP@columnEnvironment
733 \normalsize
734 \setlength{\TP@blocktop}{\TP@coltop}
735 \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\TP@colspace}
736 \setlength{\colwidth}{#1\TP@visibletextwidth+#1\TP@colspace-\TP@colspace-\blocklinewidth}
737 \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\blocklinewidth}
738 \fi
739 }
740
741 % --------------------------------------- %
742 % Subcolumns environment
743 \newenvironment{subcolumns}{
744 \ifTP@columnEnvironment
745 \TP@subcolumnEnvironmenttrue
746 \setlength{\TP@subcolcenter}{\[email protected]\colwidth-\TP@blockbodyinnersep-\TP@subcolspace-\TP@blockbodyinnersep}
747 \global\TP@subcolcenter=\TP@subcolcenter
748 \global\TP@subcoltop=\TP@blocktop
749 \global\TP@subcolbottom=\TP@blocktop
750 \subcolwidth=0pt
751 \fi
752 }{
753 \TP@subcolumnEnvironmentfalse
754 \global\TP@blocktop=\TP@subcolbottom
755 }
756
757 % Subcolumn
758 \gdef\subcolumn#1{ % #1: relative width
759 \ifTP@subcolumnEnvironment
760 \normalsize
761 \setlength{\TP@blocktop}{\TP@subcoltop}
762 \setlength{\TP@subcolcenter}{\TP@subcolcenter+0.5\subcolwidth+\TP@blockbodyinnersep+\TP@subcolspace+\TP@blockbodyinnersep}
763 \setlength{\subcolwidth}{#1\colwidth+#1\TP@blockbodyinnersep+#1\TP@blockbodyinnersep
764 +#1\TP@subcolspace-\TP@subcolspace-2\TP@blockbodyinnersep}
765 \setlength{\TP@subcolcenter}{\TP@subcolcenter+0.5\subcolwidth}
766 \fi
767 }
768
769 % --------------------------------------- %
770 % Affection
771 \gdef\tikzposterlatexaffectionproofon{\TP@showlatexaffectiontrue}
772 \gdef\tikzposterlatexaffectionproofoff{\TP@showlatexaffectionfalse}
773 \TP@showlatexaffectiontrue
774
775 % --------------------------------------- %
776 % Document environment
777 \AtBeginDocument{%
778 % Get titlegraphic height
779 \settototalheight{\titlegraphicheight}{\hbox{\@titlegraphic}}
780
781 \begin{center}
782 \begin{tikzpicture}
783 % Background
784 \coordinate (topright) at (0.5\textwidth, 0.5\textheight);
785 \coordinate (bottomleft) at (-0.5\textwidth, -0.5\textheight);
786 \clip (bottomleft) rectangle (topright);
787
788 % Draw background
789 \begin{pgfonlayer}{backgroundlayer}
790 \clip (bottomleft) rectangle (topright);
791 \TP@backgroundstyle
792 \ifTP@showlatexaffection
793 \node[inner sep=4pt, anchor=south east, fill=white, draw=none, rounded corners=5, fill opacity=0.3, text opacity=1]
794 at (0.5\textwidth-7pt, -0.5\textheight+7pt){\footnotesize {\bf\textrm\LaTeX}~\textrm{Ti\emph{k}Z}\bf\textrm{poster}};
795 \fi
796 \end{pgfonlayer}
797
798 }
799
800 \AtEndDocument{%
801 \end{tikzpicture}
802 \end{center}
803 }
804
805 %%
806
807 \newcounter{figurecounter}
808
809 %% #1 Caption
810 \newenvironment{tikzfigure}[1][]{
811 \def \rememberparameter{#1}
812 \vspace{10pt}
813 \refstepcounter{figurecounter}
814 \begin{center}
815 }{
816 \ifx\rememberparameter\@empty
817 \else %nothing
818 \\[10pt]
819 {\small Fig.~\thefigurecounter: \rememberparameter}
820 \fi
821 \end{center}
822 }
823
824 %%
825
826
827
828 \endinput
829 %%
830 %% End of file `tikzposter.cls'.