From 13806156ae20490fdc73a28be4ebe860d52716a4 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Tue, 27 Sep 2016 15:23:19 +0200 Subject: [PATCH] simplify code for declaring options --- cours/cours_beamer.cls | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cours/cours_beamer.cls b/cours/cours_beamer.cls index f5afe1a..586bea1 100644 --- a/cours/cours_beamer.cls +++ b/cours/cours_beamer.cls @@ -8,7 +8,7 @@ %%% \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{cours_beamer}[2014/12/08 Slides de cours, v1.5] +\ProvidesClass{cours_beamer}[2014/12/08 Slides de cours, v1.6] @@ -35,16 +35,25 @@ % firstcolor % option de classe % couleur générale du beamer -\def\firstcolor{lapislazuli}% -\define@key{cours_beamer.cls}{firstcolor}[lapislazuli]{% +% +% "classical" way +% \def\firstcolor{lapislazuli}% +% \define@key{cours_beamer.cls}{firstcolor}[lapislazuli]{% +% \def\firstcolor{#1}% +% } +% +% \def\secondcolor{-\firstcolor}% +% \define@key{cours_beamer.cls}{secondcolor}[-\firstcolor]{% +% \def\secondcolor{#1}% +% } +%--% +\DeclareOptionX{firstcolor}[lapislazuli]{% \def\firstcolor{#1}% } - -\def\secondcolor{-\firstcolor}% -\define@key{cours_beamer.cls}{secondcolor}[-\firstcolor]{% +\DeclareOptionX{secondcolor}[-\firstcolor]{% \def\secondcolor{#1}% } -%--% + %-- options