Clean code an correct method env

This commit is contained in:
Jeff Lance 2019-01-13 10:18:09 +01:00
parent b0fb047730
commit daddccb173
2 changed files with 25 additions and 24 deletions

View File

@ -7,26 +7,26 @@
%% definition
%%
\RenewDocumentEnvironment{definition}{ s o }{
\RenewDocumentEnvironment{definition}{ s D<>{Définition} o }{
\setbeamercolor*{block title}{parent=definition}
\IfBooleanTF {#1} {
% if starred: with logo
\IfNoValueTF {#2} {
\IfNoValueTF {#3} {
% if no subtitle
\begin{block} {\faPencil \hspace{.125em}\ Définition}
\begin{block} {\faPencil \hspace{.125em}\ #2}
}{
% if subtitle
\begin{block} {\faPencil \hspace{.125em}\
Définition \hfill{\normalfont\slshape#2}}
#2 \hfill{\normalfont\slshape#3}}
}
}{
% if not starred: without logo
\IfNoValueTF {#2} {
\IfNoValueTF {#3} {
% if no subtitle
\begin{block} {Définition}
\begin{block} {#2}
}{
% if subtitle
\begin{block} {Définition \hfill{\normalfont\slshape#2}}
\begin{block} {#2 \hfill{\normalfont\slshape#3}}
}
}
}{

View File

@ -175,6 +175,7 @@
\IfNoValueTF {#1} {
% if no subtitle
\begin{@com}
% \vspace{-.5cm}
\noindent
}{
% if subtitle
@ -182,7 +183,7 @@
\noindent
}
}{
\end{@com}
\end{@com}
}
% remarque
@ -257,7 +258,7 @@
% application
\NewDocumentEnvironment{application}{ o }{
\IfNoValueTF {#1} {
\IfNoValueTF {#1} {
% if no subtitle
\begin{@app}
\noindent
@ -267,24 +268,13 @@
\noindent
}
}{
\end{@app}
\end{@app}
}
% methode
\NewDocumentEnvironment{methode}{ s o }{
\IfBooleanTF {#1} {
% if starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{@met1}
\noindent
}{
% if subtitle
\begin{@met1}[#2]
\noindent
}
}{
% if not starred: without logo
% if starred: without logo and title
\IfNoValueTF {#2} {
% if no subtitle
\begin{@met2}
@ -294,12 +284,23 @@
\begin{@met2}[#2]
\noindent
}
}{
% if not starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{@met1}
\noindent
}{
% if subtitle
\begin{@met1}[#2]
\noindent
}
}
}{
\IfBooleanTF {#1} {
\end{@met1}
}{
\end{@met2}
}{
\end{@met1}
}
}