Skip to content
Snippets Groups Projects
Commit 30e4e744 authored by GARION Christophe's avatar GARION Christophe
Browse files

theorems: refactor beamer/non beamer definitions

parent 1211bb64
No related branches found
No related tags found
No related merge requests found
...@@ -8,34 +8,46 @@ ...@@ -8,34 +8,46 @@
% packages % packages
\RequirePackage{amsthm} \RequirePackage{amsthm}
% translator
\RequirePackage{translator}
\deftranslation[to=French]{Rule}{R\`egle}
\deftranslation[to=French]{Principle}{Principe}
\deftranslation[to=French]{Property}{Propri\'et\'e}
\deftranslation[to=French]{Syntax}{Syntaxe}
\deftranslation[to=French]{N.B.}{Remarque}
\deftranslation[to=French]{Exercise}{Exercice}
\deftranslation[to=French]{Hypothesis}{Hypoth\`ese}
\deftranslation[to=French]{Code convention}{Convention de codage}
% new theorems % new theorems
% check if beamer is loaded
\ifclassloaded{beamer}{
\theoremstyle{definition} \theoremstyle{definition}
\newtheorem*{myrule}{\translate{Rule}} \newtheorem*{myrule}{\translate{Rule}}
\deftranslation[to=French]{Rule}{R\`egle}
\newtheorem*{principle}{\translate{Principle}} \newtheorem*{principle}{\translate{Principle}}
\deftranslation[to=French]{Principle}{Principe}
\newtheorem*{property}{\translate{Property}} \newtheorem*{property}{\translate{Property}}
\deftranslation[to=French]{Property}{Propri\'et\'e}
\newtheorem*{syntax}{\translate{Syntax}} \newtheorem*{syntax}{\translate{Syntax}}
\deftranslation[to=French]{Syntax}{Syntaxe}
\newtheorem*{nb}{\translate{N.B.}} \newtheorem*{nb}{\translate{N.B.}}
\deftranslation[to=French]{N.B.}{Remarque}
\newtheorem*{exercise}{\translate{Exercise}} \newtheorem*{exercise}{\translate{Exercise}}
\deftranslation[to=French]{Exercise}{Exercice}
\newtheorem*{hypothesis}{\translate{Hypothesis}} \newtheorem*{hypothesis}{\translate{Hypothesis}}
\deftranslation[to=French]{Hypothesis}{Hypoth\`ese}
\newtheorem*{codeconvention}{\translate{Code convention}} \newtheorem*{codeconvention}{\translate{Code convention}}
\deftranslation[to=French]{Code convention}{Convention de codage} }{
\@ifclassloaded{beamer}{}{
\@ifpackageloaded{beamerarticle}{}{
\newtheorem*{definition}{\translate{Definition}}
\deftranslation[to=French]{Definition}{D\'efinition}
}
}
% better theorems
\RequirePackage[theorems]{tcolorbox} \RequirePackage[theorems]{tcolorbox}
\newtcbtheorem[number within=section]{myrule}{\translate{Rule}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{principle}{\translate{Principle}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{property}{\translate{Property}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{syntax}{\translate{Syntax}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{nb}{\translate{N.B.}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{exercise}{\translate{Exercise}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{hypothesis}{\translate{Hypothesis}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\newtcbtheorem[number within=section]{codeconv}{\translate{Code conventions}}% \newtcbtheorem[number within=section]{codeconv}{\translate{Code conventions}}%
{colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th} {colback=gray!10,colframe=gray!80,fonttitle=\bfseries}{th}
\deftranslation[to=French]{Code conventions}{Conventions de codage} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment