-
Notifications
You must be signed in to change notification settings - Fork 0
/
funcs.tex
100 lines (86 loc) · 2.69 KB
/
funcs.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
\newcounter{acolumn}% Number of current column
\newlength{\acolumnmaxheight}% Maximum column height
%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
% `column` replacement to measure height
\newenvironment{@acolumn}[1]{%
\stepcounter{acolumn}%
\begin{lrbox}{\@tempboxa}%
\begin{minipage}{#1}%
}{%
\end{minipage}
\end{lrbox}
\@tempdimc=\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax
% Save height of this column:
\expandafter\xdef\csname acolumn@height@\roman{acolumn}\endcsname{\the\@tempdimc}%
% Save maximum height
\ifdim\@tempdimc>\acolumnmaxheight
\global\acolumnmaxheight=\@tempdimc
\fi
}
% `column` wrapper which sets the height beforehand
\newenvironment{@@acolumn}[1]{%
\stepcounter{acolumn}%
% The \autoheight macro contains a \vspace macro with the maximum height minus the natural column height
\edef\autoheight{\noexpand\vspace*{\dimexpr\acolumnmaxheight-\csname acolumn@height@\roman{acolumn}\endcsname\relax}}%
% Call original `column`:
\orig@column{#1}%
}{%
\endorig@column
}
% Save orignal `column` environment away
\let\orig@column\column
\let\endorig@column\endcolumn
% `columns` variant with automatic height adjustment
\NewEnviron{acolumns}[1][]{%
% Init vars:
\setcounter{acolumn}{0}%
\setlength{\acolumnmaxheight}{0pt}%
\def\autoheight{\vspace*{0pt}}%
% Set `column` environment to special measuring environment
\let\column\@acolumn
\let\endcolumn\end@acolumn
\BODY% measure heights
% Reset counter for second processing round
\setcounter{acolumn}{0}%
% Set `column` environment to wrapper
\let\column\@@acolumn
\let\endcolumn\end@@acolumn
% Finally process columns now for real
\begin{columns}[#1]%
\BODY
\end{columns}%
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%
\NewEnviron{frameNoSB}{
\makeatletter
\setbeamertemplate{sidebar canvas left}{}
\setbeamertemplate{sidebar left}{}
\makeatother
\begin{frame}
\BODY
%\tableofcontents
\end{frame}
}
\NewEnviron{frameTitle}{
\setbeamertemplate{frametitle}[default][center]
\makeatletter
\setbeamertemplate{headline}{\color{backgroundColor}45\newline 45\newline 45\newline 45\newline 45\newline 45\newline 45\newline 45\newline 45\newline 45}
\setbeamertemplate{sidebar canvas left}{}
\setbeamertemplate{sidebar left}{}
\makeatother
\begin{frame}
\begin{minipage}[c]{\linewidth-\beamerleftmargin+\beamerrightmargin}
\BODY
\end{minipage}
\end{frame}
}
\setbeamerfont{title}{series=\bfseries,parent=structure}
\setbeamerfont{subtitle}{size=\Large,series=,parent=structure}
\makeatletter
\newlength\beamerleftmargin
\setlength\beamerleftmargin{\Gm@lmargin}
\newlength\beamerrightmargin
\setlength\beamerrightmargin{\Gm@rmargin}
\makeatother