From c61c8a61c19de450cc1b0fe5010769090a42740b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 11 Aug 2020 03:01:02 +0000 Subject: CTAN sync 202008110301 --- macros/latex/contrib/frpseudocode/README.md | 5 ++ .../contrib/frpseudocode/frpseudocode-example.pdf | Bin 62553 -> 67360 bytes .../contrib/frpseudocode/frpseudocode-example.tex | 28 +++++++++- macros/latex/contrib/frpseudocode/frpseudocode.sty | 60 ++++++++++++++++++--- 4 files changed, 86 insertions(+), 7 deletions(-) (limited to 'macros/latex/contrib/frpseudocode') diff --git a/macros/latex/contrib/frpseudocode/README.md b/macros/latex/contrib/frpseudocode/README.md index 1285a0df1a..0fcdb8ab0a 100644 --- a/macros/latex/contrib/frpseudocode/README.md +++ b/macros/latex/contrib/frpseudocode/README.md @@ -26,3 +26,8 @@ This is a WIP, there might be some unknown issues. You can report these issues b ## License Made under The LaTeX Project Public License 1.3c + +## Changelog + +2020-08-03 : Initial release +2020-08-09 : Changed algorithm title to french diff --git a/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf b/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf index be66949dae..5e5d7995fa 100644 Binary files a/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf and b/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf differ diff --git a/macros/latex/contrib/frpseudocode/frpseudocode-example.tex b/macros/latex/contrib/frpseudocode/frpseudocode-example.tex index de0de6846e..09e8a8c9fb 100644 --- a/macros/latex/contrib/frpseudocode/frpseudocode-example.tex +++ b/macros/latex/contrib/frpseudocode/frpseudocode-example.tex @@ -6,7 +6,7 @@ \begin{algorithm} \caption{Algorithme d'Euclide} \begin{algorithmic}[1] -\Procedure{Euclide}{$a,b$} +\Function{Euclide}{$a, b$} \Comment{PGCD de a et b} \State $r\gets a\bmod b$ \While{$r\not=0$}\Comment{Si r = 0, on a la réponse} @@ -15,6 +15,32 @@ \State $r\gets a\bmod b$ \EndWhile \State \Return $b$\Comment{Le PGCD est b} +\EndFunction +\end{algorithmic} +\end{algorithm} + +\begin{algorithm} +\caption{Démonstration boucle pour} +\begin{algorithmic}[1] +\Procedure{AfficheurMultiple}{$str$} +\Comment{Démo boucle pour} +\State $r\gets a\bmod b$ +\For{$i < 15$} +\State Afficher $str$ \Comment{On affiche la chaîne} +\EndFor +\EndProcedure +\end{algorithmic} +\end{algorithm} + +\begin{algorithm} +\caption{Démonstration boucle pour - 2} +\begin{algorithmic}[1] +\Procedure{AfficheurMultiple}{$str$} +\Comment{Démo boucle pour} +\State $r\gets a\bmod b$ +\ForFT{$i$}{$0$}{$15$} +\State Afficher $str$ \Comment{On affiche la chaîne} +\EndFor \EndProcedure \end{algorithmic} \end{algorithm} diff --git a/macros/latex/contrib/frpseudocode/frpseudocode.sty b/macros/latex/contrib/frpseudocode/frpseudocode.sty index 4ad5dd260d..72b656c25a 100644 --- a/macros/latex/contrib/frpseudocode/frpseudocode.sty +++ b/macros/latex/contrib/frpseudocode/frpseudocode.sty @@ -1,26 +1,74 @@ %% @author Oliver Irwin -%% 2020-08-03 -\ProvidesPackage{frpseudocode}[2020/08/03 French Pseudocode 0.1.1] +%% 2020-08-10 +\ProvidesPackage{frpseudocode}[2020-08-10 French Pseudocode 0.3.0] +\RequirePackage{algpseudocode} + +%% Global mod +\floatname{algorithm}{Algorithme} %% Functions %% \algrenewcommand\algorithmicprocedure{\textbf{procédure}} \algrenewcommand\algorithmicfunction{\textbf{fonction}} \algrenewcommand\algorithmicreturn{\textbf{renvoyer}} +\algrenewtext{Procedure}[2]% +{\algorithmicprocedure\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}\ :} + +\algrenewtext{Function}[2]% +{\algorithmicfunction\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}\ :} + +%% Inputs +\algrenewcommand\algorithmicrequire{\textbf{Requiert : }} +\algrenewcommand\algorithmicensure{\textbf{Vérifier : }} + %% Control Instructions %% \algrenewcommand\algorithmicwhile{\textbf{Tant que}} +\algnewcommand\algorithmicwhilem{\textbf{tant que}} \algrenewcommand\algorithmicdo{\textbf{Faire}} +\algnewcommand\algorithmicdom{\textbf{faire}} \algrenewcommand\algorithmicend{\textbf{Fin}} \algrenewcommand\algorithmicfor{\textbf{Pour}} \algrenewcommand\algorithmicforall{\textbf{Pour tout}} -\algnewcommand\algorithmicfrom{\textbf{de}} +\algnewcommand\algorithmicfrom{\textbf{de }} \algnewcommand\algorithmicto{\textbf{à}} +\algnewcommand\algorithmicform{\textbf{pour}} + +\algrenewcommand\algorithmicrepeat{\textbf{Répéter}} +\algrenewcommand\algorithmicuntil{\textbf{Jusqu'à}} + +\algdef{SE}[FORFT]{ForFT}{EndFor}[3]{}% + +%% Change commands +\algrenewtext{ForFT}[3]% +{\algorithmicfor\ #1 \algorithmicfrom #2 \algorithmicto\ #3,\ \algorithmicdom\ :} -\algrenewtext{For}[3]% -{\algorithmicfor\ #1 \algorithmicfrom #2 \algorithmicto\ #3 \algorithmicdo} +\algrenewtext{For}[1]% +{\algorithmicfor\ #1,\ \algorithmicdom\ :} + +\algrenewtext{EndFor}[0]% +{\algorithmicend\ \algorithmicform} + +\algrenewtext{While}[1]% +{\algorithmicwhile\ #1,\ \algorithmicdom\ :} + +\algrenewtext{EndWhile}[0]% +{\algorithmicend\ \algorithmicwhilem} %% Conditionnals %% \algrenewcommand\algorithmicif{\textbf{Si}} +\algnewcommand\algorithmicifm{\textbf{si}} \algrenewcommand\algorithmicelse{\textbf{Sinon}} -\algrenewcommand\algorithmicthen{\textbf{Alors}} +\algrenewcommand\algorithmicthen{\textbf{alors}} +\newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif} + +\algrenewtext{ElsIf}[1]% +{\algorithmicelse ,\ \algorithmicifm\ #1} + +\algrenewtext{EndIf}[0]% +{\algorithmicend\ \algorithmicifm} + +%% Logical +%\algrenewcommand{\algorithmicnot}{\textbf{non}} +%\algrenewcommand{\algorithmicand}{\textbf{et}} +%\algrenewcommand{\algorithmicor}{\textbf{ou}} \ No newline at end of file -- cgit v1.2.3