Skip to content

Commit

Permalink
feat!: simplify blocks and remove blocks with background
Browse files Browse the repository at this point in the history
  • Loading branch information
jolars committed Jan 11, 2024
1 parent fbfcc0b commit d5317d4
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 351 deletions.
172 changes: 76 additions & 96 deletions demo/demo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ \section{Introduction}

The \themename theme is a Beamer theme with minimal visual noise
inspired by the \href{https://github.com/hsrmbeamertheme/hsrmbeamertheme}{\textsc{hsrm} Beamer
Theme} by Benjamin Weiss.
Theme} by Benjamin Weiss.

Enable the theme by loading

Expand All @@ -55,55 +55,55 @@ \section{Introduction}
\section{Title formats}

\begin{frame}{Moloch title formats}
\themename supports 4 different title formats:
\begin{itemize}
\item Regular
\item \textsc{Small caps}
\item \textsc{all small caps}
\item ALL CAPS
\end{itemize}
They can either be set at once for every title type or individually.
\themename supports 4 different title formats:
\begin{itemize}
\item Regular
\item \textsc{Small caps}
\item \textsc{all small caps}
\item ALL CAPS
\end{itemize}
They can either be set at once for every title type or individually.
\end{frame}

{
\molochset{titleformat frame=smallcaps}
\molochset{titleformat frame=smallcaps}
\begin{frame}{Small caps}
This frame uses the \texttt{smallcaps} title format.
This frame uses the \texttt{smallcaps} title format.

\begin{alertblock}{Potential Problems}
Be aware that not every font supports small caps. If for example you typeset your presentation with pdfTeX and the Computer Modern Sans Serif font, every text in small caps will be typeset with the Computer Modern Serif font instead.
\end{alertblock}
\begin{alertblock}{Potential Problems}
Be aware that not every font supports small caps. If for example you typeset your presentation with pdfTeX and the Computer Modern Sans Serif font, every text in small caps will be typeset with the Computer Modern Serif font instead.
\end{alertblock}
\end{frame}
}

{
\molochset{titleformat frame=allsmallcaps}
\begin{frame}{All small caps}
This frame uses the \texttt{allsmallcaps} title format.
This frame uses the \texttt{allsmallcaps} title format.

\begin{alertblock}{Potential problems}
As this title format also uses small caps you face the same problems as with the \texttt{smallcaps} title format. Additionally this format can cause some other problems. Please refer to the documentation if you consider using it.
\begin{alertblock}{Potential problems}
As this title format also uses small caps you face the same problems as with the \texttt{smallcaps} title format. Additionally this format can cause some other problems. Please refer to the documentation if you consider using it.

As a rule of thumb: just use it for plaintext-only titles.
\end{alertblock}
As a rule of thumb: just use it for plaintext-only titles.
\end{alertblock}
\end{frame}
}

{
\molochset{titleformat frame=allcaps}
\begin{frame}{All caps}
This frame uses the \texttt{allcaps} title format.
This frame uses the \texttt{allcaps} title format.

\begin{alertblock}{Potential Problems}
This title format is not as problematic as the \texttt{allsmallcaps} format, but basically suffers from the same deficiencies. So please have a look at the documentation if you want to use it.
\end{alertblock}
\begin{alertblock}{Potential Problems}
This title format is not as problematic as the \texttt{allsmallcaps} format, but basically suffers from the same deficiencies. So please have a look at the documentation if you want to use it.
\end{alertblock}
\end{frame}
}

\section{Elements}

\begin{frame}[fragile]{Typography}
\begin{verbatim}The theme provides sensible defaults to
\begin{verbatim}The theme provides sensible defaults to
\emph{emphasize} text, \alert{accent} parts
or show \textbf{bold} results.\end{verbatim}

Expand Down Expand Up @@ -131,22 +131,22 @@ \section{Elements}
\begin{frame}{Lists}
\begin{columns}[T,onlytextwidth]
\column{0.33\textwidth}
Items
\begin{itemize}
\item Milk \item Eggs \item Potatoes
\end{itemize}
Items
\begin{itemize}
\item Milk \item Eggs \item Potatoes
\end{itemize}

\column{0.33\textwidth}
Enumerations
\begin{enumerate}
\item First, \item Second and \item Last.
\end{enumerate}
Enumerations
\begin{enumerate}
\item First, \item Second and \item Last.
\end{enumerate}

