From e0a8600ba29049b19a1cb2a8cbbc51dcb64ac070 Mon Sep 17 00:00:00 2001 From: Johann Dahm Date: Wed, 28 Jan 2015 23:13:06 -0500 Subject: [PATCH] Pass option 'blockbg' through to colortheme package. Also, use beamer-specific DeclareOption and error if incorrect options are passed. --- beamercolorthememetropolis.sty | 20 +++++++++++++++----- beamerthemem.sty | 32 ++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/beamercolorthememetropolis.sty b/beamercolorthememetropolis.sty index 25b2a35..4641254 100644 --- a/beamercolorthememetropolis.sty +++ b/beamercolorthememetropolis.sty @@ -9,12 +9,22 @@ \ProvidesPackage{beamercolorthememetropolis} -\newif\if@blockbg -\@blockbgfalse -\DeclareOption{blockbg}{\@blockbgtrue} -\ProcessOptions\relax +%}}} +%{{{ --- Options ---------------------- +\newif\if@beamer@metropolis@blockbg +\@beamer@metropolis@blockbgfalse +\DeclareOptionBeamer{blockbg}{\@beamer@metropolis@blockbgtrue} + +\DeclareOptionBeamer*{% + \PackageWarning{beamercolorthememetropolis}{Unknown option `\CurrentOption'}% +} + +\ProcessOptionsBeamer + +%}}} +%{{{ --- Colors --------------------- % http://paletton.com/#uid=7050t0kkJkJsntwoyp6gYgoddc4 @@ -47,7 +57,7 @@ \setbeamercolor{footnote mark}{fg=.} \setbeamercolor{page number in head/foot}{fg=mDarkTeal} -\if@blockbg +\if@beamer@metropolis@blockbg \setbeamercolor{block title}{parent=palette primary,bg=palette primary.bg!80!fg} \setbeamercolor{block title alerted}{use=alerted text,parent=palette primary,fg=alerted text.fg} diff --git a/beamerthemem.sty b/beamerthemem.sty index c5db9f0..19e6277 100644 --- a/beamerthemem.sty +++ b/beamerthemem.sty @@ -9,6 +9,26 @@ \ProvidesPackage{beamerthemem} +%{{{ --- Options ---------------------- + +\newif\if@useTitleProgressBar +\@useTitleProgressBarfalse +\DeclareOptionBeamer{useTitleProgressBar}{\@useTitleProgressBartrue} + +\newif\if@protectFrameTitle +\@protectFrameTitlefalse +\DeclareOptionBeamer{protectframetitle}{\@protectFrameTitletrue} + +\DeclareOptionBeamer{blockbg}{\PassOptionsToPackage{blockbg}{beamercolorthememetropolis}} + +\DeclareOptionBeamer*{% + \PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}% +} + +\ProcessOptionsBeamer + + +%}}} %{{{ --- Packages --------------------- \usepackage[no-math]{fontspec} @@ -22,18 +42,6 @@ \usecolortheme{metropolis} \usefonttheme{metropolis} -%}}} -%{{{ --- Options ---------------------- - -\newif\if@useTitleProgressBar -\@useTitleProgressBarfalse -\DeclareOption{titleprogressbar}{\@useTitleProgressBartrue} - -\newif\if@protectFrameTitle -\@protectFrameTitlefalse -\DeclareOption{protectframetitle}{\@protectFrameTitletrue} - -\ProcessOptions\relax %}}} %{{{ --- Titlepage --------------------