reworked fancythm: provides default theorm styles as option. cleaned it up

This commit is contained in:
Maximilian Keßler 2021-09-12 13:37:20 +02:00
parent 6f67c1c143
commit ef989f7f57
3 changed files with 223 additions and 205 deletions

View file

@ -1,268 +1,193 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-fancythm}[2021/04/27 - Theorem-Environment Package] \ProvidesPackage{mkessler-fancythm}[2021/04/27 - Theorem-Environment Package]
%%%%%%%%m %%%%%%%%m
%Provides fancy theorem-like-environments usedd in the write-ups of my lecture nots %Provides fancy theorem-like-environments used in the write-ups of my lecture notes
\RequirePackage{xkeyval}
\newif\ifenglish\englishtrue
\newif\ifshowstars\showstarstrue
\newif\ifshowdaggers\showdaggerstrue
\newif\ifincludestars\includestarstrue
\newif\ifincludeoral\includeoraltrue
\newif\ifmarkoral\markoraltrue
\newif\iflecturenumbers\lecturenumberstrue
\newif\ifnumbersmallenvironmentswiththeorem\numbersmallenvironmentswiththeoremfalse
\newif\ifnumbersmallenvironments\numbersmallenvironmentsfalse
\newcommand{\fancythmlinewidth}{2pt}
\newcommand{\fancythm}{8pt}
\define@choicekey*{mkesslerfancythm}{numbersmallenvironments}[\val\nr]{no,section,theorem}{%
\ifcase\nr\relax
\numbersmallenvironmentsfalse
\or
\numbersmallenvironmentstrue
%numbering small environments within sections is forbidden whilst using lecturenumbes
\iflecturenumbers
\numbersmallenvironmentswiththeoremtrue
\else
\numbersmallenvironmentswiththeoremfalse
\fi
\or
\numbersmallenvironmentstrue
\numbersmallenvironmentswiththeoremtrue
\fi
}
\define@choicekey*{mkesslerfancythm}{lecturenumbers}[\val\nr]{true,false}{%
\ifcase\nr\relax
\lecturenumberstrue
\else
\lecturenumbersfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{showdaggers}[\val\nr]{true,false}{%
\ifcase\nr\relax
\showdaggerstrue
\else
\showdaggersfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{ownenvironments}[\val\nr]{on, natural, off}{%
\ifcase\nr\relax
\includestarstrue
\showstarstrue
\or
\includestarstrue
\showstarsfalse
\or
\includestarsfalse
\showstarsfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{oralremarks}[\val\nr]{on,natural,off}{%
\ifcase\nr\relax
\includeoraltrue
\markoraltrue
\or
\includeoraltrue
\markoralfalse
\or
\includeoralfalse
\fi
}
\RequirePackage{mkessler-fancythmoptions} % Internal preamble for option handling
%%%%% Option section %%%%% Option section
\DeclareOptionX{english}{\mkessler@fancythm@englishtrue}
\DeclareOptionX{german}{\mkessler@fancythm@englishfalse}
\DeclareOptionX{english}{\englishtrue} \DeclareOptionX{showdaggers}{\setkeys{mkesslerfancythm}{mkessler@fancythm@showdaggers=#1}}
\DeclareOptionX{german}{\englishfalse}
\DeclareOptionX{showdaggers}{\setkeys{mkesslerfancythm}{showdaggers=#1}}
\DeclareOptionX{ownenvironments}{\setkeys{mkesslerfancythm}{ownenvironments=#1}} \DeclareOptionX{ownenvironments}{\setkeys{mkesslerfancythm}{ownenvironments=#1}}
\DeclareOptionX{oralremarks}{\setkeys{mkesslerfancythm}{oralremarks=#1}} \DeclareOptionX{oralremarks}{\setkeys{mkesslerfancythm}{oralremarks=#1}}
\DeclareOptionX{lecturenumbers}{\setkeys{mkesslerfancythm}{lecturenumbers=#1}} \DeclareOptionX{mkessler@fancythm@lecturenumbers}{\setkeys{mkesslerfancythm}{mkessler@fancythm@lecturenumbers=#1}}
\DeclareOptionX{numbersmallenvironments}{\setkeys{mkesslerfancythm}{numbersmallenvironments=#1}} \DeclareOptionX{numbersmallenvironments}{\setkeys{mkesslerfancythm}{mkessler@fancythm@numbersmallenvironments=#1}}
\DeclareOptionX*{\PackageWarning{mkesslerfancythm}{Unknown X \CurrentOption}}% For unknown options \DeclareOptionX*{\PackageWarning{mkesslerfancythm}{Unknown X \CurrentOption}}% For unknown options
\ProcessOptionsX*\relax \ProcessOptionsX*\relax
%%%%%%%% Implementation section
%Required Packages and setup
%%%% Implementation section
%Required Packages
\RequirePackage{amsmath} \RequirePackage{amsmath}
\RequirePackage{amsthm} \RequirePackage{amsthm}
\RequirePackage{mdframed} \RequirePackage{mdframed}
\RequirePackage{thmtools} \RequirePackage{thmtools}
\RequirePackage[skins]{tcolorbox} \RequirePackage[skins]{tcolorbox}
\RequirePackage{mfirstuc}
\RequirePackage{xifthen}
\RequirePackage{xparse}
\tcbuselibrary{breakable}
% Dummy counters
\declaretheorem[numberwithin=section]{mkessler@fancythm@dummy}
\declaretheorem[numberwithin=mkessler@fancythm@dummy]{mkessler@fancythm@smalldummy}
%%%%% Main part, i.e. providing macros for defining new theorems
\RequirePackage{mkessler-thmstyle}
%%Environments that are numbered by default have 3 versions: %%Environments that are numbered by default have 3 versions:
% - the standard one, for numbering % - the standard one, for numbering
% - one asterisk, to exclude them from numbering (because they were not numbered in the lecture) -> they will be numbered if 'truenmubers' option is set % - one asterisk, to exclude them from numbering (because they were not numbered in the lecture) -> they will be numbered if 'truenmubers' option is set
% - two asterisks, for marking them as self-added, so they will not be numbered, but will receive a visual asterisk. -> They will be numbered if 'truenumbers' option is set % - two asterisks, for marking them as self-added, so they will not be numbered, but will receive a visual asterisk. -> They will be numbered if 'truenumbers' option is set
%Theorem
\RequirePackage{mfirstuc}
\RequirePackage{xifthen}
\RequirePackage{xparse}
%Taken from
% https://github.com/gillescastel/university-setup/blob/master/preamble.tex
% Make boxes breakable
\tcbuselibrary{breakable}
\declaretheorem[numberwithin=section]{dummy}
\declaretheorem[numberwithin=dummy]{smalldummy}
\NewDocumentCommand{\declarebigtheorem}{O{} O{} m m O{}}{ \NewDocumentCommand{\declarebigtheorem}{O{} O{} m m O{}}{
%First, store the name of the theorem in \theoremname %First, store the name of the theorem in \theoremname
\ifenglish \ifmkessler@fancythm@english
\ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}} \ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}}
\else \else
\ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}} \ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}}
\fi \fi
%Define the mane version of the theorem %Define the mane version of the theorem
\ifthenelse{\isempty{#5}}{\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling = dummy]{#4}}{} \ifthenelse{\isempty{#5}}{\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling = mkessler@fancythm@dummy]{#4}}{}
%Define the versions theorem*, theorem**, dtheorem %Define the versions theorem*, theorem**, dtheorem
\iflecturenumbers \ifmkessler@fancythm@lecturenumbers
\ifnumbersmallenvironments \ifmkessler@fancythm@numbersmallenvironments
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=smalldummy]{#4*} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=mkessler@fancythm@smalldummy]{#4*}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifshowstars *\else\fi, sibling=smalldummy]{#4**} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@smalldummy]{#4**}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifshowdaggers $^{\dagger}$\else\fi, sibling=smalldummy]{d#4} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@smalldummy]{d#4}
\else \else
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, numbered=no]{#4*} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, numbered=no]{#4*}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifshowstars *\else\fi, numbered = no]{#4**} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, numbered = no]{#4**}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifshowdaggers $^{\dagger}$\else\fi, numbered = no]{d#4} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, numbered = no]{d#4}
\fi \fi
\else \else
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=dummy]{#4*} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=mkessler@fancythm@dummy]{#4*}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifshowstars *\else\fi, sibling=dummy]{#4**} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@dummy]{#4**}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifshowdaggers $^{\dagger}$\else\fi, sibling=dummy]{d#4} \declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@dummy]{d#4}
\fi \fi
\ifincludestars\else\renewenvironment{#4**}{\comment}{\endcomment}\fi \ifmkessler@fancythm@includestars\else\renewenvironment{#4**}{\comment}{\endcomment}\fi
} }
\NewDocumentCommand{\declaresmalltheorem}{O{} O{} m m}{ \NewDocumentCommand{\declaresmalltheorem}{O{} O{} m m}{
%Get the name of the theorem and store it in \theoremname %Get the name of the theorem and store it in \theoremname
\ifenglish \ifmkessler@fancythm@english
\ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}} \ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}}
\else \else
\ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}} \ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}}
\fi \fi
\ifnumbersmallenvironments \ifmkessler@fancythm@numbersmallenvironments
\ifnumbersmallenvironmentswiththeorem \ifmkessler@fancythm@numbersmallenvironmentswiththeorem
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling = smalldummy]{#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling = mkessler@fancythm@smalldummy]{#4}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifshowstars *\else\fi, sibling=smalldummy]{#4*} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@smalldummy]{#4*}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifshowdaggers $^{\dagger}$\else\fi, sibling=smalldummy]{d#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@smalldummy]{d#4}
\else \else
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling=dummy]{#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling=mkessler@fancythm@dummy]{#4}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifshowstars *\else\fi, sibling=dummy]{#4*} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@dummy]{#4*}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifshowdaggers $^{\dagger}$\else\fi, sibling=dummy]{d#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@dummy]{d#4}
\fi \fi
\else \else
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, numbered = no]{#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, numbered = no]{#4}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifshowstars *\else\fi, numbered = no]{#4*} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, numbered = no]{#4*}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifshowdaggers $^{\dagger}$\else\fi, numbered = no]{d#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, numbered = no]{d#4}
\fi \fi
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling=dummy]{n#4} \declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling=mkessler@fancythm@dummy]{n#4}
\ifincludestars\else\renewenvironment{#4*}{\comment}{\endcomment}\fi \ifmkessler@fancythm@includestars\else\renewenvironment{#4*}{\comment}{\endcomment}\fi
} }
\declarebigtheorem[Satz][Theorem]{thmredmarginandfill}{theorem} %%%% If requested, now define some default theoremstyles
\declarebigtheorem{thmredmarginandfill}{proposition} \ifmkessler@fancythm@defaulttheorems
\declarebigtheorem[Korollar]{thmredmarginandfill}{corollary}
\declarebigtheorem{thmorangemarginandfill}{lemma}
\declarebigtheorem[Lemma und Definition][Lemma and Definition]{thmorangemarginbluefill}{lemmadef}
\declarebigtheorem{thmbluemarginandfill}{definition}
\declarebigtheorem[Satz und Definition][Theorem and Definition]{thmredmarginbluefill}{theoremdef}
\declarebigtheorem[Proposition und Definition][Proposition and Definition]{thmredmarginbluefill}{propositiondef}
\declarebigtheorem{thmvioletmarginandfill}{notation}
\declarebigtheorem[zuSatz][Addition to Theorem]{thmredmarginandfill}{additiontheorem}
%%%Environments that are not numbered by default (notation, question, example, remark etc) have two forms: \RequirePackage[default styles]{mkessler-thmstyle} % Easy setup of mdframed styles
% - normal form: won't be numbered unless 'numbersmallenvironments' is set
% - having an asterisk: will be displayed with an asterisk, will be numbered if 'numbersmallenvironments' is set
%Notation
\declaresmalltheorem[Notationsmissbrauch][Abuse of Notation]{thmvioletmargin}{abuse} \declarebigtheorem[Satz][Theorem]{thmredmarginandfill}{theorem}
\declaresmalltheorem[Beispiel]{thmgreenmargin}{example} \declarebigtheorem{thmredmarginandfill}{proposition}
\declaresmalltheorem[Bemerkung]{thmyellowmargin}{remark} \declarebigtheorem[Korollar]{thmredmarginandfill}{corollary}
\declaresmalltheorem[Lob]{thmgoldmargin}{praise} \declarebigtheorem{thmorangemarginandfill}{lemma}
\declaresmalltheorem[Trivial Nonsense][Trivial Nonsense]{thmyellowmargin}{trivial} \declarebigtheorem[Lemma und Definition][Lemma and Definition]{thmorangemarginbluefill}{lemmadef}
\declaresmalltheorem[Frage]{thmblackmarginandfill}{question} \declarebigtheorem{thmbluemarginandfill}{definition}
\declaresmalltheorem[Organisatorisches][Organisational stuff]{thmblackmargin}{orga} \declarebigtheorem[Satz und Definition][Theorem and Definition]{thmredmarginbluefill}{theoremdef}
\declaresmalltheorem[Fakt]{thmredmargin}{fact} \declarebigtheorem[Proposition und Definition][Proposition and Definition]{thmredmarginbluefill}{propositiondef}
\declarebigtheorem{thmvioletmarginandfill}{notation}
\declarebigtheorem[zuSatz][Addition to Theorem]{thmredmarginandfill}{additiontheorem}
%%%% Specially treated stuff %%%Environments that are not numbered by default (notation, question, example, remark etc) have two forms:
% - normal form: won't be numbered unless 'mkessler@fancythm@numbersmallenvironments' is set
% - having an asterisk: will be displayed with an asterisk, will be numbered if 'numbersmallenvironments' is set
%Notation
\declaresmalltheorem[\ifmarkoral Mündliche Anmerkung\else Bemerkung\fi][\ifmarkoral Oral remark\else remark\fi]{thmyellowmargin}{oral} \declaresmalltheorem[Notationsmissbrauch][Abuse of Notation]{thmvioletmargin}{abuse}
% Option to remove oral remarks when needed \declaresmalltheorem[Beispiel]{thmgreenmargin}{example}
\ifincludeoral\else \declaresmalltheorem[Bemerkung]{thmyellowmargin}{remark}
\renewenvironment{oral}{\comment}{\endcomment} \declaresmalltheorem[Lob]{thmgoldmargin}{praise}
\renewenvironment{oral*}{\comment}{\endcomment} \declaresmalltheorem[Trivial Nonsense][Trivial Nonsense]{thmyellowmargin}{trivial}
\renewenvironment{doral}{\comment}{\endcomment} \declaresmalltheorem[Frage]{thmblackmarginandfill}{question}
\fi \declaresmalltheorem[Organisatorisches][Organisational stuff]{thmblackmargin}{orga}
\declaresmalltheorem[Fakt]{thmredmargin}{fact}
%%%% Specially treated stuff
\declaresmalltheorem[\ifmkessler@fancythm@markoral Mündliche Anmerkung\else Bemerkung\fi][\ifmkessler@fancythm@markoral Oral remark\else remark\fi]{thmyellowmargin}{oral}
% Option to remove oral remarks when needed
\ifmkessler@fancythm@includeoral\else
\renewenvironment{oral}{\comment}{\endcomment}
\renewenvironment{oral*}{\comment}{\endcomment}
\renewenvironment{doral}{\comment}{\endcomment}
\fi
%%%%%%%% Other mdframed style boxes %%%%%%%% Other mdframed style boxes
\newtcolorbox{recap}{before skip = 0.5cm, after skip = 0.5cm, enhanced, sharp corners = all, colback = white, colframe = gray, toprule=0pt, bottomrule=0pt, leftrule=0pt,rightrule=0pt, overlay = { \newtcolorbox{recap}{before skip = 0.5cm, after skip = 0.5cm, enhanced, sharp corners = all, colback = white, colframe = gray, toprule=0pt, bottomrule=0pt, leftrule=0pt,rightrule=0pt, overlay = {
\draw[gray, line width = 2pt] (frame.north west) -- ++(0.5cm, 0pt); \draw[gray, line width = 2pt] (frame.north west) -- ++(0.5cm, 0pt);
\draw[gray, line width=2pt] (frame.south east) -- ++(-0.5cm, 0pt); \draw[gray, line width=2pt] (frame.south east) -- ++(-0.5cm, 0pt);
\draw[gray, line width=2pt] (frame.north west) -- ++ (0pt, -0.5cm); \draw[gray, line width=2pt] (frame.north west) -- ++ (0pt, -0.5cm);
\draw[gray, line width=2pt] (frame.south east) -- ++(0pt, 0.5cm); \draw[gray, line width=2pt] (frame.south east) -- ++(0pt, 0.5cm);
}} }}
\newenvironment{moral}{% \newenvironment{moral}{%
\begin{mdframed}[linecolor=green!70!black]% \begin{mdframed}[linecolor=green!70!black]%
\bfseries\color{green!50!black}}% \bfseries\color{green!50!black}}%
{\end{mdframed}} {\end{mdframed}}
\newenvironment{antimoral}{% \newenvironment{antimoral}{%
\begin{mdframed}[linecolor=red!70!black]% \begin{mdframed}[linecolor=red!70!black]%
\bfseries\color{red!50!black}}% \bfseries\color{red!50!black}}%
{\end{mdframed}} {\end{mdframed}}
%%%%%%%%%%%% Non-mdframed theorems %%%%%%%%%%%% Non-mdframed theorems
\theoremstyle{plain} \theoremstyle{plain}
\newtheorem{variant}{\ifenglish Variant\else Variante\fi} \newtheorem{variant}{\ifmkessler@fancythm@english Variant\else Variante\fi}
\newtheorem{assumption}{\ifenglish Assumption\else Annahme\fi} \newtheorem{assumption}{\ifmkessler@fancythm@english Assumption\else Annahme\fi}
\theoremstyle{definition} \theoremstyle{definition}
\newtheorem*{note}{\ifenglish Note\else Anmerkung\fi} \newtheorem*{note}{\ifmkessler@fancythm@english Note\else Anmerkung\fi}
\newtheorem*{warning}{\color{red}\ifenglish Warning \else Warnung\fi} \newtheorem*{warning}{\color{red}\ifmkessler@fancythm@english Warning \else Warnung\fi}
\newtheorem*{goal}{\ifenglish Goal \else Ziel\fi} \newtheorem*{goal}{\ifmkessler@fancythm@english Goal \else Ziel\fi}
\newtheorem*{strategy}{\ifenglish Proof Strategy \else Beweisstrategie\fi} \newtheorem*{strategy}{\ifmkessler@fancythm@english Proof Strategy \else Beweisstrategie\fi}
\newtheorem*{goal*}{\ifenglish Goal* \else Ziel*\fi} \newtheorem*{goal*}{\ifmkessler@fancythm@english Goal* \else Ziel*\fi}
\newtheorem*{problem}{Problem} \newtheorem*{problem}{Problem}
\newtheorem*{info}{Information} \newtheorem*{info}{Information}
\newtheorem*{answer}{\ifenglish Answer\else Antwort\fi} \newtheorem*{answer}{\ifmkessler@fancythm@english Answer\else Antwort\fi}
\newtheorem{observe}[theorem]{\ifenglish Observe\else Beobachte\fi} \newtheorem{observe}[theorem]{\ifmkessler@fancythm@english Observe\else Beobachte\fi}
\newtheorem*{property}{\ifenglish Property\else Eigenschaft\fi} \newtheorem*{property}{\ifmkessler@fancythm@english Property\else Eigenschaft\fi}
\newtheorem*{intuition}{Intuition} \newtheorem*{intuition}{Intuition}
\newtheorem*{recall}{\ifenglish Recall\else Erinnerung\fi} \newtheorem*{recall}{\ifmkessler@fancythm@english Recall\else Erinnerung\fi}
\newtheorem*{idea}{\ifenglish Idea\else Idee\fi} \newtheorem*{idea}{\ifmkessler@fancythm@english Idea\else Idee\fi}
\newtheorem{exercise}{\ifenglish Exercise\else Aufgabe\fi}[section] \newtheorem{exercise}{\ifmkessler@fancythm@english Exercise\else Aufgabe\fi}[section]
\newtheorem{reminder}{\ifenglish Reminder\else Erinnerung\fi} \newtheorem{reminder}{\ifmkessler@fancythm@english Reminder\else Erinnerung\fi}
\fi % end of default theorems

View file

@ -0,0 +1,84 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-fancythmoptions}
\RequirePackage{xkeyval}
%%%%% This is an internal base class, do not import this yourself
%% This will just be imported by fancythm for easy options use
\newif\ifmkessler@fancythm@english\mkessler@fancythm@englishtrue
\newif\ifmkessler@fancythm@showstars\mkessler@fancythm@showstarstrue
\newif\ifmkessler@fancythm@showdaggers\mkessler@fancythm@showdaggerstrue
\newif\ifmkessler@fancythm@includestars\mkessler@fancythm@includestarstrue
\newif\ifmkessler@fancythm@includeoral\mkessler@fancythm@includeoraltrue
\newif\ifmkessler@fancythm@markoral\mkessler@fancythm@markoraltrue
\newif\ifmkessler@fancythm@lecturenumbers\mkessler@fancythm@lecturenumberstrue
\newif\ifmkessler@fancythm@numbersmallenvironmentswiththeorem\mkessler@fancythm@numbersmallenvironmentswiththeoremfalse
\newif\ifmkessler@fancythm@numbersmallenvironments\mkessler@fancythm@numbersmallenvironmentsfalse
\newif\ifmkessler@fancythm@defaulttheorems\mkessler@fancythm@defaulttheoremstrue
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@numbersmallenvironments}[\val\nr]{no,section,theorem}{%
\ifcase\nr\relax
\mkessler@fancythm@numbersmallenvironmentsfalse
\or
\mkessler@fancythm@numbersmallenvironmentstrue
%numbering small environments within sections is forbidden whilst using lecturenumbes
\ifmkessler@fancythm@lecturenumbers
\mkessler@fancythm@numbersmallenvironmentswiththeoremtrue
\else
\mkessler@fancythm@numbersmallenvironmentswiththeoremfalse
\fi
\or
\mkessler@fancythm@numbersmallenvironmentstrue
\mkessler@fancythm@numbersmallenvironmentswiththeoremtrue
\fi
}
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@lecturenumbers}[\val\nr]{true,false}{%
\ifcase\nr\relax
\mkessler@fancythm@lecturenumberstrue
\else
\mkessler@fancythm@lecturenumbersfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@defaulttheorems}[\val\nr]{true,false}{%
\ifcase\nr\relax
\mkessler@fancythm@defaulttheoremstrue
\else
\mkessler@fancythm@defaulttheoremsfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@showdaggers}[\val\nr]{true,false}{%
\ifcase\nr\relax
\mkessler@fancythm@showdaggerstrue
\else
\mkessler@fancythm@showdaggersfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{ownenvironments}[\val\nr]{on, natural, off}{%
\ifcase\nr\relax
\mkessler@fancythm@includestarstrue
\mkessler@fancythm@showstarstrue
\or
\mkessler@fancythm@includestarstrue
\mkessler@fancythm@showstarsfalse
\or
\mkessler@fancythm@includestarsfalse
\mkessler@fancythm@showstarsfalse
\fi
}
\define@choicekey*{mkesslerfancythm}{oralremarks}[\val\nr]{on,natural,off}{%
\ifcase\nr\relax
\mkessler@fancythm@includeoraltrue
\mkessler@fancythm@markoraltrue
\or
\mkessler@fancythm@includeoraltrue
\mkessler@fancythm@markoralfalse
\or
\mkessler@fancythm@includeoralfalse
\fi
}

View file

@ -3,6 +3,13 @@
%%%%% This provides easy-to-use styles, especially for use with the %%%%% This provides easy-to-use styles, especially for use with the
% A simple option wether to define some default styles
\newif\ifmkessler@thmstyle@defaultstyles\mkessler@thmstyle@defaultstylesfalse
\DeclareOption{defaultstyles}{\mkessler@thmstyle@defaultstylestrue}
\DeclareOption*{\PackageWarning{mkessler-thmstyle}{Unknown '\CurrentOption'}}
\ProcessOptions\relax
\RequirePackage{amsthm} \RequirePackage{amsthm}
\RequirePackage{thmtools} \RequirePackage{thmtools}
\RequirePackage{mdframed} \RequirePackage{mdframed}
@ -68,17 +75,19 @@
\fi \fi
} }
\declarefancythmstyle[red!8]{red}[thmredmarginandfill] \ifmkessler@thmstyle@defaultstyles
\declarefancythmstyle[orange!10]{orange}[thmorangemarginandfill] \declarefancythmstyle[red!8]{red}[thmredmarginandfill]
\declarefancythmstyle[blue!7]{blue}[thmbluemarginandfill] \declarefancythmstyle[orange!10]{orange}[thmorangemarginandfill]
\declarefancythmstyle{green!70!black}[thmgreenmargin] \declarefancythmstyle[blue!7]{blue}[thmbluemarginandfill]
\declarefancythmstyle{gold}[thmgoldmargin] \declarefancythmstyle{green!70!black}[thmgreenmargin]
\declarefancythmstyle{yellow!80!orange}[thmyellowmargin] \declarefancythmstyle{gold}[thmgoldmargin]
\declarefancythmstyle{gray}[thmgraymargin] \declarefancythmstyle{yellow!80!orange}[thmyellowmargin]
\declarefancythmstyle[violet!7]{violet}[thmvioletmarginandfill] \declarefancythmstyle{gray}[thmgraymargin]
\declarefancythmstyle{violet}[thmvioletmargin] \declarefancythmstyle[violet!7]{violet}[thmvioletmarginandfill]
\declarefancythmstyle[blue!7]{red}[thmredmarginbluefill] \declarefancythmstyle{violet}[thmvioletmargin]
\declarefancythmstyle{red}[thmredmargin] \declarefancythmstyle[blue!7]{red}[thmredmarginbluefill]
\declarefancythmstyle[blue!7]{orange}[thmorangemarginbluefill] \declarefancythmstyle{red}[thmredmargin]
\declarefancythmstyle[violet!20!gray!20]{black}[thmblackmarginandfill] \declarefancythmstyle[blue!7]{orange}[thmorangemarginbluefill]
\declarefancythmstyle{black}[thmblackmargin] \declarefancythmstyle[violet!20!gray!20]{black}[thmblackmarginandfill]
\declarefancythmstyle{black}[thmblackmargin]
\fi