beamerthemeJuelich.sty 6.94 KB
Newer Older
1
% Latex-Beamer Template Research Centre Juelich
2
% version 18.12
3 4 5
% please report any problems to i.kabadshow@fz-juelich.de
% this version does support pdflatex, xelatex and lualatex
%
6 7 8
\ProvidesPackage{beamerthemeJuelich}%
           [2018/12/14 v18.12
            Research Centre Juelich Beamer Template]%
9 10

\RequirePackage{ifluatex,ifxetex,ifpdf}
11
\RequirePackage{etoolbox}
12
\RequirePackage{tikz}
13
\RequirePackage{calc}
Ivo Kabadshow's avatar
Ivo Kabadshow committed
14
\RequirePackage{textcase}
15
\RequirePackage{ifthen}
16
\usetikzlibrary{calc}
Ivo Kabadshow's avatar
Ivo Kabadshow committed
17
\usetikzlibrary{external}
18 19 20

\ifluatex
  \RequirePackage{microtype}
21
  \RequirePackage{fontspec}
22 23 24
  \setmainfont{LiberationSans}
  \setsansfont{LiberationSans}
  \setmonofont{LiberationMono}
25 26
\else\ifxetex
  \RequirePackage{fontspec}
27 28 29
  \setmainfont{LiberationSans}
  \setsansfont{LiberationSans}
  \setmonofont{LiberationMono}
30
\else
31
  \RequirePackage{helvet}
32
  \RequirePackage{microtype}
Andreas Beckmann's avatar
Andreas Beckmann committed
33
\fi\fi
34 35 36 37 38 39 40 41 42 43 44 45 46 47