\column{0.33\textwidth}
Descriptions
\begin{description}
\item[PowerPoint] Meeh. \item[Beamer] Yeeeha.
\end{description}
Descriptions
\begin{description}
\item[PowerPoint] Meeh. \item[Beamer] Yeeeha.
\end{description}
\end{columns}
\end{frame}
\begin{frame}{Animation}
Expand All @@ -163,75 +163,55 @@ \section{Elements}
\begin{tikzpicture}
\def\couleur{alerted text.fg}
\path[coordinate] (0,0) coordinate(A)
++( 90:5cm) coordinate(B)
++(0:5cm) coordinate(C)
++(-90:5cm) coordinate(D);
++( 90:5cm) coordinate(B)
++(0:5cm) coordinate(C)
++(-90:5cm) coordinate(D);
\draw[fill=\couleur!\thedensity] (A) -- (B) -- (C) --(D) -- cycle;
\foreach \x in {1,...,40}{%
\pgfmathsetcounter{density}{\thedensity+20}
\setcounter{density}{\thedensity}
\path[coordinate] coordinate(X) at (A){};
\path[coordinate] (A) -- (B) coordinate[pos=.10](A)
-- (C) coordinate[pos=.10](B)
-- (D) coordinate[pos=.10](C)
-- (X) coordinate[pos=.10](D);
-- (C) coordinate[pos=.10](B)
-- (D) coordinate[pos=.10](C)
-- (X) coordinate[pos=.10](D);
\draw[fill=\couleur!\thedensity] (A)--(B)--(C)-- (D) -- cycle;
}
}
\end{tikzpicture}
\caption{Rotated square from
\href{http://www.texample.net/tikz/examples/rotated-polygons/}{texample.net}.}
\href{http://www.texample.net/tikz/examples/rotated-polygons/}{texample.net}.}
\end{figure}
\end{frame}
\begin{frame}{Tables}
\begin{table}
\caption{Largest cities in the world (source: Wikipedia)}
\begin{tabular}{@{} lr @{}}
\toprule
City & Population\\
City & Population \\
\midrule
Mexico City & 20,116,842\\
Shanghai & 19,210,000\\
Peking & 15,796,450\\
Istanbul & 14,160,467\\
Mexico City & 20,116,842 \\
Shanghai & 19,210,000 \\
Peking & 15,796,450 \\
Istanbul & 14,160,467 \\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
\begin{frame}{Blocks}
Three different block environments are pre-defined and may be styled with an
optional background color.

\begin{columns}[T,onlytextwidth]
\column{0.5\textwidth}
\begin{block}{Default}
Block content.
\end{block}
Three different block environments are pre-defined.

\begin{alertblock}{Alert}
Block content.
\end{alertblock}
\begin{block}{Default}
Block content.
\end{block}

\begin{exampleblock}{Example}
Block content.
\end{exampleblock}
\begin{alertblock}{Alert}
Block content.
\end{alertblock}

\column{0.5\textwidth}
\begin{exampleblock}{Example}
Block content.
\end{exampleblock}

\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{columns}
\end{frame}
\begin{frame}{Math}
\begin{equation*}
Expand All @@ -242,10 +222,10 @@ \section{Elements}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
mlineplot,
width=0.9\textwidth,
height=6cm,
]
mlineplot,
width=0.9\textwidth,
height=6cm,
]

\addplot {sin(deg(x))};
\addplot+[samples=100] {sin(deg(2*x))};
Expand All @@ -258,18 +238,18 @@ \section{Elements}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
mbarplot,
xlabel={Foo},
ylabel={Bar},
width=0.9\textwidth,
height=6cm,
]
mbarplot,
xlabel={Foo},
ylabel={Bar},
width=0.9\textwidth,
height=6cm,
]

\addplot plot coordinates {(1, 20) (2, 25) (3, 22.4) (4, 12.4)};
\addplot plot coordinates {(1, 18) (2, 24) (3, 23.5) (4, 13.2)};
\addplot plot coordinates {(1, 10) (2, 19) (3, 25) (4, 15.2)};
\addplot plot coordinates {(1, 20) (2, 25) (3, 22.4) (4, 12.4)};
\addplot plot coordinates {(1, 18) (2, 24) (3, 23.5) (4, 13.2)};
\addplot plot coordinates {(1, 10) (2, 19) (3, 25) (4, 15.2)};

\legend{lorem, ipsum, dolor}
\legend{lorem, ipsum, dolor}

\end{axis}
\end{tikzpicture}
Expand All @@ -284,8 +264,8 @@ \section{Elements}
{%
\setbeamertemplate{frame footer}{My custom footer}
\begin{frame}[fragile]{Frame footer}
\themename defines a custom beamer template to add a text to the footer. It can be set via
\begin{verbatim}\setbeamertemplate{frame footer}{My custom footer}\end{verbatim}
\themename defines a custom beamer template to add a text to the footer. It can be set via
\begin{verbatim}\setbeamertemplate{frame footer}{My custom footer}\end{verbatim}
\end{frame}
}

Expand All @@ -303,7 +283,7 @@ \section{Conclusion}

The theme \emph{itself} is licensed under a
\href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons
Attribution-ShareAlike 4.0 International License}.
Attribution-ShareAlike 4.0 International License}.

\begin{center}\ccbysa\end{center}

Expand Down
4 changes: 0 additions & 4 deletions doc/molochtheme.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,6 @@ 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
Expand Down
42 changes: 1 addition & 41 deletions src/beamercolorthememoloch.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@
%
% \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
Expand All @@ -66,7 +54,6 @@
\newcommand{\moloch@color@setdefaults}{
\pgfkeys{/moloch/color/.cd,
background=light,
block=transparent,
}
}
% \end{macrocode}
Expand Down Expand Up @@ -172,34 +159,9 @@
}
% \end{macrocode}
%
% 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.
% Block environments use alerted tex and example text for the title
%
% \begin{macrocode}
\newcommand{\moloch@block@transparent}{
\setbeamercolor{block title}{%
use=normal text,
fg=normal text.fg,
bg=
}
\setbeamercolor{block body}{
bg=
}
}
\newcommand{\moloch@block@fill}{
\setbeamercolor{block title}{%
use=normal text,
fg=normal text.fg,
bg=normal text.bg!80!fg
}
\setbeamercolor{block body}{
use={block title, normal text},
bg=block title.bg!50!normal text.bg
}
}
\setbeamercolor{block title alerted}{%
use={block title, alerted text},
fg=alerted text.fg
Expand All @@ -208,8 +170,6 @@
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
Expand Down

0 comments on commit d5317d4

Please sign in to comment.