Newer
Older
LaTeX / beamerthemes / beamerthemenzcs / beamerthemenzcs.sty
Nigel Stanger on 12 Sep 2016 7 KB Merge commit '75f193f' as 'beamerthemes'
  1. \ProvidesPackage{beamerthemenzcs}[2004/08/30 ver 2.21]
  2. \NeedsTeXFormat{LaTeX2e}[1995/12/01]
  3.  
  4. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  5. %
  6. % Copyright 2004 by Nigel Stanger <nstanger@infoscience.otago.ac.nz>.
  7. % Based on beamerthemesplit.sty copyright 2003 Till Tantau <tantau@cs.tu-berlin.de>.
  8. %
  9. % This program can be redistributed and/or modified under the terms
  10. % of the LaTeX Project Public License Distributed from CTAN
  11. % archives in directory macros/latex/base/lppl.txt.
  12. %
  13. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  14.  
  15.  
  16. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  17. %
  18. % Load in the NZCS banner graphic.
  19. %
  20. \pgfdeclareimage[width=12.8cm,height=1.39cm]{banner}{NZCSbanner}
  21.  
  22.  
  23. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  24. %
  25. % Set up NZCS colours. For some reason the CMYK versions come out looking nothing
  26. % like what they should, so we'll use RGB instead.
  27. %
  28. % \definecolor{nzcsdarkorange}{cmyk}{0.12,0.61,0.97,0}
  29. % \definecolor{nzcslightorange}{cmyk}{0.05,0.45,0.74,0}
  30. % \definecolor{nzcspurple}{cmyk}{0.68,0.97,0.65,0}
  31. \definecolor{nzcsdarkorange}{rgb}{0.878,0.388,0.028}
  32. \definecolor{nzcslightorange}{rgb}{0.945,0.549,0.259}
  33. \definecolor{nzcspurple}{rgb}{0.322,0.031,0.349}
  34.  
  35. % Set beamer to use NZCS colours where appropriate.
  36. \definecolor{beamerstructure}{rgb}{0.322,0.031,0.349}
  37.  
  38.  
  39. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  40. %
  41. % Other miscellaneous colours.
  42. %
  43. \definecolor{lavender}{cmyk}{0.48,0.61,0.35,0}
  44.  
  45.  
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47. %
  48. % Set up frame footer components.
  49. %
  50. \def\insertfooterleft{}
  51. \def\insertfootercenter{}
  52. \def\insertfooterright{}
  53.  
  54. \newcommand{\footerleft}[1]{\renewcommand{\insertfooterleft}{#1}}
  55. \newcommand{\footercenter}[1]{\renewcommand{\insertfootercenter}{#1}}
  56. \newcommand{\footerright}[1]{\renewcommand{\insertfooterright}{#1}}
  57.  
  58.  
  59. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  60. %
  61. % Create a frame title that's split over two lines, with the first line
  62. % normal size and the second line small text (used for, e.g., references).
  63. %
  64. \newcommand{\frametitlesub}[2]{%
  65. \frametitle{\parbox[t]{\textwidth}{#1 \\ \normalfont\tiny #2}}%
  66. }
  67.  
  68.  
  69. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  70. %
  71. % Highlight a piece of text using the alert colour and also by drawing a
  72. % frame around it. We need to ensure that the "unhighlighted" version is
  73. % drawn in a box of the same height as the "highlighted" version. Thus the
  74. % use of \boxheight, \boxdepth and \boxtotalheight to control things.
  75. %
  76. % We draw the "unhighlighted" version as is. We draw the "highlighted"
  77. % version in a box of the same height by using \raisebox to make TeX think
  78. % that the framed text is actually the same height as the original text
  79. % (we don't raise the text at all).
  80. %
  81. % Since different texts will have different ascenders and descenders, we
  82. % insert a strut to ensure that all the frames come out with the same total
  83. % height.
  84. %
  85. % Note that the frame will always be drawn in the handout, but the alert
  86. % colour won't.
  87. %
  88. \newlength{\boxheight}
  89. \settoheight{\boxheight}{Abdfghjklpqty()}
  90. \newlength{\boxdepth}
  91. \settodepth{\boxdepth}{Abdfghjklpqty()}
  92. \newlength{\boxtotalheight}
  93. \setlength{\boxtotalheight}{\boxheight}
  94. \addtolength{\boxtotalheight}{\boxdepth}
  95.  
  96. \newcommand<>{\BoxHighlight}[2][beameralert]{%
  97. \setlength{\fboxsep}{1pt}%
  98. \alt#3{\textcolor<handout:0>{#1}{\raisebox{0pt}[\boxheight][\boxdepth]{\framebox[\width]{\rule[-\boxdepth]{0pt}{\boxtotalheight}#2}}}}{#2}%
  99. }
  100.  
  101.  
  102. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  103. %
  104. % Title page
  105. %
  106. \usetitlepagetemplate{%
  107. \vbox{}%
  108. \vfill%
  109. \begin{centering}%
  110. \Large\structure{\inserttitle}%
  111. \vskip1em\par%
  112. \normalsize\insertauthor\vskip1em\par%
  113. {\scriptsize\insertinstitute\par}\par\vskip1em%
  114. \insertdate\par\vskip1.5em%
  115. \inserttitlegraphic%
  116. \end{centering}%
  117. \vfill%
  118. }
  119.  
  120.  
  121. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  122. %
  123. % Frametitles
  124. %
  125. \useframetitletemplate{%
  126. \vskip8pt%
  127. {\leftskip-\beamer@leftmargin\advance\leftskip by0.3cm%
  128. \rightskip-\beamer@rightmargin plus1fil\advance\rightskip by0.3cm\leavevmode%
  129. \color{beamerstructure}%
  130. \Large\textbf{\insertframetitle}\par}%
  131. }
  132.  
  133.  
  134. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  135. %
  136. % Sections in headline
  137. %
  138. \usesectionheadtemplate%
  139. {\hfill\color{beamerstructure}\tiny\textbf{\insertsectionhead}}%
  140. {\hfill\color{nzcsdarkorange!75!beamerstructure}\tiny\textbf{\insertsectionhead}}
  141.  
  142. \usesubsectionheadtemplate%
  143. {\color{beamerstructure}\tiny\textbf{\insertsubsectionhead}}%
  144. {\color{nzcsdarkorange!75!beamerstructure}\tiny\textbf{\insertsubsectionhead}}
  145.  
  146.  
  147. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  148. %
  149. % Entries in table of contents
  150. %
  151. \usetemplatetocsection[40!averagebackgroundcolor]%
  152. {\color{beamerstructure}\large\inserttocsection}
  153.  
  154. \usetemplatetocsubsection[40!averagebackgroundcolor]%
  155. {\leavevmode\leftskip=1.5em\color{beamerstructure}\inserttocsubsection\par}
  156.  
  157.  
  158. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  159. %
  160. % Head. Draws the NZCS banner across the top of the frame, with sections &
  161. % subsections to the right, separated by a vertical rule. Note that sections
  162. % & subsections are limited to about six of each vertically. Any more and you'll
  163. % overflow the vertical limits of the banner. A good incentive to keep the number
  164. % of sections down :)
  165. %
  166. \newbox\headbox
  167. \useheadtemplate{%
  168. \vbox{%
  169. \tiny%
  170. \setbox\headbox=\hbox to 0.7\paperwidth{%
  171. \vbox to 1.39cm{\vfil\insertsectionnavigation{0.35\paperwidth}\vfil}%
  172. {\color{nzcsdarkorange!75!beamerstructure}\vrule width1pt height1.39cm}%
  173. \vbox to 1.39cm{\vfil\insertsubsectionnavigation{0.35\paperwidth}\vfil}%
  174. \hfill%
  175. }%
  176. \hbox to\paperwidth{%
  177. {\hskip-\beamer@leftmargin\rlap{\pgfuseimage{banner}}}%
  178. \hskip 0.3\paperwidth\box\headbox\hfill\hskip-\beamer@rightmargin%
  179. }%
  180. }}
  181.  
  182.  
  183. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  184. %
  185. % Draw a footer line across the page. Uses a similar shading to the NZCS
  186. % banner graphic.
  187. %
  188. \pgfdeclarehorizontalshading{footershading}{0.35cm}%
  189. {color(0cm)=(nzcslightorange); color(\paperwidth)=(nzcsdarkorange)}
  190. \newbox\linebox
  191. \def\footerline#1{%
  192. \hbox{%
  193. \setbox\linebox=\hbox to0.96\paperwidth{\hskip0.02\paperwidth\tiny{#1}\hskip0.02\paperwidth}%
  194. \ht\linebox=7pt%
  195. \dp\linebox=0pt%
  196. \setbox\linebox=\vbox{\box\linebox\vskip3pt}%
  197. \hskip-\beamer@leftmargin%
  198. \rlap{\pgfuseshading{footershading}}%
  199. \box\linebox%
  200. }%
  201. }
  202.  
  203.  
  204. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  205. %
  206. % Footline
  207. %
  208. \usefoottemplate{%
  209. \vbox{%
  210. \footerline{%
  211. \color{black}%
  212. \makebox[0.32\paperwidth][l]{\insertfooterleft}%
  213. \makebox[0.32\paperwidth]{\insertfootercenter}%
  214. \makebox[0.32\paperwidth][r]{\insertfooterright}%
  215. }}}
  216.  
  217.  
  218. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  219. %
  220. % Background
  221. %
  222. \usebackgroundtemplate{}
  223.  
  224.  
  225. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  226. %
  227. % Blocks
  228. %
  229. \useblocktemplate{\medskip{\color{beamerstructure}\large{\insertblockname}}\par}{\medskip}
  230. \usealertblocktemplate{\medskip{\alert{\large{\insertblockname}}}\par}{\medskip}
  231. \useexampleblocktemplate{\medskip\begingroup{\color{beamerstructure!50!green}\large{\insertblockname}}\par%
  232. \color{black!50!green}}{\endgroup\medskip}
  233.  
  234.  
  235. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  236. %
  237. % Highlighting
  238. %
  239. \usealerttemplate{\color{beameralert}}{}
  240.  
  241.