mirror of https://github.com/matze/mtheme.git
Merge pull request #96 from benjamin-weiss/new-makeuppercase-implementation
New frame title format implementation
This commit is contained in:
commit
a00878e3a4
|
@ -50,14 +50,14 @@
|
||||||
% Font Assignment
|
% Font Assignment
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\setbeamerfont{title}{family=\Book, size=\Large}
|
\setbeamerfont{title}{family=\Book, size=\Large, shape=\scshape}
|
||||||
\setbeamerfont{author}{family=\ExtraLight, size=\small}
|
\setbeamerfont{author}{family=\ExtraLight, size=\small}
|
||||||
\setbeamerfont{date}{family=\ExtraLight, size=\small}
|
\setbeamerfont{date}{family=\ExtraLight, size=\small}
|
||||||
\setbeamerfont{section title}{family=\Book, size=\Large}
|
\setbeamerfont{section title}{family=\Book, size=\Large, shape=\scshape}
|
||||||
\setbeamerfont{block title}{family=\Book, size=\normalsize}
|
\setbeamerfont{block title}{family=\Book, size=\normalsize}
|
||||||
\setbeamerfont{block title alerted}{family=\Book,size=\normalsize}
|
\setbeamerfont{block title alerted}{family=\Book,size=\normalsize}
|
||||||
\setbeamerfont{subtitle}{family=\Light, size=\fontsize{12}{14}}
|
\setbeamerfont{subtitle}{family=\Light, size=\fontsize{12}{14}}
|
||||||
\setbeamerfont{frametitle}{family=\Book, size=\large}
|
\setbeamerfont{frametitle}{family=\Book, size=\large, shape=\scshape}
|
||||||
\setbeamerfont{caption}{size=\small}
|
\setbeamerfont{caption}{size=\small}
|
||||||
\setbeamerfont{caption name}{family=\Book}
|
\setbeamerfont{caption name}{family=\Book}
|
||||||
\setbeamerfont{description item}{family=\Book}
|
\setbeamerfont{description item}{family=\Book}
|
||||||
|
|
|
@ -40,16 +40,6 @@
|
||||||
% \item footnotes and plain text.
|
% \item footnotes and plain text.
|
||||||
% \end{itemize}
|
% \end{itemize}
|
||||||
%
|
%
|
||||||
%
|
|
||||||
%
|
|
||||||
% This customization will be changed in a future update.
|
|
||||||
%
|
|
||||||
% \begin{macrocode}
|
|
||||||
\def\mthemetitleformat{\scshape\MakeLowercase}
|
|
||||||
% \end{macrocode}
|
|
||||||
%
|
|
||||||
%
|
|
||||||
%
|
|
||||||
% \subsection{Title page}
|
% \subsection{Title page}
|
||||||
%
|
%
|
||||||
% \begin{macro}{title page}
|
% \begin{macro}{title page}
|
||||||
|
@ -200,7 +190,7 @@
|
||||||
\begin{minipage}{22em}
|
\begin{minipage}{22em}
|
||||||
\usebeamercolor[fg]{section title}
|
\usebeamercolor[fg]{section title}
|
||||||
\usebeamerfont{section title}
|
\usebeamerfont{section title}
|
||||||
\insertsectionHEAD\\[-1ex]
|
\insertsectionhead\\[-1ex]
|
||||||
\usebeamertemplate*{progress bar in section page}
|
\usebeamertemplate*{progress bar in section page}
|
||||||
\end{minipage}
|
\end{minipage}
|
||||||
\par
|
\par
|
||||||
|
@ -215,17 +205,6 @@
|
||||||
}
|
}
|
||||||
\fi
|
\fi
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
|
||||||
% To give users the option to \MakeUppercase or \MakeLowercase the section
|
|
||||||
% title, we need to expand |\insertsectionhead| before applying the relevant
|
|
||||||
% formatting command. This solution was suggested by Enrico Gregorio in an
|
|
||||||
% answer to \href{http://tex.stackexchange.com/questions/112526/}{this
|
|
||||||
% StackExchange question}.
|
|
||||||
%
|
|
||||||
% \begin{macrocode}
|
|
||||||
\providecommand{\insertsectionHEAD}{\expandafter\formatsectionhead\insertsectionhead}
|
|
||||||
\providecommand{\formatsectionhead}[3]{#1{#2}{\mthemetitleformat{#3}}}
|
|
||||||
% \end{macrocode}
|
|
||||||
% \end{macro}
|
% \end{macro}
|
||||||
%
|
%
|
||||||
% \begin{macro}{progress bar in section page}
|
% \begin{macro}{progress bar in section page}
|
||||||
|
|
|
@ -95,11 +95,7 @@
|
||||||
ht=2.5ex,
|
ht=2.5ex,
|
||||||
dp=1.5ex
|
dp=1.5ex
|
||||||
]{frametitle}
|
]{frametitle}
|
||||||
\if@protectFrameTitle%
|
\insertframetitle%
|
||||||
\mthemetitleformat{\protect\insertframetitle}%
|
|
||||||
\else%
|
|
||||||
\mthemetitleformat{\insertframetitle}%
|
|
||||||
\fi%
|
|
||||||
\end{beamercolorbox}%
|
\end{beamercolorbox}%
|
||||||
\if@useTitleProgressBar
|
\if@useTitleProgressBar
|
||||||
\nointerlineskip
|
\nointerlineskip
|
||||||
|
|
|
@ -74,16 +74,6 @@
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% protectframetitle
|
|
||||||
%
|
|
||||||
% \begin{macrocode}
|
|
||||||
\newif\if@protectFrameTitle
|
|
||||||
\@protectFrameTitlefalse
|
|
||||||
\DeclareOptionBeamer{protectframetitle}{
|
|
||||||
\@protectFrameTitletrue
|
|
||||||
}
|
|
||||||
% \end{macrocode}
|
|
||||||
%
|
|
||||||
% nooffset
|
% nooffset
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
|
@ -121,13 +111,6 @@
|
||||||
\ProcessOptionsBeamer
|
\ProcessOptionsBeamer
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% mthemetitleformat
|
|
||||||
%
|
|
||||||
% \begin{macro}{\mthemetitleformat}
|
|
||||||
% \begin{macrocode}
|
|
||||||
\def\mthemetitleformat#1{\scshape #1}
|
|
||||||
% \end{macrocode}
|
|
||||||
% \end{macro}
|
|
||||||
% \subsection{Component sub-packages}
|
% \subsection{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
|
||||||
|
@ -163,12 +146,57 @@
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
%
|
|
||||||
%
|
|
||||||
% \subsection{Custom commands}
|
% \subsection{Custom commands}
|
||||||
%
|
%
|
||||||
% We define custom commands in this package as their proper usage may depend
|
% We define custom commands in this package as their proper usage may depend
|
||||||
% depend on multiple sub-packages.
|
% on multiple sub-packages.
|
||||||
|
%
|
||||||
|
% \begin{macro}{\mthemetitleformat}
|
||||||
|
% \begin{macro}{\mthemesectiontitleformat}
|
||||||
|
% \begin{macro}{\mthemeframetitleformat}
|
||||||
|
% \begin{macro}{\mthemeplaintitleformat}
|
||||||
|
% Creates hooks to change the case format of the four different titles.
|
||||||
|
% \begin{macrocode}
|
||||||
|
\def\mthemetitleformat#1{\MakeLowercase{#1}}
|
||||||
|
\def\mthemesectiontitleformat#1{\mthemetitleformat{#1}}
|
||||||
|
\def\mthemeframetitleformat#1{\mthemetitleformat{#1}}
|
||||||
|
\def\mthemeplaintitleformat#1{\mthemetitleformat{#1}}
|
||||||
|
% \end{macrocode}
|
||||||
|
%
|
||||||
|
% To give users the option to |\MakeUppercase| or |\MakeLowercase| the
|
||||||
|
% section title and frame title we need to patch the commands
|
||||||
|
% |\sectionentry|, |\beamer@section| and |\beamer@@frametitle|. This
|
||||||
|
% solution was suggested by Enrico Gregorio in an answer to
|
||||||
|
% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange
|
||||||
|
% question}.
|
||||||
|
%
|
||||||
|
% \begin{macrocode}
|
||||||
|
\patchcmd{\sectionentry}
|
||||||
|
{\def\insertsectionhead{#2}}
|
||||||
|
{\def\insertsectionhead{\mthemesectiontitleformat{#2}}}
|
||||||
|
{}{}
|
||||||
|
\patchcmd{\beamer@section}
|
||||||
|
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
|
||||||
|
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\mthemesectiontitleformat{#1}}}}
|
||||||
|
{}{}
|
||||||
|
|
||||||
|
\patchcmd{\beamer@@frametitle}
|
||||||
|
{\beamer@ifempty{#2}{}{%
|
||||||
|
\gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle continuation}\fi}}%
|
||||||
|
\gdef\beamer@frametitle{#2}%
|
||||||
|
\gdef\beamer@shortframetitle{#1}%
|
||||||
|
}}
|
||||||
|
{\beamer@ifempty{#2}{}{%
|
||||||
|
\gdef\insertframetitle{{\mthemeframetitleformat{#2}\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle continuation}\fi}}%
|
||||||
|
\gdef\beamer@frametitle{#2}%
|
||||||
|
\gdef\beamer@shortframetitle{#1}%
|
||||||
|
}}
|
||||||
|
{}{}
|
||||||
|
% \end{macrocode}
|
||||||
|
% \end{macro}
|
||||||
|
% \end{macro}
|
||||||
|
% \end{macro}
|
||||||
|
% \end{macro}
|
||||||
%
|
%
|
||||||
% \begin{macro}{\plain}
|
% \begin{macro}{\plain}
|
||||||
% Creates a plain frame with dark background, suitable for displaying images
|
% Creates a plain frame with dark background, suitable for displaying images
|
||||||
|
@ -183,7 +211,7 @@
|
||||||
\vspace{1em}
|
\vspace{1em}
|
||||||
\usebeamercolor[fg]{palette primary}
|
\usebeamercolor[fg]{palette primary}
|
||||||
\usebeamerfont{section title}
|
\usebeamerfont{section title}
|
||||||
\mthemetitleformat{#2}
|
\mthemeplaintitleformat{#2}
|
||||||
\vfill
|
\vfill
|
||||||
\end{frame}
|
\end{frame}
|
||||||
\endgroup
|
\endgroup
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
@article{Knuth92,
|
||||||
|
author = "D.E. Knuth",
|
||||||
|
title = "Two notes on notation",
|
||||||
|
journal = "Amer. Math. Monthly",
|
||||||
|
volume = "99",
|
||||||
|
year = "1992",
|
||||||
|
pages = "403--422",
|
||||||
|
}
|
||||||
|
|
||||||
|
@book{ConcreteMath,
|
||||||
|
author = "R.L. Graham and D.E. Knuth and O. Patashnik",
|
||||||
|
title = "Concrete mathematics",
|
||||||
|
publisher = "Addison-Wesley",
|
||||||
|
address = "Reading, MA",
|
||||||
|
year = "1989"
|
||||||
|
}
|
||||||
|
|
||||||
|
@unpublished{Simpson,
|
||||||
|
author = "H. Simpson",
|
||||||
|
title = "Proof of the {R}iemann {H}ypothesis",
|
||||||
|
note = "preprint (2003), available at
|
||||||
|
\texttt{http://www.math.drofnats.edu/riemann.ps}",
|
||||||
|
year = "2003"
|
||||||
|
}
|
||||||
|
|
||||||
|
@incollection{Er01,
|
||||||
|
author = "P. Erd{\H o}s",
|
||||||
|
title = "A selection of problems and results in combinatorics",
|
||||||
|
booktitle = "Recent trends in combinatorics (Matrahaza, 1995)",
|
||||||
|
publisher = "Cambridge Univ. Press",
|
||||||
|
address = "Cambridge",
|
||||||
|
pages = "1--6",
|
||||||
|
year = "1995"
|
||||||
|
}
|
||||||
|
@article{greenwade93,
|
||||||
|
author = "George D. Greenwade",
|
||||||
|
title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
|
||||||
|
year = "1993",
|
||||||
|
journal = "TUGBoat",
|
||||||
|
volume = "14",
|
||||||
|
number = "3",
|
||||||
|
pages = "342--351"
|
||||||
|
}
|
28
demo.tex
28
demo.tex
|
@ -1,7 +1,6 @@
|
||||||
\documentclass[10pt]{beamer}
|
\documentclass[10pt]{beamer}
|
||||||
|
|
||||||
\usetheme[usetitleprogressbar]{m}
|
\usetheme{m}
|
||||||
\renewcommand{\mthemetitleformat}{\scshape\MakeLowercase}
|
|
||||||
|
|
||||||
\usepackage{booktabs}
|
\usepackage{booktabs}
|
||||||
\usepackage[scale=2]{ccicons}
|
\usepackage[scale=2]{ccicons}
|
||||||
|
@ -204,21 +203,7 @@ or show \textbf{bold} results.\end{verbatim}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\begin{frame}{References}
|
\begin{frame}{References}
|
||||||
\begin{thebibliography}{10}
|
Some references to showcase [allowframebreaks] \cite{knuth92,ConcreteMath,Simpson,Er01,greenwade93}
|
||||||
|
|
||||||
\beamertemplatebookbibitems
|
|
||||||
\bibitem{Oppenheim2009}
|
|
||||||
Alan~V.~Oppenheim
|
|
||||||
\newblock Discrete-Time Signal Processing
|
|
||||||
\newblock Prentice Hall Press, 2009
|
|
||||||
\newblock Notes nobody is interested in
|
|
||||||
|
|
||||||
\beamertemplatearticlebibitems
|
|
||||||
\bibitem{EBU2011}
|
|
||||||
European~Broadcasting~Union
|
|
||||||
\newblock Specification of the Broadcast Wave Format (BWF)
|
|
||||||
\newblock 2011
|
|
||||||
\end{thebibliography}
|
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\section{Conclusion}
|
\section{Conclusion}
|
||||||
|
@ -239,4 +224,13 @@ or show \textbf{bold} results.\end{verbatim}
|
||||||
|
|
||||||
\plain{Questions?}
|
\plain{Questions?}
|
||||||
|
|
||||||
|
\begin{frame}[allowframebreaks]
|
||||||
|
|
||||||
|
\frametitle{References}
|
||||||
|
|
||||||
|
\bibliography{demo}
|
||||||
|
\bibliographystyle{abbrv}
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
40
mtheme.dtx
40
mtheme.dtx
|
@ -140,10 +140,10 @@ computer. The complete list of make rules is as follows:
|
||||||
|
|
||||||
Depending on the Linux distribution, the packaged name of |Fira Sans| might be
|
Depending on the Linux distribution, the packaged name of |Fira Sans| might be
|
||||||
|Fira Sans OT| instead of |Fira Sans|. In that case, you may have to edit
|
|Fira Sans OT| instead of |Fira Sans|. In that case, you may have to edit
|
||||||
|beamerfontthememetropolis.dtx|. You may also need to install Fira Sans; see the
|
|beamerfontthememetropolis.dtx|. You may also need to install Fira Sans; see
|
||||||
|contrib/| directory for more. Users of Debian or Ubuntu can also install this
|
the |contrib/| directory for more. Users of Debian or Ubuntu can also install
|
||||||
\href{https://launchpad.net/\%7Eedd/+archive/ubuntu/misc/+files/latex-mtheme_0.1.0vidid1_all.deb}{.deb
|
this \href{https://launchpad.net/\%7Eedd/+archive/ubuntu/misc/+files/latex-mtheme_0.1.0vidid1_all.deb}{.deb package} containing the theme files as well
|
||||||
package} containing the theme files as well as the Fira Sans font files.
|
as the Fira Sans font files.
|
||||||
|
|
||||||
|
|
||||||
\subsection{Pandoc}
|
\subsection{Pandoc}
|
||||||
|
@ -158,8 +158,8 @@ $ pandoc -t beamer --latex-engine=xelatex -V theme:m -o output.pdf input.md
|
||||||
|
|
||||||
\subsection{A Minimal Example}
|
\subsection{A Minimal Example}
|
||||||
|
|
||||||
To get started with the theme is very simple. The following code shows a minimal
|
To get started with the theme is very simple. The following code shows a
|
||||||
example of a Beamer presentation using the \textsc{mtheme}.
|
minimal example of a Beamer presentation using the \textsc{mtheme}.
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\documentclass[10pt]{beamer}
|
\documentclass[10pt]{beamer}
|
||||||
|
@ -192,10 +192,6 @@ them when invoking \textsc{mtheme} in the preamble of the slides, i.e.
|
||||||
Adds a thin progress bar similar to the section progress bar underneath each
|
Adds a thin progress bar similar to the section progress bar underneath each
|
||||||
frame title.\\
|
frame title.\\
|
||||||
|
|
||||||
\noindent\DescribeMacro{protectframetitle}
|
|
||||||
In order to use |\cite|, |\ref| and similar commands in a frame title you have
|
|
||||||
to protect the title. This can be done automatically with this option.\\
|
|
||||||
|
|
||||||
\noindent\DescribeMacro{blockbg}
|
\noindent\DescribeMacro{blockbg}
|
||||||
Adds background color to the blocks similar to other beamer themes.\\
|
Adds background color to the blocks similar to other beamer themes.\\
|
||||||
|
|
||||||
|
@ -239,26 +235,24 @@ in your preamble. For greater customization, you can redefine any of the other
|
||||||
colors in |beamercolorthememetropolis|, including progress bar.
|
colors in |beamercolorthememetropolis|, including progress bar.
|
||||||
|
|
||||||
|
|
||||||
\subsection{Title Formatting}
|
\subsection{Title Case Formatting}
|
||||||
|
|
||||||
The main title, section titles, and frame titles are all formatted according to
|
The main title, section titles, frame titles and plain frame titles are all
|
||||||
the custom command |\mthemetitleformat|. By default, this is equivalent to
|
formatted according to the custom command |\mthemetitleformat|. By default,
|
||||||
|\scshape| and sets the titles in small capitals, but you can change it in your
|
this is equivalent to |\MakeLowercase{#1}|, hence seting the titles in small
|
||||||
preamble. For example:
|
capitals. You can change this behaviour in your preamble. For example:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
% no small capitals
|
% camel case
|
||||||
\renewcommand{\mthemetitleformat}{}
|
\renewcommand{\mthemetitleformat}{}
|
||||||
% all small capitals
|
% lowercase
|
||||||
\renewcommand{\mthemetitleformat}{\scshape\MakeLowercase}
|
\renewcommand{\mthemetitleformat}\MakeLowercase}
|
||||||
% all capitals
|
% uppercase
|
||||||
\renewcommand{\mthemetitleformat}{\MakeUppercase}
|
\renewcommand{\mthemetitleformat}{\MakeUppercase}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
Note that |\MakeLowercase| and |\MakeUppercase| can have unexpected behaviour in
|
Be aware that these formatting macros will be replaced with theme options in
|
||||||
math mode, are disabled when |protectframetitle| is used, and cause crashes when
|
the future.
|
||||||
an unprotected frametitle appears on a slide with |allowframebreaks|.
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Commands}
|
\subsection{Commands}
|
||||||
|
|
||||||
|
|
BIN
mtheme.pdf
BIN
mtheme.pdf
Binary file not shown.
Loading…
Reference in New Issue