Skip to content

Commit

Permalink
feat!: remove titleformat configuration
Browse files Browse the repository at this point in the history
We thereby also remove the dependency on etoolbox and use of patchcmd throughout
the package, which should mitigate problems that have arisen previously when
beamer has changes its commands.
  • Loading branch information
jolars committed Jan 19, 2024
1 parent 4a859ed commit e19f93c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 510 deletions.
64 changes: 3 additions & 61 deletions demo/demo.tex
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
\documentclass[10pt]{beamer}

\usetheme{moloch}

\usepackage[T1]{fontenc}

% \usepackage{appendixnumberbeamer}
\usetheme{moloch}

\setbeamertemplate{page number in head/foot}[appendixframenumber]
\setbeamertemplate{section in toc}[sections numbered]

% \molochset{progressbar=foot}

\usepackage{booktabs}
\usepackage[scale=2]{ccicons}

% \usepackage[medium,light]{FiraSans}
% \usepackage[medium]{FiraMono}
\usepackage{lmodern}

\usepackage{xspace}
Expand All @@ -32,7 +29,6 @@
\maketitle

\begin{frame}{Table of Contents}
\setbeamertemplate{section in toc}[sections numbered]
\tableofcontents[hideallsubsections]
\end{frame}

Expand All @@ -51,60 +47,8 @@ \section{Introduction}
\begin{frame}[fragile]{Sections}
Sections group slides of the same topic by introducing a section page between them. A progress bar is shown which indicates how far along in the presentation you are.

\begin{verbatim}\section{Title Formats}\end{verbatim}
\end{frame}

\section{Title Formats}

\begin{frame}[fragile]{Moloch Title Formats}
\themename supports four 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 globally for every frame or used locally just for the current frame and onwards by using
\begin{verbatim}\molochset{titleformat frame=<option>}\end{verbatim}
\end{frame}

{
\molochset{titleformat frame=smallcaps}
\begin{frame}{Small Caps}
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}
\end{frame}
}

{
\molochset{titleformat frame=allsmallcaps}
\begin{frame}{All Small Caps}
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.

\medskip

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

{
\molochset{titleformat frame=allcaps}
\begin{frame}{All Caps}
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}
\end{frame}
}

\section{Elements}

Expand Down Expand Up @@ -269,10 +213,8 @@ \section{Conclusion}
\appendix

\begin{frame}[allowframebreaks]{References}

\bibliography{demo}
\bibliographystyle{abbrv}

\end{frame}

\end{document}
74 changes: 1 addition & 73 deletions doc/moloch.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
\usepackage{xspace}
\onehalfspacing

\usepackage{etoolbox}

\usepackage{enumitem}
\setlist[itemize]{noitemsep}
\setlist[enumerate]{noitemsep}
Expand Down Expand Up @@ -57,7 +55,7 @@
xrightmargin=0em,
aboveskip=1em,
belowskip=1em,
morekeywords={usetheme,institute,maketitle,@moloch@titleformat,%
morekeywords={usetheme,institute,maketitle,%
plain,setbeamercolor,molochset,setsansfont,setmonofont},
}
\lstMakeShortInline|
Expand Down Expand Up @@ -205,7 +203,6 @@ \subsection{Dependencies}
\begin{itemize}
\item |tikz|
\item |pgfopts|
\item |etoolbox|
\item |calc|
\end{itemize}
\end{multicols}
Expand Down Expand Up @@ -243,26 +240,6 @@ \subsection{Package options}
A short description of the option.
}


\subsubsection{Main theme}

\DescribeOption{titleformat}%
{regular, smallcaps, allsmallcaps, allcaps}
{regular}{
Changes the format of titles, subtitles, section titles, frame titles, and
the text on ``standout'' frames. The available options produce
Regular, \textsc{SmallCaps}, \textsc{\MakeLowercase{AllSmallCaps}}, or
\MakeUppercase{AllCaps} titles. Please refer to
Section~\ref{sec:titleformats} for known issues with these options.
}

\DescribeOption{titleformat plain}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Changes the format of ``standout'' frames (see |titleformat|, above).
}


\subsubsection{Inner theme}

\DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{
Expand Down Expand Up @@ -296,20 +273,6 @@ \subsubsection{Color theme}
of the reverse.
}


\subsubsection{Font theme}

\DescribeMacro{titleformat title}
\DescribeMacro{titleformat subtitle}
\DescribeMacro{titleformat section}
\DescribeOption{titleformat frame}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Individually controls the format of titles, subtitles, section titles, and
frame titles (see |titleformat|, above).
}


\subsection{Color Customization}

The included \themename color theme is used by default, but its colors can be
Expand Down Expand Up @@ -359,43 +322,8 @@ \subsubsection{Standout frames}
\end{frame}
\end{lstlisting}

\section{Tips \& Tricks}

\section{Known Issues}

\subsection{Title formats}
\label{sec:titleformats}

Be aware that not every font supports small caps, so the |smallcaps| or
|allsmallcaps| options may not work for all fonts.
In particular, the Computer Modern sans-serif typeface, which is used when
\themename is compiled with pdf\LaTeX, does not have a small-caps variant.

The title format options |allsmallcaps| and |allcaps| are quite nice from an
aesthetic point of view, but their use of |\MakeLowercase| and
|\MakeUppercase| can cause unexpected problems. For example:

\begin{itemize}
\item Some commands, like |\\|, do not work inside |\MakeLowercase| and
|\MakeUppercase|. (See \href{https://github.com/matze/mtheme/issues/125}
{\#125})
\item Only alphabetic characters are affected by |\MakeLowercase|, so
numerals and punctuation remain at full height. This can spoil some of the
aesthetic benefits of |allsmallcaps|. (See
\href{https://github.com/matze/mtheme/issues/33}{\#33})
\item |\MakeLowercase| and |\MakeUppercase| apply to math mode and
|\scshape| does not. This can easily introduce mathematical errors that
are hard to catch.
\item It is impossible to typeset symbols which are encoded as uppercase
letters in a different font. In particular, |\mathbb| and |\mathcal|
letters will be replaced by other math glyphs. (See
\href{https://github.com/matze/mtheme/issues/153}{\#153})
\end{itemize}

The |allsmallcaps| and |allcaps| options are safe to use if your titles contain
only alphabetic characters and do not require the expansion of any macros.


\subsection{Interactions with other color themes}

\themename can be used along with any other Beamer color theme, such as
Expand Down

0 comments on commit e19f93c

Please sign in to comment.