\newcommand{\fzjset}[1]{\pgfkeys{/beamerfzj/.cd,#1}}

\pgfkeys{/beamerfzj/.cd,
  .search also={
    /beamerfzj/inner,
    /beamerfzj/outer,
    /beamerfzj/color,
    /beamerfzj/font,
  }
}

48 49
\pgfkeys{/beamerfzj/.cd,
  pages layout/.code={%
Andreas Beckmann's avatar
Andreas Beckmann committed
50 51
        \usepackage{pgf}
        \usepackage{pgfpages}
52
        \pgfpagesuselayout{#1}[a4paper,border shrink=5mm]
Andreas Beckmann's avatar
Andreas Beckmann committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

        \pgfpageslogicalpageoptions{1}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{2}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{3}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{4}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{5}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{6}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{7}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{8}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{9}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{10}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{11}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{12}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{13}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{14}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{15}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
        \pgfpageslogicalpageoptions{16}{border code=\pgfsetlinewidth{0.4pt}\pgfstroke}
70
  }%
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
}

\mode<presentation>

% Juelich specific definitions

\deftranslation[]{SlideName}{Slide}
\deftranslation[to=German]{SlideName}{Folie}

\deftranslation[]{HelmholtzBanner}{Member of the Helmholtz Association}
\deftranslation[to=German]{HelmholtzBanner}{Mitglied der Helmholtz-Gemeinschaft}

\usefonttheme{Juelich}
\usecolortheme{Juelich}
\useinnertheme{Juelich}
\useoutertheme{Juelich}

% default settings for title, part and section pages
Ivo Kabadshow's avatar
Ivo Kabadshow committed
89 90 91 92 93
\fzjset{
  title=allcaps,
  subtitle=regular,
  part=regular,
  frametitle=allcaps,
94
  compat mode=disabled,
Ivo Kabadshow's avatar
Ivo Kabadshow committed
95
}
96 97 98 99 100

\mode<all>

% define progressbar
\makeatletter
Ivo Kabadshow's avatar
Ivo Kabadshow committed
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
\newif\iffzj@progressbar@countoverlays
\newif\iffzj@progressbar@countappendix
\newif\iffzj@progressbar@counttitlepage
\newif\iffzj@progressbar@invertappendix
\pgfkeys{/beamerfzj/progress bar/.cd,
  %
  height/.default=0.4pt,
  height/.code={%
    \setlength{\fzj@progressbar@height}{#1}%
  },
  %
  count overlays/.is if=fzj@progressbar@countoverlays,
  count appendix/.is if=fzj@progressbar@countappendix,
  count titlepage/.is if=fzj@progressbar@counttitlepage,
  invert appendix/.is if=fzj@progressbar@invertappendix
}


\newcommand\fzj@progressbar@end\inserttotalframenumber%
\newcommand\fzj@progressbar@current\insertframenumber%
\newlength{\fzj@progressbar@width}%
\newlength{\fzj@progressbar@height}%
\newcommand\fzj@progressbar@titlepagereduction@current{0}%
\newcommand\fzj@progressbar@titlepagereduction@end{0}%
\pgfkeys{/beamerfzj/progress bar/height}%
Ivo Kabadshow's avatar
Ivo Kabadshow committed
127
\setbeamertemplate{progress bar footer}{
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
  %% 
  %% CHECK OPTIONS
  %%
  %% Count pages (overlays) or frames?
  \iffzj@progressbar@countoverlays%
    \renewcommand\fzj@progressbar@end\insertdocumentendpage%
    \renewcommand\fzj@progressbar@current\insertpagenumber%
  \else%
    \renewcommand\fzj@progressbar@end\inserttotalframenumber%
    \renewcommand\fzj@progressbar@current\insertframenumber%
  \fi%
  %% Stop at end of appendix or before appendix?
  \iffzj@progressbar@countappendix%
    % Don't change anything
  \else%
    %% This works only if we count pages and not frames
    \iffzj@progressbar@countoverlays%
      \renewcommand\fzj@progressbar@end{\beamer@startpageofappendix - 1}%
    \else%
      % not implemented, one would need \beamer@startpageofappendix but for frame number and not page number
    \fi%
  \fi%
  %% Include the title page in progress bar or not
  %% There are so many ifs because frame count for title page is 0, bud slide count for title page is 1
  \iffzj@progressbar@counttitlepage%
    \iffzj@progressbar@countoverlays%
      \renewcommand{\fzj@progressbar@titlepagereduction@current}{0}%
      \renewcommand{\fzj@progressbar@titlepagereduction@end}{0}%
    \else%
      \renewcommand{\fzj@progressbar@titlepagereduction@current}{1}%
      \renewcommand{\fzj@progressbar@titlepagereduction@end}{1}%
    \fi%
  \else%
    \iffzj@progressbar@countoverlays%
      \renewcommand{\fzj@progressbar@titlepagereduction@current}{-1}%
      \renewcommand{\fzj@progressbar@titlepagereduction@end}{+1}%
    \else%
      \renewcommand{\fzj@progressbar@titlepagereduction@current}{0}%
      \renewcommand{\fzj@progressbar@titlepagereduction@end}{2}%
    \fi%
  \fi%
  %% Invert appendix progress bar
  %%% Only supported for frames
  %%% Makes only sense if count appendix=true
  \iffzj@progressbar@invertappendix%
    \ifthenelse{\not\(\insertpagenumber<\beamer@startpageofappendix\)}{%
      \pgfmathsetmacro{\fzj@progressbar@current}{1+\insertdocumentendpage-\insertpagenumber}
      \pgfmathsetmacro{\fzj@progressbar@end}{2+\insertdocumentendpage-(\beamer@startpageofappendix)}
    }%
    {}%
  \else%
  % Nothing to do here
  \fi%
  %%
  %%
  %%
  \nointerlineskip%
  \pgfmathsetlength{%
    \fzj@progressbar@width%
  }{%
      \paperwidth * divide(\fzj@progressbar@current + \fzj@progressbar@titlepagereduction@current,\fzj@progressbar@end - \fzj@progressbar@titlepagereduction@end)%
Ivo Kabadshow's avatar
Ivo Kabadshow committed
189 190 191 192
  }%
  \begin{beamercolorbox}[wd=\paperwidth]{progress bar footer}
    \tikzset{external/export next=false}%
    \begin{tikzpicture}
193
      \fill[fg] (0,0) rectangle (\fzj@progressbar@width, \fzj@progressbar@height);
Ivo Kabadshow's avatar
Ivo Kabadshow committed
194 195
    \end{tikzpicture}%
  \end{beamercolorbox}
196
}
Ivo Kabadshow's avatar
Ivo Kabadshow committed
197 198 199 200 201 202

% make sure we have a large number of total slided before the first run to keep the frame/total frame ratio below 1
% if your slide deck has more than 300 slides, you might increase the number below
% after the second latex run the totalframenumber will be read correctly from the .aux file
\def\inserttotalframenumber{300}

203
\makeatother