diff --git a/doc/moloch.tex b/doc/moloch.tex index 771dca0..8e0e218 100644 --- a/doc/moloch.tex +++ b/doc/moloch.tex @@ -260,6 +260,11 @@ The list of options is structured as shown in the following example. \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}{ Provides the option to have a dark background and light foreground instead of the reverse. diff --git a/examples/demo/demo.tex b/examples/demo/demo.tex index fe8ea12..7e21bf7 100644 --- a/examples/demo/demo.tex +++ b/examples/demo/demo.tex @@ -150,21 +150,43 @@ \end{tabular} \end{table} \end{frame} -\begin{frame}{Blocks} - Three different block environments are pre-defined. +\begin{frame}[fragile]{Blocks} + 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} - Block content. - \end{block} + \begin{columns}[T] + \begin{column}{0.45\textwidth} + \begin{block}{Default} + Block content. + \end{block} - \begin{alertblock}{Alert} - Block content. - \end{alertblock} + \begin{alertblock}{Alert} + Block content. + \end{alertblock} - \begin{exampleblock}{Example} - Block content. - \end{exampleblock} + \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} \begin{frame}{Math} diff --git a/src/beamercolorthememoloch.dtx b/src/beamercolorthememoloch.dtx index e84c154..9ba296f 100644 --- a/src/beamercolorthememoloch.dtx +++ b/src/beamercolorthememoloch.dtx @@ -36,6 +36,18 @@ % % \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} % Provides the option to have a dark background and light foreground instead @@ -161,9 +173,37 @@ } % \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} +\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}{% use={block title, alerted text}, fg=alerted text.fg @@ -172,6 +212,8 @@ use={block title, example text}, 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} % % Footnotes @@ -181,6 +223,14 @@ \setbeamercolor{footnote mark}{fg=.} % \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 % colors at the time of use. This prevents us having to set the correct color in % normal and standout mode. diff --git a/testfiles/support/molochexample.tex b/testfiles/support/molochexample.tex index aaac499..99f0669 100644 --- a/testfiles/support/molochexample.tex +++ b/testfiles/support/molochexample.tex @@ -71,6 +71,43 @@ \end{itemize} \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 \begin{frame}{Backup slides}