You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

825 lines
30 KiB

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