Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few improvements #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 94 additions & 38 deletions fiches.sty
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@
\renewcommand{\makeheadrule}{%
\makebox[0pt][l]{\rule[-0.4\baselineskip]{\linewidth}{0.8pt}}
}

}
\newcommand{\polytitresave}{}%stockage du titre
\newcommand{\polysoustitresave}{}%stockage du sous-titre
Expand All @@ -207,6 +206,15 @@
\renewcommand*{\date}[1]{
\renewcommand*{\polydatesave}{#1}
}
\newcommand{\logo}[2][]{
\ifthenelse{\equal{#1}{}}{
\renewcommand{\polylogovert}{#2}
\renewcommand{\polylogohori}{#2}
}{
\renewcommand{\polylogovert}{#1}
\renewcommand{\polylogohori}{#2}
}
}

%========
% Definition de la page de titre
Expand Down Expand Up @@ -254,34 +262,55 @@
\newcommand{\expcolor}{grey}%exemple. no symbol. use \defindent
\newcommand{\demcolor}{mauve}\newcommand{\demsymb}{$\square$}%demonstration. no beginning symbol. no indent
\newcommand{\indcolor}{olive}%indication. no symbol. no indent
\newcommand{\hypcolor}{steel}%hypothesis. no symbol. no indentation
\newcommand{\blankcolor}{black}\newcommand{\blanksymb}{}

\if@english
\newcommand{\defintit}{Definition}%definition
\newcommand{\deflistingname}{\defintit}
\newcommand{\pptintit}{Property}%propriete
\newcommand{\pptlistingname}{\pptintit}
\newcommand{\lemintit}{Lemma}%lemme
\newcommand{\lemlistingname}{\lemintit}
\newcommand{\prointit}{Proposition}%proposition
\newcommand{\prolistingname}{\prointit}
\newcommand{\corintit}{Corollary}%corollaire
\newcommand{\corlistingname}{\corintit}
\newcommand{\thmintit}{Theorem}%theoreme
\newcommand{\thmlistingname}{\thmintit}
\newcommand{\fmlintit}{Formula}%formule
\newcommand{\fmllistingname}{\fmlintit}
\newcommand{\metintit}{Method}%methode
\newcommand{\metlistingname}{\metintit}
\newcommand{\expintit}{Example}%exemple
\newcommand{\demintit}{Proof}%demonstration
\newcommand{\indintit}{Indication}%indication
\newcommand{\remintit}{Remark}%remarque
\newcommand{\hypintit}{Hypothesis}%hypothèse
\newcommand{\hyplistingname}{\hypintit}
\else
\newcommand{\defintit}{Définition}%definition
\newcommand{\deflistingname}{la définition}
\newcommand{\pptintit}{Propriété}%propriete
\newcommand{\pptlistingname}{la propriété}
\newcommand{\lemintit}{Lemme}%lemme
\newcommand{\lemlistingname}{le lemme}
\newcommand{\prointit}{Proposition}%proposition
\newcommand{\prolistingname}{la proposition}
\newcommand{\corintit}{Corollaire}%corollaire
\newcommand{\corlistingname}{le corollaire}
\newcommand{\thmintit}{Théorème}%theoreme
\newcommand{\thmlistingname}{le théorème}
\newcommand{\fmlintit}{Formule}%formule
\newcommand{\fmllistingname}{la formule}
\newcommand{\metintit}{Méthode}%methode
\newcommand{\metlistingname}{la méthode}
\newcommand{\expintit}{Exemple}%exemple
\newcommand{\demintit}{Démonstration}%demonstration
\newcommand{\indintit}{Indication}%indication
\newcommand{\indintit}{Hint}%indication
\newcommand{\remintit}{Remarque}%remarque
\newcommand{\hypintit}{Hypothèse}%hypothèse
\newcommand{\hyplistingname}{l'hypothèse}
\fi
\newcommand{\blankintit}{}

Expand All @@ -308,43 +337,43 @@
%========
\newcommand{\vind}{\hspace{0mm}}
\newcommand{\definition}[2][{}]{ %definition
\renewcommand{\thelistingnum}{la définition \lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\textbf{\defintit{} \lelistingnum}}
\hspace{\defindent}\textcolor{\defcolor}{\colorlet{refs}{\defcolor}\makebox[5mm]{\defsymb} \textbf{\defintit{} \lelistingnum} : }
}{
\addcontentsline{toc}{subsubsection}{\vind\textbf{\defintit{} \lelistingnum}~(#2)}
\hspace{\defindent}\textcolor{\defcolor}{\colorlet{refs}{\defcolor}\makebox[5mm]{\defsymb} \textbf{\defintit{} \lelistingnum} [\textit{#2}] : }
}
\renewcommand{\thelistingnum}{\deflistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\textbf{\defintit{} \lelistingnum}}
\hspace{\defindent}\textcolor{\defcolor}{\colorlet{refs}{\defcolor}\makebox[5mm]{\defsymb} \textbf{\defintit{} \lelistingnum} : }
}{
\addcontentsline{toc}{subsubsection}{\vind\textbf{\defintit{} \lelistingnum}~(#2)}
\hspace{\defindent}\textcolor{\defcolor}{\colorlet{refs}{\defcolor}\makebox[5mm]{\defsymb} \textbf{\defintit{} \lelistingnum} [\textit{#2}] : }
}
}
\newcommand{\propriete}[2][{}]{ %propriete
\renewcommand{\thelistingnum}{la propriété \lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\pptintit{} \lelistingnum}
\hspace{\defindent}\textcolor{\pptcolor}{\colorlet{refs}{\pptcolor}\makebox[5mm]{\pptsymb} \textbf{\pptintit{} \lelistingnum} : }
}{
\addcontentsline{toc}{subsubsection}{\vind\pptintit{} \lelistingnum~(#2)}
\hspace{\defindent}\textcolor{\pptcolor}{\colorlet{refs}{\pptcolor}\makebox[5mm]{\pptsymb} \textbf{\pptintit{} \lelistingnum} [\textit{#2}] : }
}
\renewcommand{\thelistingnum}{\pptlistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\pptintit{} \lelistingnum}
\hspace{\defindent}\textcolor{\pptcolor}{\colorlet{refs}{\pptcolor}\makebox[5mm]{\pptsymb} \textbf{\pptintit{} \lelistingnum} : }
}{
\addcontentsline{toc}{subsubsection}{\vind\pptintit{} \lelistingnum~(#2)}
\hspace{\defindent}\textcolor{\pptcolor}{\colorlet{refs}{\pptcolor}\makebox[5mm]{\pptsymb} \textbf{\pptintit{} \lelistingnum} [\textit{#2}] : }
}
}
\newcommand{\lemme}[2][{}]{ %lemme
\renewcommand{\thelistingnum}{le lemme \lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\lemintit{} \lelistingnum}
\hspace{\thmindent}\textcolor{\lemcolor}{\colorlet{refs}{\lemcolor}\makebox[5mm]{\lemsymb} \textbf{\lemintit{} \lelistingnum} -- }
}{
\addcontentsline{toc}{subsubsection}{\vind\lemintit{} \lelistingnum~(#2)}
\hspace{\thmindent}\textcolor{\lemcolor}{\colorlet{refs}{\lemcolor}\makebox[5mm]{\lemsymb} \textbf{\lemintit{} \lelistingnum} [\textit{#2}] -- }
}
\renewcommand{\thelistingnum}{\lemlistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\lemintit{} \lelistingnum}
\hspace{\thmindent}\textcolor{\lemcolor}{\colorlet{refs}{\lemcolor}\makebox[5mm]{\lemsymb} \textbf{\lemintit{} \lelistingnum} -- }
}{
\addcontentsline{toc}{subsubsection}{\vind\lemintit{} \lelistingnum~(#2)}
\hspace{\thmindent}\textcolor{\lemcolor}{\colorlet{refs}{\lemcolor}\makebox[5mm]{\lemsymb} \textbf{\lemintit{} \lelistingnum} [\textit{#2}] -- }
}
}
\newcommand{\proposition}[2][{}]{ %proposition
\renewcommand{\thelistingnum}{la proposition \lelistingnum}
\renewcommand{\thelistingnum}{\prolistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
Expand All @@ -355,7 +384,7 @@
\hspace{\thmindent}\textcolor{\procolor}{\colorlet{refs}{\procolor}\makebox[5mm]{\prosymb} \textbf{\prointit{} \lelistingnum} \ifthenelse{\equal{#2}{}}{}{[\textit{#2}]} -- }
}
\newcommand{\corollaire}[2][{}]{ %corollaire
\renewcommand{\thelistingnum}{le corollaire \lelistingnum}
\renewcommand{\thelistingnum}{\corlistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
Expand All @@ -367,7 +396,7 @@
}
}
\newcommand{\theoreme}[2][{}]{ %theoreme
\renewcommand{\thelistingnum}{le théorème \lelistingnum}
\renewcommand{\thelistingnum}{\thmlistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
Expand All @@ -378,7 +407,7 @@
\hspace{\thmindent}\textcolor{\thmcolor}{\makebox[5mm]{\thmsymb} \colorlet{refs}{\thmcolor}\textbf{\thmintit{} \lelistingnum} \ifthenelse{\equal{#2}{}}{}{[\emph{#2}]} -- }
}
\newcommand{\formule}[2][{}]{ %formule
\renewcommand{\thelistingnum}{la formule \lelistingnum}
\renewcommand{\thelistingnum}{\fmllistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
Expand All @@ -389,7 +418,7 @@
\hspace{\defindent}\textcolor{\fmlcolor}{\makebox[5mm]{\fmlsymb} \colorlet{refs}{\fmlcolor}\textbf{\fmlintit{} \lelistingnum} \ifthenelse{\equal{#2}{}}{}{[\emph{#2}]} : }
}
\newcommand{\methode}[2][{}]{ %methode
\renewcommand{\thelistingnum}{la méthode \lelistingnum}
\renewcommand{\thelistingnum}{\metlistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
Expand All @@ -399,6 +428,18 @@
}
\hspace{\defindent}\textcolor{\metcolor}{\makebox[5mm]{\metsymb} \colorlet{refs}{\metcolor}\textbf{\metintit{} \lelistingnum} \ifthenelse{\equal{#2}{}}{}{[\emph{#2}]} : }
}
\newcommand{\hypothese}[2][{}]{ %hypothese
\renewcommand{\thelistingnum}{\hyplistingname~\lelistingnum}
\refstepcounter{listingnum}
\ifthenelse{\equal{#1}{}}{}{\etiquette{#1}}
\ifthenelse{\equal{#2}{}}{
\addcontentsline{toc}{subsubsection}{\vind\metintit{} \lelistingnum}
}{
\addcontentsline{toc}{subsubsection}{\vind\metintit{} \lelistingnum~(#2)}
}
\textcolor{\hypcolor}{\colorlet{refs}{\hypcolor}\textbf{\hypintit{} \lelistingnum} \ifthenelse{\equal{#2}{}}{}{[\emph{#2}]} : }
}


%========
% Commandes de listing 2
Expand Down Expand Up @@ -430,7 +471,7 @@
\if@facu
\newcommand{\facultatif}[1]{#1}
\else
\newcommand{\facultatif}[1]{
\newcommand{\facultatif}[1]{}
\fi
\if@comm
\newcommand{\comment}[1]{\begin{flushright}\textit{\textcolor{red}{#1}}\end{flushright}}
Expand Down Expand Up @@ -464,3 +505,18 @@
#1{}
\blankitem{#2}
}

%==============
% Allow english names for commands
%==============
\let\property=\propriete
\let\lemma=\lemme
\let\corollary=\corollaire
\let\theorem=\theoreme
\let\formula=\formule
\let\method=\methode
\let\hypothesis=\hypothese
\let\example=\exemple
\let\hint=\indication
\let\remark=\remarque
\let\optional=\facultatif