Clean code an correct method env

This commit is contained in:
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 %% definition
%% %%
\RenewDocumentEnvironment{definition}{ s o }{ \RenewDocumentEnvironment{definition}{ s D<>{Définition} o }{
\setbeamercolor*{block title}{parent=definition} \setbeamercolor*{block title}{parent=definition}
\IfBooleanTF {#1} { \IfBooleanTF {#1} {
% if starred: with logo % if starred: with logo
\IfNoValueTF {#2} { \IfNoValueTF {#3} {
% if no subtitle % if no subtitle
\begin{block} {\faPencil \hspace{.125em}\ Définition} \begin{block} {\faPencil \hspace{.125em}\ #2}
}{ }{
% if subtitle % if subtitle
\begin{block} {\faPencil \hspace{.125em}\ \begin{block} {\faPencil \hspace{.125em}\
Définition \hfill{\normalfont\slshape#2}} #2 \hfill{\normalfont\slshape#3}}
} }
}{ }{
% if not starred: without logo % if not starred: without logo
\IfNoValueTF {#2} { \IfNoValueTF {#3} {
% if no subtitle % if no subtitle
\begin{block} {Définition} \begin{block} {#2}
}{ }{
% if subtitle % 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} { \IfNoValueTF {#1} {
% if no subtitle % if no subtitle
\begin{@com} \begin{@com}
% \vspace{-.5cm}
\noindent \noindent
}{ }{
% if subtitle % if subtitle
@@ -182,7 +183,7 @@
\noindent \noindent
} }
}{ }{
\end{@com} \end{@com}
} }
% remarque % remarque
@@ -257,7 +258,7 @@
% application % application
\NewDocumentEnvironment{application}{ o }{ \NewDocumentEnvironment{application}{ o }{
\IfNoValueTF {#1} { \IfNoValueTF {#1} {
% if no subtitle % if no subtitle
\begin{@app} \begin{@app}
\noindent \noindent
@@ -267,24 +268,13 @@
\noindent \noindent
} }
}{ }{
\end{@app} \end{@app}
} }
% methode % methode
\NewDocumentEnvironment{methode}{ s o }{ \NewDocumentEnvironment{methode}{ s o }{
\IfBooleanTF {#1} { \IfBooleanTF {#1} {
% if starred: with logo % if starred: without logo and title
\IfNoValueTF {#2} {
% if no subtitle
\begin{@met1}
\noindent
}{
% if subtitle
\begin{@met1}[#2]
\noindent
}
}{
% if not starred: without logo
\IfNoValueTF {#2} { \IfNoValueTF {#2} {
% if no subtitle % if no subtitle
\begin{@met2} \begin{@met2}
@@ -294,12 +284,23 @@
\begin{@met2}[#2] \begin{@met2}[#2]
\noindent \noindent
} }
}{
% if not starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{@met1}
\noindent
}{
% if subtitle
\begin{@met1}[#2]
\noindent
}
} }
}{ }{
\IfBooleanTF {#1} { \IfBooleanTF {#1} {
\end{@met1}
}{
\end{@met2} \end{@met2}
}{
\end{@met1}
} }
} }