feat!: simplify blocks and remove blocks with background

This commit is contained in:
Johan Larsson 2024-01-11 11:12:07 +01:00
parent fbfcc0b7ad
commit d5317d4d05
7 changed files with 170 additions and 351 deletions

View File

@ -34,7 +34,7 @@
The \themename theme is a Beamer theme with minimal visual noise The \themename theme is a Beamer theme with minimal visual noise
inspired by the \href{https://github.com/hsrmbeamertheme/hsrmbeamertheme}{\textsc{hsrm} Beamer 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 Enable the theme by loading
@ -55,55 +55,55 @@
\section{Title formats} \section{Title formats}
\begin{frame}{Moloch title formats} \begin{frame}{Moloch title formats}
\themename supports 4 different title formats: \themename supports 4 different title formats:
\begin{itemize} \begin{itemize}
\item Regular \item Regular
\item \textsc{Small caps} \item \textsc{Small caps}
\item \textsc{all small caps} \item \textsc{all small caps}
\item ALL CAPS \item ALL CAPS
\end{itemize} \end{itemize}
They can either be set at once for every title type or individually. They can either be set at once for every title type or individually.
\end{frame} \end{frame}
{ {
\molochset{titleformat frame=smallcaps} \molochset{titleformat frame=smallcaps}
\begin{frame}{Small caps} \begin{frame}{Small caps}
This frame uses the \texttt{smallcaps} title format. This frame uses the \texttt{smallcaps} title format.
\begin{alertblock}{Potential Problems} \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. 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{alertblock}
\end{frame} \end{frame}
} }
{ {
\molochset{titleformat frame=allsmallcaps} \molochset{titleformat frame=allsmallcaps}
\begin{frame}{All small caps} \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} \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 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. As a rule of thumb: just use it for plaintext-only titles.
\end{alertblock} \end{alertblock}
\end{frame} \end{frame}
} }
{ {
\molochset{titleformat frame=allcaps} \molochset{titleformat frame=allcaps}
\begin{frame}{All caps} \begin{frame}{All caps}
This frame uses the \texttt{allcaps} title format. This frame uses the \texttt{allcaps} title format.
\begin{alertblock}{Potential Problems} \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. 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{alertblock}
\end{frame} \end{frame}
} }
\section{Elements} \section{Elements}
\begin{frame}[fragile]{Typography} \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 \emph{emphasize} text, \alert{accent} parts
or show \textbf{bold} results.\end{verbatim} or show \textbf{bold} results.\end{verbatim}
@ -131,22 +131,22 @@ or show \textbf{bold} results.\end{verbatim}
\begin{frame}{Lists} \begin{frame}{Lists}
\begin{columns}[T,onlytextwidth] \begin{columns}[T,onlytextwidth]
\column{0.33\textwidth} \column{0.33\textwidth}
Items Items
\begin{itemize} \begin{itemize}
\item Milk \item Eggs \item Potatoes \item Milk \item Eggs \item Potatoes
\end{itemize} \end{itemize}
\column{0.33\textwidth} \column{0.33\textwidth}
Enumerations Enumerations
\begin{enumerate} \begin{enumerate}
\item First, \item Second and \item Last. \item First, \item Second and \item Last.
\end{enumerate} \end{enumerate}
\column{0.33\textwidth} \column{0.33\textwidth}
Descriptions Descriptions
\begin{description} \begin{description}
\item[PowerPoint] Meeh. \item[Beamer] Yeeeha. \item[PowerPoint] Meeh. \item[Beamer] Yeeeha.
\end{description} \end{description}
\end{columns} \end{columns}
\end{frame} \end{frame}
\begin{frame}{Animation} \begin{frame}{Animation}
@ -163,23 +163,23 @@ or show \textbf{bold} results.\end{verbatim}
\begin{tikzpicture} \begin{tikzpicture}
\def\couleur{alerted text.fg} \def\couleur{alerted text.fg}
\path[coordinate] (0,0) coordinate(A) \path[coordinate] (0,0) coordinate(A)
++( 90:5cm) coordinate(B) ++( 90:5cm) coordinate(B)
++(0:5cm) coordinate(C) ++(0:5cm) coordinate(C)
++(-90:5cm) coordinate(D); ++(-90:5cm) coordinate(D);
\draw[fill=\couleur!\thedensity] (A) -- (B) -- (C) --(D) -- cycle; \draw[fill=\couleur!\thedensity] (A) -- (B) -- (C) --(D) -- cycle;
\foreach \x in {1,...,40}{% \foreach \x in {1,...,40}{%
\pgfmathsetcounter{density}{\thedensity+20} \pgfmathsetcounter{density}{\thedensity+20}
\setcounter{density}{\thedensity} \setcounter{density}{\thedensity}
\path[coordinate] coordinate(X) at (A){}; \path[coordinate] coordinate(X) at (A){};
\path[coordinate] (A) -- (B) coordinate[pos=.10](A) \path[coordinate] (A) -- (B) coordinate[pos=.10](A)
-- (C) coordinate[pos=.10](B) -- (C) coordinate[pos=.10](B)
-- (D) coordinate[pos=.10](C) -- (D) coordinate[pos=.10](C)
-- (X) coordinate[pos=.10](D); -- (X) coordinate[pos=.10](D);
\draw[fill=\couleur!\thedensity] (A)--(B)--(C)-- (D) -- cycle; \draw[fill=\couleur!\thedensity] (A)--(B)--(C)-- (D) -- cycle;
} }
\end{tikzpicture} \end{tikzpicture}
\caption{Rotated square from \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{figure}
\end{frame} \end{frame}
\begin{frame}{Tables} \begin{frame}{Tables}
@ -187,51 +187,31 @@ or show \textbf{bold} results.\end{verbatim}
\caption{Largest cities in the world (source: Wikipedia)} \caption{Largest cities in the world (source: Wikipedia)}
\begin{tabular}{@{} lr @{}} \begin{tabular}{@{} lr @{}}
\toprule \toprule
City & Population\\ City & Population \\
\midrule \midrule
Mexico City & 20,116,842\\ Mexico City & 20,116,842 \\
Shanghai & 19,210,000\\ Shanghai & 19,210,000 \\
Peking & 15,796,450\\ Peking & 15,796,450 \\
Istanbul & 14,160,467\\ Istanbul & 14,160,467 \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\end{table} \end{table}
\end{frame} \end{frame}
\begin{frame}{Blocks} \begin{frame}{Blocks}
Three different block environments are pre-defined and may be styled with an Three different block environments are pre-defined.
optional background color.
\begin{columns}[T,onlytextwidth] \begin{block}{Default}
\column{0.5\textwidth} Block content.
\begin{block}{Default} \end{block}
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}
\column{0.5\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{columns}
\end{frame} \end{frame}
\begin{frame}{Math} \begin{frame}{Math}
\begin{equation*} \begin{equation*}
@ -242,10 +222,10 @@ or show \textbf{bold} results.\end{verbatim}
\begin{figure} \begin{figure}
\begin{tikzpicture} \begin{tikzpicture}
\begin{axis}[ \begin{axis}[
mlineplot, mlineplot,
width=0.9\textwidth, width=0.9\textwidth,
height=6cm, height=6cm,
] ]
\addplot {sin(deg(x))}; \addplot {sin(deg(x))};
\addplot+[samples=100] {sin(deg(2*x))}; \addplot+[samples=100] {sin(deg(2*x))};
@ -258,18 +238,18 @@ or show \textbf{bold} results.\end{verbatim}
\begin{figure} \begin{figure}
\begin{tikzpicture} \begin{tikzpicture}
\begin{axis}[ \begin{axis}[
mbarplot, mbarplot,
xlabel={Foo}, xlabel={Foo},
ylabel={Bar}, ylabel={Bar},
width=0.9\textwidth, width=0.9\textwidth,
height=6cm, height=6cm,
] ]
\addplot plot coordinates {(1, 20) (2, 25) (3, 22.4) (4, 12.4)}; \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, 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, 10) (2, 19) (3, 25) (4, 15.2)};
\legend{lorem, ipsum, dolor} \legend{lorem, ipsum, dolor}
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
@ -284,8 +264,8 @@ or show \textbf{bold} results.\end{verbatim}
{% {%
\setbeamertemplate{frame footer}{My custom footer} \setbeamertemplate{frame footer}{My custom footer}
\begin{frame}[fragile]{Frame footer} \begin{frame}[fragile]{Frame footer}
\themename defines a custom beamer template to add a text to the footer. It can be set via \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} \begin{verbatim}\setbeamertemplate{frame footer}{My custom footer}\end{verbatim}
\end{frame} \end{frame}
} }
@ -303,7 +283,7 @@ or show \textbf{bold} results.\end{verbatim}
The theme \emph{itself} is licensed under a The theme \emph{itself} is licensed under a
\href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons \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} \begin{center}\ccbysa\end{center}

