summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/frpseudocode
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-06 03:02:06 +0000
committerNorbert Preining <norbert@preining.info>2020-08-06 03:02:06 +0000
commitd99fea72e367e8d4d2809b43b3b0206b1bb526b8 (patch)
tree4ff41aa9059b698160184e26c89a845c859c8ef7 /macros/latex/contrib/frpseudocode
parent7731c3718462625785ef5c34fd2a38d6ea4f60a7 (diff)
CTAN sync 202008060302
Diffstat (limited to 'macros/latex/contrib/frpseudocode')
-rw-r--r--macros/latex/contrib/frpseudocode/README.md28
-rw-r--r--macros/latex/contrib/frpseudocode/frpseudocode-example.pdfbin0 -> 62553 bytes
-rw-r--r--macros/latex/contrib/frpseudocode/frpseudocode-example.tex22
-rw-r--r--macros/latex/contrib/frpseudocode/frpseudocode.sty26
4 files changed, 76 insertions, 0 deletions
diff --git a/macros/latex/contrib/frpseudocode/README.md b/macros/latex/contrib/frpseudocode/README.md
new file mode 100644
index 0000000000..1285a0df1a
--- /dev/null
+++ b/macros/latex/contrib/frpseudocode/README.md
@@ -0,0 +1,28 @@
+# French Translation for algorithmics pseudocode
+
+Small package to help with french translation for pseudocode.
+
+## Context
+
+This package is intended for use alongside Szász János' [algorithmicx](https://www.ctan.org/pkg/algorithmicx "algorithm writing package") package.
+
+The aim of this package is to provide a french translation of terms and words used in algorithms to make it integrate seamlessly in a french written document.
+
+## Use
+
+To use this package, simply import it as usual then use the same commands you would use with algorithmicx.
+
+The packahe will then translate at compilation time the terms of the algorithm to french language.
+
+An example of use is included in file `frpseudocode-example.tex`, along a PDF output of that file.
+
+
+## Warning
+
+This is a WIP, there might be some unknown issues. You can report these issues by email at :
+<oliver.irwin@pm.me>
+
+
+## License
+
+Made under The LaTeX Project Public License 1.3c
diff --git a/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf b/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf
new file mode 100644
index 0000000000..be66949dae
--- /dev/null
+++ b/macros/latex/contrib/frpseudocode/frpseudocode-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/frpseudocode/frpseudocode-example.tex b/macros/latex/contrib/frpseudocode/frpseudocode-example.tex
new file mode 100644
index 0000000000..de0de6846e
--- /dev/null
+++ b/macros/latex/contrib/frpseudocode/frpseudocode-example.tex
@@ -0,0 +1,22 @@
+\documentclass[a4paper]{article}
+\usepackage{algorithm}
+\usepackage{algpseudocode}
+\usepackage{frpseudocode}
+\begin{document}
+\begin{algorithm}
+\caption{Algorithme d'Euclide}
+\begin{algorithmic}[1]
+\Procedure{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}
+\State $a\gets b$
+\State $b\gets r$
+\State $r\gets a\bmod b$
+\EndWhile
+\State \Return $b$\Comment{Le PGCD est b}
+\EndProcedure
+\end{algorithmic}
+\end{algorithm}
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/frpseudocode/frpseudocode.sty b/macros/latex/contrib/frpseudocode/frpseudocode.sty
new file mode 100644
index 0000000000..4ad5dd260d
--- /dev/null
+++ b/macros/latex/contrib/frpseudocode/frpseudocode.sty
@@ -0,0 +1,26 @@
+%% @author Oliver Irwin
+%% 2020-08-03
+\ProvidesPackage{frpseudocode}[2020/08/03 French Pseudocode 0.1.1]
+
+%% Functions %%
+\algrenewcommand\algorithmicprocedure{\textbf{procédure}}
+\algrenewcommand\algorithmicfunction{\textbf{fonction}}
+\algrenewcommand\algorithmicreturn{\textbf{renvoyer}}
+
+%% Control Instructions %%
+\algrenewcommand\algorithmicwhile{\textbf{Tant que}}
+\algrenewcommand\algorithmicdo{\textbf{Faire}}
+\algrenewcommand\algorithmicend{\textbf{Fin}}
+\algrenewcommand\algorithmicfor{\textbf{Pour}}
+\algrenewcommand\algorithmicforall{\textbf{Pour tout}}
+\algnewcommand\algorithmicfrom{\textbf{de}}
+\algnewcommand\algorithmicto{\textbf{à}}
+
+\algrenewtext{For}[3]%
+{\algorithmicfor\ #1 \algorithmicfrom #2 \algorithmicto\ #3 \algorithmicdo}
+
+%% Conditionnals %%
+
+\algrenewcommand\algorithmicif{\textbf{Si}}
+\algrenewcommand\algorithmicelse{\textbf{Sinon}}
+\algrenewcommand\algorithmicthen{\textbf{Alors}}