From c7e03cdf2d6325221f3462ac7a8f759988734142 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Thu, 12 May 2016 21:55:28 +0200 Subject: [PATCH] Settle some part of code between files. --- calculmental/calculmental.cls | 41 +++++++------- commun/commun.sty | 56 +++---------------- cours/cours.cls | 100 ++++++++++++++++++---------------- cours/cours_beamer.cls | 2 +- 4 files changed, 84 insertions(+), 115 deletions(-) diff --git a/calculmental/calculmental.cls b/calculmental/calculmental.cls index f59afc0..76b8005 100644 --- a/calculmental/calculmental.cls +++ b/calculmental/calculmental.cls @@ -12,7 +12,7 @@ %-- classe de base -\LoadClass{beamer} +\LoadClassWithOptions{beamer} %-- % @@ -24,8 +24,9 @@ %-- % -%-- definitions -%-- % +% +% \toggletrue{calculmental} +% %-- paramètrages @@ -95,22 +96,22 @@ } -\newcounter{questionscounter} -\NewDocumentEnvironment{questions}{O{60}}{ % begin - \stepcounter{questionscounter} - \section{Question \usecounter{questionscounter}} - \begin{frame} - \centering - Question \usecounter{questionscounter}\transduration{3} - \end{frame} - \begin{frame} - \centering - \begin{beamerboxesrounded}{Q\usecounter{questionscounter}.} -} { % end - \end{beamerboxesrounded} % - \decompte{#1} % - \end{frame} % -} +% \newcounter{cqcm} +% \NewDocumentEnvironment{qcm}{ G{60} }{ % begin +% \stepcounter{cqcm} +% \section{Question \usecounter{cqcm}\ } +% \begin{frame} +% \centering +% Question \usecounter{cqcm}\transduration{3} +% \end{frame} +% \begin{frame} +% \centering +% \begin{beamerboxesrounded}{Q\usecounter{cqcm}.\ } +% }{ % end +% \end{beamerboxesrounded} % +% \decompte{#1} % +% \end{frame} % +% } \newcommand{\fin}{% @@ -120,7 +121,7 @@ \end{frame} - \section{Index} + \section*{Index} \begin{frame} \begin{center}{\Large Index des questions}\end{center} \tableofcontents diff --git a/commun/commun.sty b/commun/commun.sty index 9cf7e30..e57fcc8 100644 --- a/commun/commun.sty +++ b/commun/commun.sty @@ -40,6 +40,7 @@ \RequirePackage{xstring} \RequirePackage{multido} \RequirePackage{xparse} +\RequirePackage{etoolbox} % tableau \RequirePackage{array} @@ -51,6 +52,13 @@ %-- % +% +% \newtoggle{cours} +% \newtoggle{calculmental} +% \newtoggle{cours_beamer} +% + + %% MACROS : DEBUT \makeatletter @@ -76,54 +84,6 @@ %% rb{largeur} : droite - bas %\newcolumntype{rb}[1]{>{\raggedleft}b{#1}} -% questions<[type]> -% -% type = 1 -> \arabic -% type = a -> \alph -% type = A -> \Alph -% type = i -> \roman -% type = I -> \Roman -% \arabic par défaut -\newcounter{questionscounter} -\newcommand{\questionsseparator}{.} -\newenvironment{questions}[1][1] { - \ifthenelse{ \equal{#1}{i} } - { - \def\cType{\roman} - \renewcommand{\questionsseparator}{)} - } - { - \ifthenelse{ \equal{#1}{I} } - { - \def\cType{\Roman} - \renewcommand{\questionsseparator}{.} - } - { - \ifthenelse{ \equal{#1}{a} } - { - \def\cType{\alph} - \renewcommand{\questionsseparator}{)} - } - { - \ifthenelse{ \equal{#1}{A} } - { - \def\cType{\Alph} - \renewcommand{\questionsseparator}{.} - } - { - \def\cType{\arabic} - \renewcommand{\questionsseparator}{.} - } - } - } - } - \begin{list}{\textbf{\cType{questionscounter}\questionsseparator}}{ - \usecounter{questionscounter} - \itemindent=0em - \itemsep=8pt \leftmargin=0,54cm} - } { - \end{list} -} % barrer du texte \newcommand\hcancel[2][black]{ diff --git a/cours/cours.cls b/cours/cours.cls index b1091c6..39775ba 100644 --- a/cours/cours.cls +++ b/cours/cours.cls @@ -45,6 +45,10 @@ %--% +% +% \toggletrue{cours} +% + %-- structure de la page @@ -208,52 +212,56 @@ } -% % questions<[type]> -% % -% % type = 1 -> \arabic -% % type = a -> \alph -% % type = A -> \Alph -% % type = i -> \roman -% % type = I -> \Roman -% % \arabic par défaut -% \newcounter{questionscounter} -% \newcommand{\questionsseparator}{.} -% \newenvironment{questions}[1][1] { -% \ifthenelse{ \equal{#1}{i} } -% { -% \def\cType{\roman} -% } -% { -% \ifthenelse{ \equal{#1}{I} } -% { -% \def\cType{\Roman} -% } -% { -% \ifthenelse{ \equal{#1}{a} } -% { -% \def\cType{\alph} -% \renewcommand{\questionsseparator}{)} -% } -% { -% \ifthenelse{ \equal{#1}{A} } -% { -% \def\cType{\Alph} -% } -% { -% \def\cType{\arabic} -% } -% } -% } -% } -% \begin{list}{\textbf{\cType{questionscounter}\questionsseparator}}{ -% \usecounter{questionscounter} -% \itemindent=0em -% \itemsep=8pt \leftmargin=0,54cm} -% } { -% \end{list} -% } -% \newcommand{\bq}{\begin{questions}} -% \newcommand{\eq}{\end{questions}} +% questions<[type]> +% +% type = 1 -> \arabic +% type = a -> \alph +% type = A -> \Alph +% type = i -> \roman +% type = I -> \Roman +% \arabic par défaut +\newcounter{cours_questionscounter} +\newcommand{\questionsseparator}{.} +\newenvironment{questions}[1][1] { + \ifthenelse{ \equal{#1}{i} } + { + \def\cType{\roman} + \renewcommand{\questionsseparator}{)} + } + { + \ifthenelse{ \equal{#1}{I} } + { + \def\cType{\Roman} + \renewcommand{\questionsseparator}{.} + } + { + \ifthenelse{ \equal{#1}{a} } + { + \def\cType{\alph} + \renewcommand{\questionsseparator}{)} + } + { + \ifthenelse{ \equal{#1}{A} } + { + \def\cType{\Alph} + \renewcommand{\questionsseparator}{.} + } + { + \def\cType{\arabic} + \renewcommand{\questionsseparator}{.} + } + } + } + } + \begin{list}{\textbf{\cType{cours_questionscounter}\questionsseparator}}{ + \usecounter{cours_questionscounter} + \itemindent=0em + \itemsep=8pt \leftmargin=0,54cm} + } { + \end{list} +} +\newcommand{\bq}{\begin{questions}} +\newcommand{\eq}{\end{questions}} % setAngle{nom}{valeur} diff --git a/cours/cours_beamer.cls b/cours/cours_beamer.cls index a75611c..83b081f 100644 --- a/cours/cours_beamer.cls +++ b/cours/cours_beamer.cls @@ -184,7 +184,7 @@ \setbeamercolor{block title}{fg=crimson,bg=pink!95!white} \begin{block} {#1} }{%end -\end{block} + \end{block} } % \NewDocumentEnvironment{thm}{ G{Théorème} }{%begin