View File

@ -385,10 +385,6 @@ 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

View File

@ -34,18 +34,6 @@
% %
% \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
@ -66,7 +54,6 @@
\newcommand{\moloch@color@setdefaults}{ \newcommand{\moloch@color@setdefaults}{
\pgfkeys{/moloch/color/.cd, \pgfkeys{/moloch/color/.cd,
background=light, background=light,
block=transparent,
} }
} }
% \end{macrocode} % \end{macrocode}
@ -172,34 +159,9 @@
} }
% \end{macrocode} % \end{macrocode}
% %
% Block environments such as |theorem| and |example| have no background color % Block environments use alerted tex and example text for the title
% 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}{%
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}{% \setbeamercolor{block title alerted}{%
use={block title, alerted text}, use={block title, alerted text},
fg=alerted text.fg fg=alerted text.fg
@ -208,8 +170,6 @@
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

View File

@ -362,120 +362,6 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %
%
%
% \subsubsection{Block environments}
%
%
% \begin{macro}{block}
% \begin{macro}{block alerted}
% \begin{macro}{block example}
%
% The three different block environments differ only in their colours.
% Rather than repeat the essentially the same template three times, we use
% the auxiliary macro |\moloch@block| to define all three templates.
%
% \begin{macrocode}
% \newlength{\moloch@blocksep}
% \newlength{\moloch@blockadjust}
% \setlength{\moloch@blocksep}{0.75ex}
% \setlength{\moloch@blockadjust}{0.25ex}
% \providecommand{\moloch@strut}{%
% \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
% }
% \newcommand{\moloch@block}[1]{
% \par\vskip\medskipamount%
% \setlength{\parskip}{0pt}
% \end{macrocode}
%
% If a background color is defined for the block title or body, we need to
% add a little bit of padding to the corresponding box. Ideally, this would
% be accomplished by setting |colsep=0.75ex|, which is intended to add
% ``color separation space'' only when the box has a colored background.
% Unfortunately, |colsep| also adds this separation if the background color
% is inherited, even if the inherited color is actually empty.
% (The technical reason for this boils down to the fact that the |\ifx|
% directive does not expand macros.)
%
% To achieve the correct spacing for |alertblock|s and |exampleblock|s
% as well as for normal blocks, we have to begin the |beamercolorbox|
% differently based on whether |block title| has an empty background.
%
% If the |block title| background is empty, or the user has explicitly
% removed the background from (e.g.) |block title alerted|, we just need to
% set a rightskip for a nice ragged-right block title.
%
% \begin{macrocode}
% \ifbeamercolorempty[bg]{block title#1}{%
% \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
% \ifbeamercolorempty[bg]{block title}{%
% \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
% }%
% \end{macrocode}
%
% Otherwise, if the |block title| has a background, we set the padding based
% on |\moloch@blockskip|. However, we have to visually compensate for
% the |\moloch@strut| added to the block title (see below) by
% subtracting |\moloch@blockadjust| from the top and bottom padding.
%
% \begin{macrocode}
{%
% \begin{beamercolorbox}[
% sep=\dimexpr\moloch@blocksep-\moloch@blockadjust\relax,
% leftskip=\moloch@blockadjust,
% rightskip=\dimexpr\moloch@blockadjust plus 4em\relax
% ]{block title#1}%
% }}%
% \end{macrocode}
%
% We can now set the contents of the |block title|. The zero-width but
% positive-height box |\moloch@strut| ensures that the block title box
% has a consistent height, even if it lacks punctuation, ascenders, or
% descenders.
%
% \begin{macrocode}
% \usebeamerfont*{block title#1}%
% \moloch@strut%
% \insertblocktitle%
% \moloch@strut%
% \end{beamercolorbox}%
% \end{macrocode}
%
% Next, we typeset the |block body|. This the code is similar to, but simpler
% than, the |block title| code since we don't need to adjust for any struts.
%
% \begin{macrocode}
% \nointerlineskip%
% \ifbeamercolorempty[bg]{block body#1}{%
% \begin{beamercolorbox}[vmode]{block body#1}}{
% \ifbeamercolorempty[bg]{block body}{%
% \begin{beamercolorbox}[vmode]{block body#1}%
% }{%
% \begin{beamercolorbox}[sep=\moloch@blocksep, vmode]{block body#1}%
% \vspace{-\moloch@parskip}
% }}%
% \usebeamerfont{block body#1}%
% \setlength{\parskip}{\moloch@parskip}%
% }
% % \end{macrocode}
% %
% % This concludes the auxiliary macro |\moloch@block|. Finally,
% % we define the block beamer templates using this macro.
% %
% % \begin{macrocode}
% \setbeamertemplate{block begin}{\moloch@block{}}
% \setbeamertemplate{block alerted begin}{\moloch@block{ alerted}}
% \setbeamertemplate{block example begin}{\moloch@block{ example}}
% \setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
% \setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
% \setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
% \subsubsection{Lists and floats} % \subsubsection{Lists and floats}
% %
% \begin{macrocode} % \begin{macrocode}

View File

@ -211,7 +211,7 @@
% called. This makes it easier to include additional ``backup slides'' at % called. This makes it easier to include additional ``backup slides'' at
% the end of the presentation, especially in conjunction with the package % the end of the presentation, especially in conjunction with the package
% |appendixnumberbeamer|. % |appendixnumberbeamer|.
% \begin{macrocode} % \begin{macrocode}
\AtBeginDocument{% \AtBeginDocument{%
\apptocmd{\appendix}{% \apptocmd{\appendix}{%
\pgfkeys{% \pgfkeys{%

View File

@ -12,8 +12,7 @@
% \iffalse % \iffalse
%<*package> %<*package>
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerthememoloch} \ProvidesPackage{beamerthememoloch}[2017/01/23 v1.2 Moloch Beamer theme]
[2017/01/23 v1.2 Moloch Beamer theme]
%</package> %</package>
% \fi % \fi
% \CheckSum{0} % \CheckSum{0}
@ -46,11 +45,11 @@
% \begin{macrocode} % \begin{macrocode}
\pgfkeys{/moloch/.cd, \pgfkeys{/moloch/.cd,
.search also={ .search also={
/moloch/inner, /moloch/inner,
/moloch/outer, /moloch/outer,
/moloch/color, /moloch/color,
/moloch/font, /moloch/font,
} }
} }
% \end{macrocode} % \end{macrocode}
% %
@ -59,23 +58,23 @@
% \begin{macrocode} % \begin{macrocode}
\pgfkeys{ \pgfkeys{
/moloch/titleformat plain/.cd, /moloch/titleformat plain/.cd,
.is choice, .is choice,
regular/.code={% regular/.code={%
\let\moloch@plaintitleformat\@empty% \let\moloch@plaintitleformat\@empty%
\setbeamerfont{standout}{shape=\normalfont}% \setbeamerfont{standout}{shape=\normalfont}%
}, },
smallcaps/.code={% smallcaps/.code={%
\let\moloch@plaintitleformat\@empty% \let\moloch@plaintitleformat\@empty%
\setbeamerfont{standout}{shape=\scshape}% \setbeamerfont{standout}{shape=\scshape}%
}, },
allsmallcaps/.code={% allsmallcaps/.code={%
\let\moloch@plaintitleformat\MakeLowercase% \let\moloch@plaintitleformat\MakeLowercase%
\setbeamerfont{standout}{shape=\scshape}% \setbeamerfont{standout}{shape=\scshape}%
\PackageWarning{beamerthememoloch}{% \PackageWarning{beamerthememoloch}{%
Be aware that titleformat plain=allsmallcaps can lead to problems% Be aware that titleformat plain=allsmallcaps can lead to problems%
} }
}, },
allcaps/.code={% allcaps/.code={%
\let\moloch@plaintitleformat\MakeUppercase% \let\moloch@plaintitleformat\MakeUppercase%
\setbeamerfont{standout}{shape=\normalfont}% \setbeamerfont{standout}{shape=\normalfont}%
\PackageWarning{beamerthememoloch}{% \PackageWarning{beamerthememoloch}{%
@ -92,12 +91,12 @@
% \begin{macrocode} % \begin{macrocode}
\pgfkeys{ \pgfkeys{
/moloch/titleformat/.code=\pgfkeysalso{ /moloch/titleformat/.code=\pgfkeysalso{
font/titleformat title=#1, font/titleformat title=#1,
font/titleformat subtitle=#1, font/titleformat subtitle=#1,
font/titleformat section=#1, font/titleformat section=#1,
font/titleformat frame=#1, font/titleformat frame=#1,
titleformat plain=#1, titleformat plain=#1,
} }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -112,7 +111,6 @@
usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction}, usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction},
nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none}, nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none},
darkcolors/.code=\pgfkeysalso{color/background=dark}, darkcolors/.code=\pgfkeysalso{color/background=dark},
blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill},
} }
% \end{macrocode} % \end{macrocode}
% %

View File

@ -15,8 +15,7 @@
%<driver> \ProvidesFile{pgfplotsthemetol.dtx} %<driver> \ProvidesFile{pgfplotsthemetol.dtx}
%<*package> %<*package>
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pgfplotsthemetol} \ProvidesPackage{pgfplotsthemetol}[2017/01/23 PGFplots colors based on Paul Tol's SRON technical note]
[2017/01/23 PGFplots colors based on Paul Tol's SRON technical note]
%</package> %</package>
%<driver> \documentclass{ltxdoc} %<driver> \documentclass{ltxdoc}
%<driver> \usepackage{pgfplotsthemetol} %<driver> \usepackage{pgfplotsthemetol}
@ -95,91 +94,91 @@
% \begin{macrocode} % \begin{macrocode}
\pgfplotsset{ \pgfplotsset{
compat=1.9, compat=1.9,
% \end{macrocode} % \end{macrocode}
% %
% \begin{macro}{mlineplot} % \begin{macro}{mlineplot}
% A style to apply to the axis of a PGF line plot. % A style to apply to the axis of a PGF line plot.
% \begin{macrocode} % \begin{macrocode}
mlineplot/.style={ mlineplot/.style={
mbaseplot, mbaseplot,
xmajorgrids=true, xmajorgrids=true,
ymajorgrids=true, ymajorgrids=true,
major grid style={dotted}, major grid style={dotted},
axis x line=bottom, axis x line=bottom,
axis y line=left, axis y line=left,
legend style={ legend style={
cells={anchor=west}, cells={anchor=west},
draw=none draw=none
},
cycle list name=mlineplot cycle,
}, },
cycle list name=mlineplot cycle, % \end{macrocode}
}, % \end{macro}
% \end{macrocode} % \begin{macro}{mbarplot}
% \end{macro} % \begin{macro}{horizontal mbarplot}
% \begin{macro}{mbarplot} % A style to apply to the axis of a PGF bar chart. |mbarplot| uses vertical
% \begin{macro}{horizontal mbarplot} % bars by default, while |horizontal mbarplot| has horizontal bars as the
% A style to apply to the axis of a PGF bar chart. |mbarplot| uses vertical % name implies. Their shared properties are factored out into the internal
% bars by default, while |horizontal mbarplot| has horizontal bars as the % style |mbarplot base|.
% name implies. Their shared properties are factored out into the internal %
% style |mbarplot base|. % \begin{macrocode}
%
% \begin{macrocode}
mbarplot base/.style={ mbarplot base/.style={
mbaseplot, mbaseplot,
bar width=6pt, bar width=6pt,
axis y line*=none, axis y line*=none,
}, },
mbarplot/.style={ mbarplot/.style={
mbarplot base, mbarplot base,
ybar, ybar,
xmajorgrids=false, xmajorgrids=false,
ymajorgrids=true, ymajorgrids=true,
area legend, area legend,
legend image code/.code={% legend image code/.code={%
\draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm); \draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm);
},
cycle list name=mbarplot cycle,
}, },
cycle list name=mbarplot cycle,
},
horizontal mbarplot/.style={ horizontal mbarplot/.style={
mbarplot base, mbarplot base,
xmajorgrids=true, xmajorgrids=true,
ymajorgrids=false, ymajorgrids=false,
xbar stacked, xbar stacked,
area legend, area legend,
legend image code/.code={% legend image code/.code={%
\draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm); \draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm);
},
cycle list name=mbarplot cycle,
}, },
cycle list name=mbarplot cycle, % \end{macrocode}
}, % \end{macro}
% \end{macrocode} % \end{macro}
% \end{macro} % \begin{macro}{mbaseplot}
% \end{macro} % Adjusts the appearance of the axes in a PGF chart.
% \begin{macro}{mbaseplot} % \begin{macrocode}
% Adjusts the appearance of the axes in a PGF chart.
% \begin{macrocode}
mbaseplot/.style={ mbaseplot/.style={
legend style={ legend style={
draw=none, draw=none,
fill=none, fill=none,
cells={anchor=west}, cells={anchor=west},
},
x tick label style={
font=\footnotesize
},
y tick label style={
font=\footnotesize
},
legend style={
font=\footnotesize
},
major grid style={
dotted,
},
axis x line*=bottom,
}, },
x tick label style={
font=\footnotesize
},
y tick label style={
font=\footnotesize
},
legend style={
font=\footnotesize
},
major grid style={
dotted,
},
axis x line*=bottom,
},
disable thousands separator/.style={ disable thousands separator/.style={
/pgf/number format/.cd, /pgf/number format/.cd,
1000 sep={} 1000 sep={}
}, },
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}