feat: reinstate support for `block` option
Closes #6. Thanks @samcarter.
This commit is contained in:
parent
54e0fce68b
commit
bf63dcd179
|
@ -260,6 +260,11 @@ The list of options is structured as shown in the following example.
|
||||||
|
|
||||||
\subsubsection{Color theme}
|
\subsubsection{Color theme}
|
||||||
|
|
||||||
|
\DescribeOption{block}{transparent, fill}{transparent}{
|
||||||
|
Optionally adds a light grey background to block environments like |theorem|
|
||||||
|
and |example|.
|
||||||
|
}
|
||||||
|
|
||||||
\DescribeOption{background}{dark, light}{light}{
|
\DescribeOption{background}{dark, light}{light}{
|
||||||
Provides the option to have a dark background and light foreground instead
|
Provides the option to have a dark background and light foreground instead
|
||||||
of the reverse.
|
of the reverse.
|
||||||
|
|
|
@ -150,21 +150,43 @@
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
\begin{frame}{Blocks}
|
\begin{frame}[fragile]{Blocks}
|
||||||
Three different block environments are pre-defined.
|
Three different block environments are pre-defined: \verb|block|, \verb|alertblock|,
|
||||||
|
and \verb|exampleblock|. They can be styled using the option
|
||||||
|
\verb|block|, which takes values \verb|transparent| (default, left column) and \verb|fill| (right column).
|
||||||
|
|
||||||
\begin{block}{Default}
|
\begin{columns}[T]
|
||||||
Block content.
|
\begin{column}{0.45\textwidth}
|
||||||
\end{block}
|
\begin{block}{Default}
|
||||||
|
Block content.
|
||||||
|
\end{block}
|
||||||
|
|
||||||
\begin{alertblock}{Alert}
|
\begin{alertblock}{Alert}
|
||||||
Block content.
|
Block content.
|
||||||
\end{alertblock}
|
\end{alertblock}
|
||||||
|
|
||||||
\begin{exampleblock}{Example}
|
\begin{exampleblock}{Example}
|
||||||
Block content.
|
Block content.
|
||||||
\end{exampleblock}
|
\end{exampleblock}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{0.45\textwidth}
|
||||||
|
{
|
||||||
|
\molochset{block=fill}
|
||||||
|
|
||||||
|
\begin{block}{Default}
|
||||||
|
Block content.
|
||||||
|
\end{block}
|
||||||
|
|
||||||
|
\begin{alertblock}{Alert}
|
||||||
|
Block content.
|
||||||
|
\end{alertblock}
|
||||||
|
|
||||||
|
\begin{exampleblock}{Example}
|
||||||
|
Block content.
|
||||||
|
\end{exampleblock}
|
||||||
|
}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\begin{frame}{Math}
|
\begin{frame}{Math}
|
||||||
|
|
|
@ -36,6 +36,18 @@
|
||||||
%
|
%
|
||||||
% \subsubsection{Options}
|
% \subsubsection{Options}
|
||||||
%
|
%
|
||||||
|
% \begin{macro}{block}
|
||||||
|
% Optionally adds a light grey background to block environments like
|
||||||
|
% |theorem| and |example|.
|
||||||
|
% \begin{macrocode}
|
||||||
|
\pgfkeys{
|
||||||
|
/moloch/color/block/.cd,
|
||||||
|
.is choice,
|
||||||
|
transparent/.code=\moloch@block@transparent,
|
||||||
|
fill/.code=\moloch@block@fill,
|
||||||
|
}
|
||||||
|
% \end{macrocode}
|
||||||
|
% \end{macro}
|
||||||
%
|
%
|
||||||
% \begin{macro}{colors}
|
% \begin{macro}{colors}
|
||||||
% Provides the option to have a dark background and light foreground instead
|
% Provides the option to have a dark background and light foreground instead
|
||||||
|
@ -161,9 +173,37 @@
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Block environments use alerted tex and example text for the title
|
% Block environments such as |theorem| and |example| have no background color
|
||||||
|
% by default. The option |block=fill| sets a background color based on the
|
||||||
|
% background and foreground of |normal text|. The option |block=transparent|
|
||||||
|
% reverts the block environments to an empty background, which can be useful
|
||||||
|
% if changing colors mid-presentation.
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
|
\newcommand{\moloch@block@transparent}{
|
||||||
|
\setbeamercolor{block title}{bg=}
|
||||||
|
\setbeamercolor{block body}{bg=}
|
||||||
|
\setbeamercolor{block title alerted}{bg=}
|
||||||
|
\setbeamercolor{block title example}{bg=}
|
||||||
|
}
|
||||||
|
\newcommand{\moloch@block@fill}{
|
||||||
|
\setbeamercolor{block title}{%
|
||||||
|
bg=normal text.bg!80!fg
|
||||||
|
}
|
||||||
|
\setbeamercolor{block body}{%
|
||||||
|
bg=block title.bg!50!normal text.bg
|
||||||
|
}
|
||||||
|
\setbeamercolor{block title alerted}{%
|
||||||
|
bg=block title.bg,
|
||||||
|
}
|
||||||
|
\setbeamercolor{block title example}{%
|
||||||
|
bg=block title.bg,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\setbeamercolor{block title}{%
|
||||||
|
use=normal text,
|
||||||
|
fg=normal text.fg
|
||||||
|
}
|
||||||
\setbeamercolor{block title alerted}{%
|
\setbeamercolor{block title alerted}{%
|
||||||
use={block title, alerted text},
|
use={block title, alerted text},
|
||||||
fg=alerted text.fg
|
fg=alerted text.fg
|
||||||
|
@ -172,6 +212,8 @@
|
||||||
use={block title, example text},
|
use={block title, example text},
|
||||||
fg=example text.fg
|
fg=example text.fg
|
||||||
}
|
}
|
||||||
|
\setbeamercolor{block body alerted}{use=block body, parent=block body}
|
||||||
|
\setbeamercolor{block body example}{use=block body, parent=block body}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Footnotes
|
% Footnotes
|
||||||
|
@ -181,6 +223,14 @@
|
||||||
\setbeamercolor{footnote mark}{fg=.}
|
\setbeamercolor{footnote mark}{fg=.}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
|
%
|
||||||
|
% Footnotes
|
||||||
|
%
|
||||||
|
% \begin{macrocode}
|
||||||
|
\setbeamercolor{footnote}{fg=normal text.fg!90}
|
||||||
|
\setbeamercolor{footnote mark}{fg=.}
|
||||||
|
% \end{macrocode}
|
||||||
|
%
|
||||||
% We also reset the bibliography colors in order to pick up the surrounding
|
% We also reset the bibliography colors in order to pick up the surrounding
|
||||||
% colors at the time of use. This prevents us having to set the correct color in
|
% colors at the time of use. This prevents us having to set the correct color in
|
||||||
% normal and standout mode.
|
% normal and standout mode.
|
||||||
|
|
|
@ -71,6 +71,43 @@
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Blocks}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{0.45\textwidth}
|
||||||
|
\begin{block}{Default}
|
||||||
|
Block content.
|
||||||
|
\end{block}
|
||||||
|
|
||||||
|
\begin{alertblock}{Alert}
|
||||||
|
Block content.
|
||||||
|
\end{alertblock}
|
||||||
|
|
||||||
|
\begin{exampleblock}{Example}
|
||||||
|
Block content.
|
||||||
|
\end{exampleblock}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{0.45\textwidth}
|
||||||
|
{
|
||||||
|
\molochset{block=fill}
|
||||||
|
|
||||||
|
\begin{block}{Default}
|
||||||
|
Block content.
|
||||||
|
\end{block}
|
||||||
|
|
||||||
|
\begin{alertblock}{Alert}
|
||||||
|
Block content.
|
||||||
|
\end{alertblock}
|
||||||
|
|
||||||
|
\begin{exampleblock}{Example}
|
||||||
|
Block content.
|
||||||
|
\end{exampleblock}
|
||||||
|
}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
\appendix
|
\appendix
|
||||||
|
|
||||||
\begin{frame}{Backup slides}
|
\begin{frame}{Backup slides}
|
||||||
|
|
Loading…
Reference in New Issue