doc: redesign manual for moloch

This commit is contained in:
Johan Larsson 2024-11-22 20:52:19 +01:00
parent 6deb04548f
commit e770ca1893
No known key found for this signature in database
GPG Key ID: 2A41C0FEDD6FF540
6 changed files with 87 additions and 66 deletions

View File

@ -11,6 +11,9 @@
%% --------------------------------------------------------------------------- %% ---------------------------------------------------------------------------
%% Copyright 2024 Johan Larsson and contributors %% Copyright 2024 Johan Larsson and contributors
%% --------------------------------------------------------------------------- %% ---------------------------------------------------------------------------
\PassOptionsToPackage{unicode,pdfusetitle}{hyperref}
\PassOptionsToPackage{hyphens}{xurl}
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass{ltxdoc} \documentclass{ltxdoc}
@ -18,7 +21,10 @@
\usepackage{setspace} \usepackage{setspace}
\usepackage{xspace} \usepackage{xspace}
\usepackage{xurl} \usepackage{xurl}
\onehalfspacing
\usepackage{lmodern}
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
\usepackage{enumitem} \usepackage{enumitem}
\setlist[itemize]{noitemsep} \setlist[itemize]{noitemsep}
@ -35,8 +41,8 @@
\lstset{% \lstset{%
language=[LaTeX]{TeX}, language=[LaTeX]{TeX},
basicstyle=\ttfamily, basicstyle=\ttfamily,
keywordstyle=\color{mLightBrown}\bfseries, keywordstyle=\color{MidnightBlue}\bfseries,
commentstyle=\color{mLightGreen}, commentstyle=\color{Periwinkle},
stringstyle=\color{mLightGreen}, stringstyle=\color{mLightGreen},
backgroundcolor=\color{mBackground}, backgroundcolor=\color{mBackground},
numbers=none, numbers=none,
@ -58,22 +64,27 @@
xrightmargin=0em, xrightmargin=0em,
aboveskip=1em, aboveskip=1em,
belowskip=1em, belowskip=1em,
morekeywords={usetheme,institute,maketitle,@moloch@titleformat,% morekeywords={
plain,setbeamercolor,molochset,setsansfont,setmonofont}, usetheme,
institute,
maketitle,
@moloch@titleformat,
%plain,
setbeamercolor,
molochset,
setsansfont,
setmonofont
},
} }
\lstMakeShortInline| \lstMakeShortInline|
\usepackage{metalogo} \usepackage{metalogo}
\usepackage[colorlinks=true, \usepackage[colorlinks=true,linkcolor=MidnightBlue,urlcolor=MidnightBlue]{hyperref}
linkcolor=mLightBrown,
menucolor=mLightBrown,
pagecolor=mLightBrown,
urlcolor=mLightBrown]{hyperref}
\newcommand{\DescribeOption}[4]{ \newcommand{\DescribeOption}[4]{
\DescribeMacro{#1} \DescribeMacro{#1}
\begin{minipage}[t]{\textwidth} \begin{minipage}[t]{\textwidth}
\textit{\textbf{\textcolor{mLightGreen}{#2}}}\dotfill\,#3\par \textit{\textbf{\textcolor{JungleGreen}{#2}}}\dotfill\,#3\par
\begingroup \begingroup
\vspace{0.5em}#4\par \vspace{0.5em}#4\par
\endgroup \endgroup
@ -85,16 +96,18 @@
\def\molochversion{0.5.0} % x-release-please-version \def\molochversion{0.5.0} % x-release-please-version
\usepackage{readprov} \usepackage{readprov}
% \ReadPackageInfos{beamerthememoloch}
\title{The \themename package (v\molochversion)} \title{The \themename Package (v\molochversion)}
\author{Johan Larsson \and Matthias Vogelgesang\footnote{Matthias wrote the original version of this manual for the Metropolis theme, which has since been modified by Johan Larsson.}} \author{Johan Larsson \and Matthias Vogelgesang\footnote{Matthias wrote the original version of this manual for the Metropolis theme, which has since been modified by Johan Larsson.}}
\date{\today} \date{\today}
\begin{document} \begin{document}
\maketitle \maketitle
\hypersetup{linkcolor=black}
\tableofcontents \tableofcontents
\hypersetup{linkcolor=MidnightBlue}
\section{Introduction} \section{Introduction}
@ -200,7 +213,7 @@ $ pandoc -t beamer -V theme:moloch -o output.pdf input.md
\section{Customization} \section{Customization}
\subsection{Package options} \subsection{Package Options}
The theme provides a number of options, which can be set using a key=value The theme provides a number of options, which can be set using a key=value
interface. The primary way to set options is to provide a comma-separated list interface. The primary way to set options is to provide a comma-separated list
@ -221,7 +234,7 @@ The list of options is structured as shown in the following example.
A short description of the option. A short description of the option.
} }
\subsubsection{Main theme} \subsubsection{Main Theme}
\DescribeOption{titleformat}% \DescribeOption{titleformat}%
{regular, smallcaps, allsmallcaps, allcaps} {regular, smallcaps, allsmallcaps, allcaps}
@ -240,7 +253,7 @@ The list of options is structured as shown in the following example.
Changes the format of ``standout'' frames (see |titleformat|, above). Changes the format of ``standout'' frames (see |titleformat|, above).
} }
\subsubsection{Inner theme} \subsubsection{Inner Theme}
\DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{ \DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{
Adds a slide at the start of each section (|simple|) with an optional thin Adds a slide at the start of each section (|simple|) with an optional thin
@ -257,7 +270,7 @@ The list of options is structured as shown in the following example.
on the section structure of your presentation. on the section structure of your presentation.
} }
\subsubsection{Outer theme} \subsubsection{Outer Theme}
\DescribeOption{numbering}{none, counter, fraction}{}{ \DescribeOption{numbering}{none, counter, fraction}{}{
\emph{This option is deprecated and will be removed in a future version. \emph{This option is deprecated and will be removed in a future version.
@ -273,7 +286,7 @@ The list of options is structured as shown in the following example.
(|frametitle|). (|frametitle|).
} }
\subsubsection{Color theme} \subsubsection{Color Theme}
\DescribeOption{block}{transparent, fill}{transparent}{ \DescribeOption{block}{transparent, fill}{transparent}{
Optionally adds a light grey background to block environments like |theorem| Optionally adds a light grey background to block environments like |theorem|
@ -285,7 +298,7 @@ The list of options is structured as shown in the following example.
of the reverse. of the reverse.
} }
\subsubsection{Font theme} \subsubsection{Font Theme}
\DescribeMacro{titleformat title} \DescribeMacro{titleformat title}
\DescribeMacro{titleformat subtitle} \DescribeMacro{titleformat subtitle}
@ -333,7 +346,7 @@ For low-light situations \themename it might be helpful to use the
\subsection{Commands} \subsection{Commands}
\subsubsection{Standout frames} \subsubsection{Standout Frames}
The \themename inner theme offers a custom frame format with large, centered The \themename inner theme offers a custom frame format with large, centered
text and an inverted background---perfect for focusing attention on text and an inverted background---perfect for focusing attention on
@ -359,7 +372,7 @@ Note that title format options |allsmallcaps| and |allcaps| do not
affect the sizes of numerals, punctuation, and math symbol, and are affect the sizes of numerals, punctuation, and math symbol, and are
probably best avoided if your titles contain these characters. probably best avoided if your titles contain these characters.
\subsection{Interactions with other color themes} \subsection{Interactions with Other Color Themes}
\themename can be used along with any other Beamer color theme, such as \themename can be used along with any other Beamer color theme, such as
|crane| or |seahorse|. If you wish to do this, it is usually best to include |crane| or |seahorse|. If you wish to do this, it is usually best to include
@ -393,7 +406,7 @@ favourite Beamer color theme. In particular, \themename does not set a
background color for the title; this will cause issues when using color themes background color for the title; this will cause issues when using color themes
like |whale| which set a white foreground for the title. like |whale| which set a white foreground for the title.
\subsection{Notes on second screen} \subsection{Notes on Second Screen}
If you use the \verb+[show notes on second screen]+ option built in to Beamer and If you use the \verb+[show notes on second screen]+ option built in to Beamer and
compile with \XeLaTeX, text on slides following the first section slide may compile with \XeLaTeX, text on slides following the first section slide may
@ -413,7 +426,7 @@ on each slide.
\makeatother \makeatother
\end{lstlisting} \end{lstlisting}
\subsection{Standout frames with labels} \subsection{Standout Frames with Labels}
Because the |standout| frame option creates a group to restrict the colour Because the |standout| frame option creates a group to restrict the colour
change to a single slide, labels defined after calling |standout| will stay change to a single slide, labels defined after calling |standout| will stay
@ -445,7 +458,7 @@ solution for Org mode users, using |org-set-property|.
:END: :END:
\end{lstlisting} \end{lstlisting}
\subsection{Standout frames with Pandoc} \subsection{Standout Frames with Pandoc}
With Pandoc versions prior to 1.17.2 it was not possible to create standout frames With Pandoc versions prior to 1.17.2 it was not possible to create standout frames
because Pandoc only supported a specific list of frame attributes thus ignoring because Pandoc only supported a specific list of frame attributes thus ignoring

View File

@ -23,11 +23,11 @@
%<*package> %<*package>
% ------------------------------------------------------------------------- \fi % ------------------------------------------------------------------------- \fi
% %
% \subsection{\themename color theme} % \subsection{\themename Color Theme}
% %
% %
% %
% \subsubsection{Package dependencies} % \subsubsection{Package Dependencies}
% \begin{macrocode} % \begin{macrocode}
\RequirePackage{pgfopts} \RequirePackage{pgfopts}
% \end{macrocode} % \end{macrocode}
@ -75,7 +75,7 @@
% %
% %
% %
% \subsubsection{Base colors} % \subsubsection{Base Colors}
% %
% \begin{macrocode} % \begin{macrocode}
\definecolor{mDarkBrown}{HTML}{604c38} \definecolor{mDarkBrown}{HTML}{604c38}
@ -86,7 +86,7 @@
% %
% %
% %
% \subsubsection{Base styles} % \subsubsection{Base Styles}
% %
% All colors in \themename are derived from the definitions of |normal text|, % All colors in \themename are derived from the definitions of |normal text|,
% |alerted text|, and |example text|. % |alerted text|, and |example text|.
@ -115,7 +115,7 @@
% %
% %
% %
% \subsubsection{Derived colors} % \subsubsection{Derived Colors}
% %
% The titles and structural elements (e.g. |itemize| bullets) are set in the % The titles and structural elements (e.g. |itemize| bullets) are set in the
% same color as |normal text|. This would ideally done by setting |normal text| % same color as |normal text|. This would ideally done by setting |normal text|
@ -127,7 +127,8 @@
\setbeamercolor{titlelike}{use=normal text, parent=normal text} \setbeamercolor{titlelike}{use=normal text, parent=normal text}
\setbeamercolor{author}{use=normal text, parent=normal text} \setbeamercolor{author}{use=normal text, parent=normal text}
\setbeamercolor{date}{use=normal text, parent=normal text} \setbeamercolor{date}{use=normal text, parent=normal text}
\setbeamercolor{institute}{use=normal text, fg=normal text.fg!80!normal text.bg} \setbeamercolor{institute}{%
use=normal text, fg=normal text.fg!80!normal text.bg}
\setbeamercolor{structure}{use=normal text, fg=normal text.fg} \setbeamercolor{structure}{use=normal text, fg=normal text.fg}
% \end{macrocode} % \end{macrocode}
% %
@ -237,7 +238,7 @@
% %
% %
% %
% \subsubsection{Process package options} % \subsubsection{Process Package Options}
% %
% \begin{macrocode} % \begin{macrocode}
\moloch@color@setdefaults \moloch@color@setdefaults

View File

@ -76,8 +76,8 @@
\let\moloch@titleformat\lowercase% \let\moloch@titleformat\lowercase%
\setbeamerfont{title}{shape=\scshape}% \setbeamerfont{title}{shape=\scshape}%
\PackageNote{beamerthememoloch}{% \PackageNote{beamerthememoloch}{%
Be aware that titleformat title=allsmallcaps can lead to problems% Be aware that titleformat title=allsmallcaps can
} lead to problems}
}, },
allcaps/.code={% allcaps/.code={%
\let\moloch@titleformat\uppercase% \let\moloch@titleformat\uppercase%
@ -108,15 +108,15 @@
\let\moloch@subtitleformat\MakeLowercase% \let\moloch@subtitleformat\MakeLowercase%
\setbeamerfont{subtitle}{shape=\scshape}% \setbeamerfont{subtitle}{shape=\scshape}%
\PackageNote{beamerthememoloch}{% \PackageNote{beamerthememoloch}{%
Be aware that titleformat subtitle=allsmallcaps can lead to problems% Be aware that titleformat subtitle=allsmallcaps
} can lead to problems}
}, },
allcaps/.code={% allcaps/.code={%
\let\moloch@subtitleformat\MakeUppercase% \let\moloch@subtitleformat\MakeUppercase%
\setbeamerfont{subtitle}{shape=\normalfont}% \setbeamerfont{subtitle}{shape=\normalfont}%
\PackageNote{beamerthememoloch}{% \PackageNote{beamerthememoloch}{%
Be aware that titleformat subtitle=allcaps can lead to problems% Be aware that titleformat subtitle=allcaps can
} lead to problems}
}, },
} }
% \end{macrocode} % \end{macrocode}
@ -140,15 +140,15 @@
\let\moloch@sectiontitleformat\MakeLowercase% \let\moloch@sectiontitleformat\MakeLowercase%
\setbeamerfont{section title}{shape=\scshape}% \setbeamerfont{section title}{shape=\scshape}%
\PackageNote{beamerthememoloch}{% \PackageNote{beamerthememoloch}{%
Be aware that titleformat section=allsmallcaps can lead to problems% Be aware that titleformat section=allsmallcaps
} can lead to problems}
}, },
allcaps/.code={% allcaps/.code={%
\let\moloch@sectiontitleformat\MakeUppercase% \let\moloch@sectiontitleformat\MakeUppercase%
\setbeamerfont{section title}{shape=\normalfont}% \setbeamerfont{section title}{shape=\normalfont}%
\PackageNote{beamerthememoloch}{% \PackageNote{beamerthememoloch}{%
Be aware that titleformat section=allcaps can lead to problems% Be aware that titleformat section=allcaps
} can lead to problems}
}, },
} }
% \end{macrocode} % \end{macrocode}
@ -172,8 +172,8 @@
\let\moloch@frametitleformat\MakeLowercase% \let\moloch@frametitleformat\MakeLowercase%
\setbeamerfont{frametitle}{shape=\scshape}% \setbeamerfont{frametitle}{shape=\scshape}%
\PackageNote{beamerthememoloch}{% \PackageNote{beamerthememoloch}{%
Be aware that titleformat frame=allsmallcaps can lead to problems% Be aware that titleformat frame=allsmallcaps
} can lead to problems}
}, },
allcaps/.code={% allcaps/.code={%
\let\moloch@frametitleformat\MakeUppercase% \let\moloch@frametitleformat\MakeUppercase%

View File

@ -23,7 +23,7 @@
%<*package> %<*package>
% ------------------------------------------------------------------------- \fi % ------------------------------------------------------------------------- \fi
% %
% \subsection{\themename inner theme} % \subsection{\themename Inner Theme}
% %
% A |beamer| inner theme dictates the style of the frame elements traditionally % A |beamer| inner theme dictates the style of the frame elements traditionally
% set in the ``body'' of each slide. These include: % set in the ``body'' of each slide. These include:
@ -38,7 +38,7 @@
% %
% %
% %
% \subsubsection{Package dependencies} % \subsubsection{Package Dependencies}
% %
% \begin{macrocode} % \begin{macrocode}
\RequirePackage{keyval} \RequirePackage{keyval}
@ -132,7 +132,7 @@
% %
% %
% %
% \subsubsection{Title page} % \subsubsection{Title Page}
% %
% \begin{macro}{title page} % \begin{macro}{title page}
% Template for the title page. Each element is only typset if it is defined % Template for the title page. Each element is only typset if it is defined
@ -143,7 +143,9 @@
\begin{minipage}[b][\paperheight]{\textwidth} \begin{minipage}[b][\paperheight]{\textwidth}
\null% \null%
\vfil% \vfil%
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi \ifx\inserttitlegraphic\@empty%
\else\usebeamertemplate*{title graphic}%
\fi
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
\usebeamertemplate*{title separator} \usebeamertemplate*{title separator}
@ -276,9 +278,9 @@
% \end{macro} % \end{macro}
% %
% %
% \subsubsection{Section page} % \subsubsection{Section Page}
% %
% \begin{macro}{section page} % \begin{macro}{section Page}
% %
% Template for the section title slide at the beginning of each section. % Template for the section title slide at the beginning of each section.
% %
@ -382,13 +384,14 @@
\fill[fg] \fill[fg]
(0,0) (0,0)
rectangle rectangle
(\moloch@progressonsectionpage, \moloch@progressonsectionpage@linewidth); (\moloch@progressonsectionpage,
\moloch@progressonsectionpage@linewidth);
\end{tikzpicture}% \end{tikzpicture}%
\tikzexternalenable% \tikzexternalenable%
} }
% \end{macrocode} % \end{macrocode}
% %
% The above code assumes that |\insertframenumber| is less than or equal to % The code above assumes that |\insertframenumber| is less than or equal to
% |\inserttotalframenumber|. However, this is not true on the first compile; % |\inserttotalframenumber|. However, this is not true on the first compile;
% in the absence of an |.aux| file, |\inserttotalframenumber| defaults to 1. % in the absence of an |.aux| file, |\inserttotalframenumber| defaults to 1.
% This behaviour could cause fatal errors for long presentations, as % This behaviour could cause fatal errors for long presentations, as
@ -403,7 +406,7 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %
% \subsubsection{Lists and floats} % \subsubsection{Lists and Floats}
% %
% \begin{macrocode} % \begin{macrocode}
\setbeamertemplate{itemize item}{\(\bullet\)} \setbeamertemplate{itemize item}{\(\bullet\)}
@ -426,7 +429,7 @@
% %
% %
% %
% \subsubsection{Text and spacing settings} % \subsubsection{Text and Spacing Settings}
% %
% %
% By default, Beamer frames offer the |c| option to \textit{almost} vertically % By default, Beamer frames offer the |c| option to \textit{almost} vertically
@ -448,7 +451,7 @@
% %
% %
% %
% \subsubsection{Standout frames} % \subsubsection{Standout Frames}
% %
% \themename offers a custom frame format with large, centered text and an % \themename offers a custom frame format with large, centered text and an
% inverted background. To use it, add the key |standout| to the frame: % inverted background. To use it, add the key |standout| to the frame:
@ -468,7 +471,8 @@
\booltrue{moloch@standout} \booltrue{moloch@standout}
\begingroup \begingroup
\setkeys{beamerframe}{c} \setkeys{beamerframe}{c}
\ifbool{moloch@enableStandoutNumbering}{}{\setkeys{beamerframe}{noframenumbering}} \ifbool{moloch@enableStandoutNumbering}{}{%
\setkeys{beamerframe}{noframenumbering}}
\ifbeamercolorempty[bg]{palette primary}{ \ifbeamercolorempty[bg]{palette primary}{
\setbeamercolor{background canvas}{ \setbeamercolor{background canvas}{
use=palette primary, use=palette primary,
@ -522,7 +526,7 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %
% \subsubsection{Process package options} % \subsubsection{Process Package Options}
% %
% \begin{macrocode} % \begin{macrocode}
\moloch@inner@setdefaults \moloch@inner@setdefaults

View File

@ -171,7 +171,9 @@
} }
\newcommand{\moloch@frametitlestrut@end}{% \newcommand{\moloch@frametitlestrut@end}{%
\vphantom{\rule[-\moloch@frametitle@padding]{0pt}{\moloch@frametitle@padding}} \vphantom{%
\rule[-\moloch@frametitle@padding]{0pt}{\moloch@frametitle@padding}%
}
} }
\defbeamertemplate{frametitle}{plain}{% \defbeamertemplate{frametitle}{plain}{%
\nointerlineskip% \nointerlineskip%
@ -198,7 +200,8 @@
\moloch@frametitlestrut@end% \moloch@frametitlestrut@end%
\end{beamercolorbox}% \end{beamercolorbox}%
} }
\setbeamertemplate{frametitle continuation}{\romannumeral\insertcontinuationcount} \setbeamertemplate{frametitle continuation}{%
\romannumeral\insertcontinuationcount}
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %

View File

@ -21,7 +21,7 @@
%<*package> %<*package>
% ------------------------------------------------------------------------- \fi % ------------------------------------------------------------------------- \fi
% %
% \subsection{\themename parent theme} % \subsection{\themename Parent Theme}
% %
% The primary job of this package is to load the component sub-packages of the % The primary job of this package is to load the component sub-packages of the
% \themename theme and route the theme options accordingly. It also % \themename theme and route the theme options accordingly. It also
@ -29,7 +29,7 @@
% %
% %
% %
% \subsubsection{Package dependencies} % \subsubsection{Package Dependencies}
% %
% \begin{macrocode} % \begin{macrocode}
\RequirePackage{pgfopts} \RequirePackage{pgfopts}
@ -117,7 +117,7 @@
\providecommand{\mmzUnmemoizable}{} \providecommand{\mmzUnmemoizable}{}
% \end{macrocode} % \end{macrocode}
% %
% \subsubsection{Component sub-packages} % \subsubsection{Component Sub-Packages}
% %
% Having processed the options, we can now load the component sub-packages of % Having processed the options, we can now load the component sub-packages of
% the theme. % the theme.
@ -129,7 +129,7 @@
\usefonttheme{moloch} \usefonttheme{moloch}
% \end{macrocode} % \end{macrocode}
% %
% \subsubsection{Custom commands} % \subsubsection{Custom Commands}
% %
% The parent theme defines custom commands as their proper usage may depend % The parent theme defines custom commands as their proper usage may depend
% on multiple sub-packages. % on multiple sub-packages.
@ -150,7 +150,7 @@
% %
% %
% %
% \subsubsection{Process package options} % \subsubsection{Process Package Options}
% %
% \begin{macrocode} % \begin{macrocode}
\moloch@setdefaults \moloch@setdefaults