您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

beamerthemetuw.sty 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. %%
  2. % @file beamerthemeTUW.sty
  3. % @date 2016-08-30
  4. % @author Wolfgang Puffitsch, Denise Ratasich
  5. %
  6. % @brief Beamer LaTeX template matching the corporate design of TU Wien.
  7. %%
  8. \NeedsTeXFormat{LaTeX2e}
  9. \ProvidesPackage{beamerthemeTUW}[2016/08/30 Beamer template that fits the TU Wien corporate design (adopted styles from powerpoint presentation template in CD manual)]
  10. \RequirePackage{graphicx}
  11. \RequirePackage{tikz}
  12. \def\beamer@tuwDefault{default}
  13. \def\beamer@tuwPlain{plain}
  14. \def\beamer@tuwSidebar{sidebar}
  15. \def\beamer@tuwHelvetica{helvetica}
  16. \def\beamer@tuwNoImage{none}
  17. \def\beamer@tuwLogo{TU_Logo}
  18. \def\beamer@tuwLogoWhite{TU_Logo_white}
  19. %%% options
  20. % The user may choose other fonts (TU Wien CD says to use helvetica).
  21. \DeclareOptionBeamer{font}{\def\beamer@tuwFont{#1}}
  22. % Another outer theme may be chosen, however it may not fit the TU Wien colors.
  23. \DeclareOptionBeamer{outer}{\def\beamer@tuwOuter{#1}}
  24. % Width of the sidebar.
  25. \DeclareOptionBeamer{width}{\def\beamer@tuwWidth{#1}}
  26. % Background image of TU Wien building on title page.
  27. \newif\ifbeamer@tuwBackground
  28. \DeclareOptionBeamer{tuw_background}{\beamer@tuwBackgroundtrue}
  29. % Individual background image on title page.
  30. \DeclareOptionBeamer{tuw_image}{\def\beamer@tuwImage{#1}}
  31. % White logo (if tuw_image is dark the logo should be set to be white).
  32. \newif\ifbeamer@tuwWhiteLogo
  33. \DeclareOptionBeamer{tuw_whitelogo}{\beamer@tuwWhiteLogotrue}
  34. % Print frame title beside the logo to save space.
  35. \newif\ifbeamer@tuwFrametitleToTop
  36. \DeclareOptionBeamer{tuw_frametitletotop}{\beamer@tuwFrametitleToToptrue}
  37. % defaults
  38. \ExecuteOptionsBeamer{outer=default}
  39. \ExecuteOptionsBeamer{width=1.6cm}
  40. \ExecuteOptionsBeamer{font=\familydefault}
  41. \beamer@tuwBackgroundfalse
  42. \ExecuteOptionsBeamer{tuw_image=none}
  43. \beamer@tuwWhiteLogofalse
  44. \beamer@tuwFrametitleToTopfalse
  45. \ProcessOptionsBeamer
  46. \ifx\beamer@tuwFont\beamer@tuwHelvetica
  47. \RequirePackage{helvet}
  48. \fi
  49. \mode<presentation>
  50. %%% colors
  51. % For some reason the logo is not in TU-blue (0,102,153). The powerpoint
  52. % presentation has TU-blue as background and the logo with a different color
  53. % (doesn't look nice). We align the TU-blue to the logo, like in the CD manual.
  54. \definecolor{tuwBlue}{RGB}{0,116,178}
  55. \definecolor{tuwGray}{RGB}{102,102,102}
  56. \definecolor{iceBlue}{RGB}{222,231,236}
  57. \def\tuwBlue{tuwBlue}
  58. \def\tuwGray{tuwGray}
  59. \def\iceBlue{iceBlue}
  60. \def\tuwLightBlue{tuwBlue!20!white}
  61. \def\tuwMediumBlue{tuwBlue!45!white}
  62. \def\tuwDarkBlue{tuwBlue!70!black}
  63. \def\alertred{red!50!black}
  64. % content page
  65. \setbeamercolor{normal text}{fg=black,bg=white}
  66. \setbeamercolor{alerted text}{fg=\alertred}
  67. \setbeamercolor{structure}{fg=\tuwBlue}
  68. \setbeamercolor{frametitle}{fg=black}
  69. \setbeamercolor{palette primary}{fg=\tuwDarkBlue,bg=\tuwLightBlue}
  70. \setbeamercolor{palette secondary}{fg=\tuwBlue!50!black,bg=\tuwMediumBlue}
  71. \setbeamercolor{palette tertiary}{fg=white,bg=\tuwBlue}
  72. \setbeamercolor{section in toc}{parent=normal text}
  73. \setbeamercolor{subsection in toc}{parent=section in toc}
  74. \setbeamercolor{block title}{fg=white, bg=\tuwBlue}
  75. \setbeamercolor{block title example}{fg=white, bg=\tuwBlue}
  76. \setbeamercolor{block title alerted}{fg=white, bg=\alertred}
  77. \setbeamercolor{block body}{bg=\iceBlue}
  78. \setbeamercolor{block body example}{parent=block body}
  79. \setbeamercolor{block body alerted}{parent=block body, fg=\alertred}
  80. \setbeamercolor{title in head/foot}{fg=\tuwBlue}
  81. \setbeamercolor{page number in head/foot}{fg=\tuwBlue}
  82. \setbeamercolor{footline}{fg=\tuwBlue}
  83. % color difference of default and other outer styles
  84. \ifx\beamer@tuwOuter\beamer@tuwDefault
  85. % default style - this is the CD of TU Wien
  86. % title page
  87. \setbeamercolor{title}{fg=white}
  88. \setbeamercolor{subtitle}{fg=white}
  89. \setbeamercolor{author}{fg=white}
  90. \setbeamercolor{institute}{fg=white}
  91. \setbeamercolor{date}{fg=white}
  92. % content page
  93. % keep defaults (black)
  94. \else
  95. % other outer styles (e.g., sidebar)
  96. % title page
  97. \setbeamercolor{title}{fg=\tuwGray}
  98. \setbeamercolor{subtitle}{fg=\tuwGray}
  99. \setbeamercolor{author}{fg=black}
  100. \setbeamercolor{institute}{fg=black}
  101. \setbeamercolor{date}{fg=black}
  102. % content page
  103. \setbeamercolor{frametitle}{fg=\tuwGray}
  104. \setbeamercolor{headline}{fg=\tuwGray}
  105. \setbeamercolor{footline}{fg=\tuwGray}
  106. \fi
  107. % sidebar
  108. \setbeamercolor{sidebar}{bg=\tuwBlue,fg=white}
  109. \setbeamercolor{palette sidebar primary}{fg=\tuwDarkBlue,bg=\tuwLightBlue}
  110. \setbeamercolor{palette sidebar secondary}{fg=\tuwDarkBlue,bg=\tuwLightBlue}
  111. \setbeamercolor{palette sidebar tertiary}{fg=white,bg=\tuwBlue}
  112. \setbeamercolor{title in sidebar}{fg=white,bg=\tuwBlue}
  113. \setbeamercolor{section in sidebar}{fg=\tuwDarkBlue}
  114. \setbeamercolor{section in sidebar shaded}{fg=white,bg=\tuwBlue}
  115. \setbeamercolor{subsection in sidebar}{fg=\tuwDarkBlue}
  116. \setbeamercolor{subsection in sidebar shaded}{fg=white,bg=\tuwBlue}
  117. %%% fonts
  118. % font weight
  119. \setbeamerfont{title}{series=\bfseries}
  120. \setbeamerfont{author}{series=\mdseries}
  121. \setbeamerfont{institute}{series=\mdseries}
  122. \setbeamerfont{date}{series=\mdseries}
  123. \setbeamerfont{frametitle}{series=\mdseries}
  124. \setbeamerfont{headline}{series=\mdseries}
  125. \setbeamerfont{footline}{series=\mdseries}
  126. % font size difference of default and other outer styles
  127. \ifx\beamer@tuwOuter\beamer@tuwDefault
  128. % default style - this is the CD of TU Wien
  129. \setbeamerfont{title}{size=\huge}
  130. \setbeamerfont{author}{size=\normalsize}
  131. \setbeamerfont{institute}{size=\normalsize}
  132. \setbeamerfont{date}{size=\normalsize}
  133. \setbeamerfont{frametitle}{size=\Large}
  134. \setbeamerfont{framesubtitle}{size=\large}
  135. \setbeamerfont{headline}{size=\scriptsize}
  136. \setbeamerfont{footline}{size=\scriptsize}
  137. \else
  138. % other outer styles (e.g., sidebar)
  139. % keep defaults
  140. \fi
  141. \setbeamerfont{section in toc}{parent=normal text}
  142. \setbeamerfont{subsection in toc}{parent=section in toc}
  143. % sidebar
  144. \setbeamerfont{title in sidebar}{series=\bfseries}
  145. \setbeamerfont{section in sidebar}{series=\bfseries,size=\tiny}
  146. \setbeamerfont{subsection in sidebar}{size=\tiny}
  147. %%% outer
  148. \setbeamersize{text margin left=1.2cm}
  149. \setbeamersize{text margin right=1.5cm}
  150. \beamertemplatenavigationsymbolsempty
  151. \ifx\beamer@tuwOuter\beamer@tuwDefault
  152. % default outher theme - this is the CD of TU Wien
  153. % background
  154. \setbeamertemplate{background}{
  155. \begin{tikzpicture}
  156. \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
  157. % title page
  158. \ifbeamer@tuwBackground % tu building background selected
  159. \node[anchor=south west] (background) at (-0.15cm,-0.15cm) {\includegraphics[width=1.01\paperwidth]{TU_Background}};
  160. \else\ifx\beamer@tuwImage\beamer@tuwNoImage % no background image specified
  161. \fill[white] (0,0) rectangle (\the\paperwidth,\the\paperheight);
  162. \else % individual background image
  163. \node[anchor=north west] (background) at (-0.15cm,-0.15cm) {\includegraphics[width=1.01\paperwidth]{\beamer@tuwImage}};
  164. \fi\fi
  165. \fill[\tuwBlue, rounded corners=0.5cm] (-1cm,-1cm) rectangle (\paperwidth-0.5cm,\paperheight-3cm);
  166. \ifbeamer@tuwWhiteLogo % white logo option specified
  167. \node[anchor=north west] (logo) at (0.3cm,\paperheight-0.1cm) {\includegraphics[height=2cm]{\beamer@tuwLogoWhite}};
  168. \else
  169. \node[anchor=north west] (logo) at (0.2cm,\paperheight-0.2cm) {\includegraphics[height=2cm]{\beamer@tuwLogo}};
  170. \fi
  171. % content page
  172. \ifnum\thepage>1\relax%
  173. \fill[\iceBlue] (0,0) rectangle (\the\paperwidth,\the\paperheight);
  174. \fill[white, rounded corners=0.5cm] (-1cm,-1cm) rectangle(\paperwidth-0.4cm,\paperheight-0.8cm);
  175. \node[anchor=west] (logo) at (0.3cm,\paperheight-0.4cm) {\includegraphics[height=0.5cm]{TU_Signet}};
  176. \fi
  177. \end{tikzpicture}
  178. }
  179. % title page
  180. \def\beamer@titlepageLeft{1.6cm}
  181. \setbeamertemplate{title page}{
  182. \vskip 4cm%
  183. \begin{beamercolorbox}[leftskip=\beamer@titlepageLeft]{title}%
  184. \usebeamerfont{title}\inserttitle%
  185. \end{beamercolorbox}%
  186. \vskip 0.5cm%
  187. \begin{beamercolorbox}[leftskip=\beamer@titlepageLeft]{subtitle}
  188. \usebeamerfont{subtitle}\insertsubtitle%
  189. \end{beamercolorbox}
  190. \vskip 0.25cm%
  191. \vfill%
  192. \begin{beamercolorbox}[leftskip=\beamer@titlepageLeft]{author}
  193. \usebeamerfont{author}\insertauthor%
  194. \end{beamercolorbox}
  195. \begin{beamercolorbox}[leftskip=\beamer@titlepageLeft]{date}
  196. \usebeamerfont{date}\insertdate%
  197. \end{beamercolorbox}
  198. }
  199. % frametitle
  200. \setbeamertemplate{frametitle}
  201. {%
  202. \ifbeamer@tuwFrametitleToTop % frametitle should be printed beside the logo
  203. % vbox to keep the baseline
  204. \vbox{}\vskip -0.43cm%
  205. \else
  206. \vbox{}\vskip 0.7cm%
  207. \fi
  208. \begin{beamercolorbox}[leftskip=0cm]{frametitle}
  209. \usebeamerfont{frametitle}\insertframetitle%
  210. \ifbeamer@tuwFrametitleToTop
  211. \vbox{}\vskip 0.3cm%
  212. \else
  213. \vbox{}\vskip 0.2cm%
  214. \fi
  215. \usebeamerfont{framesubtitle}\insertframesubtitle%
  216. \end{beamercolorbox}
  217. }
  218. % footline
  219. \setbeamertemplate{footline}{%
  220. \vspace{0.1cm}
  221. \ifnum\thepage>1
  222. \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footline}
  223. \hskip 1.2cm%
  224. \usebeamerfont{footline}\insertshortdate%
  225. \hfill%
  226. \insertshorttitle, \insertshortauthor%
  227. \hfill%
  228. \insertframenumber\:/\:\inserttotalframenumber%
  229. \hspace*{1.5cm}%
  230. \end{beamercolorbox}
  231. \else
  232. \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,center]{}%
  233. % empty environment to raise height
  234. \end{beamercolorbox}
  235. \fi
  236. \vspace{0.1cm}
  237. }
  238. \else\ifx\beamer@tuwOuter\beamer@tuwSidebar
  239. % sidebar outer theme
  240. \useoutertheme[width=\beamer@tuwWidth,height=0pt]{\beamer@tuwOuter}
  241. % footline
  242. \setbeamertemplate{footline}{
  243. \ifnum\thepage>1
  244. \vspace{-1cm}
  245. \hfill{\scriptsize\insertframenumber\:/\:\inserttotalframenumber~~}
  246. \vspace{0.1cm}
  247. \fi
  248. }
  249. \else
  250. \useoutertheme{\beamer@tuwOuter}
  251. \fi\fi % if outer=default or outer=sidebar
  252. %%% inner
  253. \ifx\beamer@tuwOuter\beamer@tuwDefault
  254. \setbeamertemplate{itemize items}[circle]
  255. \else
  256. % defaults
  257. \fi % if outer=default
  258. \setlength{\parskip}{6pt}
  259. % blocks
  260. \setbeamertemplate{blocks}[rounded]
  261. \pgfdeclareverticalshading{bmb@transition}{\the\paperwidth}{color(0pt)=(\iceBlue); color(3.0pt)=(\iceBlue)}
  262. \setbeamercovered{invisible}
  263. % emphasize
  264. \renewcommand<>{\emph}[1]{{\only#2{\color{\tuwBlue}}#1}}
  265. \hypersetup{colorlinks=true,linkcolor=fg,citecolor=\tuwGray,urlcolor=\tuwGray}
  266. \mode<all>