From 974880a380437f9dc46954165b0bfe9d2f0b3878 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Wed, 24 Jan 2024 16:37:01 +0000
Subject: [PATCH 01/22] fix(docs): unicode characters in latex

Refs #656
---
 docs/en/calculators/structures/liste.md | 14 +++++++-------
 docs/fr/calculators/structures/liste.md | 16 ++++++++--------
 docs/latex/cassiopee_doc_en.tex         | 16 ++++++++++++++++
 3 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/docs/en/calculators/structures/liste.md b/docs/en/calculators/structures/liste.md
index 427be1e3f..a31432a13 100644
--- a/docs/en/calculators/structures/liste.md
+++ b/docs/en/calculators/structures/liste.md
@@ -5,7 +5,7 @@
 | Weir                                                  | Rectangular          | Sharp-crested weir (notch)               | Free             | [Poleni](./seuil_denoye.md)                 | 0.4                       | Parallel structures, free flow weir stage-discharge laws                        |
 |                                                       |                      | Sharp-crested weir (slot)                | Submerged        | [Rajaratnam](./seuil_noye.md)               | 0.9                       | Parallel structures                                                             |
 |                                                       |                      | Sharp-crested weir (slot)                | Submerged        | [Larinier slot](./fente_noyee.md)           | to be defined by designer | Parallel structures, cross walls, downwall                                      |
-|                                                       |                      | Sharp-crested weir (notch)               | Submerged / free | [Kindsvater-Carter & Villemonte](./kivi.md) | ⍺ = 0.4; ß = 0.001        | Parallel structures                                                             |
+|                                                       |                      | Sharp-crested weir (notch)               | Submerged / free | [Kindsvater-Carter & Villemonte](./kivi.md) | α = 0.4; ß = 0.001        | Parallel structures                                                             |
 |                                                       |                      | Sharp-crested weir (notch)               | Submerged / free | [Villemonte](./villemonte_1947.md)          | 0.4                       | Parallel structures, cross walls, downwall                                      |
 |                                                       |                      | Sharp-crested regulated weir (notch)     | Submerged / free | [Villemonte](./villemonte_1947.md)          | 0.4                       | Downwall                                                                        |
 |                                                       |                      | Sharp-crested regulated weir (slot)      | Submerged        | [Larinier slot](./fente_noyee.md)           | To be defined by designer | Downwall                                                                        |
@@ -26,15 +26,15 @@ Table: Stage-discharge equations list
 
 Extract from CETMEF, 2005. Note on weirs : synthesis of flow laws at the right of weirs and spillways. Centre d'Études Techniques Maritimes Et Fluviales, Compiègne.
 
-> The type of weir is related to the flow at the right of the structure. 
-> 
-> Indeed, the more the breadth of the crest of the weir is negligible compared to the upstream water height above it, the more the weir appears transparent to the flow and thus the sharper the crest of the weir appears. 
+> The type of weir is related to the flow at the right of the structure.
 >
-> On the other hand, the closer the upstream water line is to the weir crest, the greater the width of the weir appears in relation to the breadth of the water flowing over it and therefore the broader the weir crest appears. 
-> A weir in a river thus belongs to one of the three following categories: 
+> Indeed, the more the breadth of the crest of the weir is negligible compared to the upstream water height above it, the more the weir appears transparent to the flow and thus the sharper the crest of the weir appears.
+>
+> On the other hand, the closer the upstream water line is to the weir crest, the greater the width of the weir appears in relation to the breadth of the water flowing over it and therefore the broader the weir crest appears.
+> A weir in a river thus belongs to one of the three following categories:
 > - sharp-crested weir
 > - broad-crested weir
-> - weir with undefined crest 
+> - weir with undefined crest
 >
 > In order to determine the type of weir studied, the following conditions must be verified:
 > - if $C < \frac{H_1}{2}$, then the threshold is sharp-crested;
diff --git a/docs/fr/calculators/structures/liste.md b/docs/fr/calculators/structures/liste.md
index c0c942d4d..125242c45 100644
--- a/docs/fr/calculators/structures/liste.md
+++ b/docs/fr/calculators/structures/liste.md
@@ -5,7 +5,7 @@
 | Seuil déversant à surface libre                             | Rectangulaire          | Seuil mince (échancrure)                 | Dénoyé               | [Poleni](./seuil_denoye.md)    | 0,4                     | Lois d'ouvrages, lois déversoirs dénoyés                          |
 |                                                             |                        | Seuil mince (fente)                      | Noyé                 | [Rajaratnam](./seuil_noye.md)  | 0,9                     | Lois d'ouvrages                                                   |
 |                                                             |                        | Seuil mince (fente)                      | Noyé                 | [Fente Larinier](./fente_noyee.md) | à définir par projeteur | Lois d'ouvrages, cloisons, cloison aval                           |
-|                                                             |                        | Seuil mince (échancrure)                 | Noyé / dénoyé        | [Kindsvater-Carter & Villemonte](./kivi.md) | ⍺ = 0.4 ; ß = 0.001     | Lois d'ouvrages                                                   |
+|                                                             |                        | Seuil mince (échancrure)                 | Noyé / dénoyé        | [Kindsvater-Carter & Villemonte](./kivi.md) | α = 0.4 ; ß = 0.001     | Lois d'ouvrages                                                   |
 |                                                             |                        | Seuil mince (échancrure)                 | Noyé / dénoyé        | [Villemonte](./villemonte_1947.md) | 0,4                     | Lois d'ouvrages, cloisons, cloison aval                           |
 |                                                             |                        | Seuil mince régulé (échancrure)          | Noyé / dénoyé        | [Villemonte](./villemonte_1947.md)    | 0,4                     | Cloison aval                                                      |
 |                                                             |                        | Seuil mince régulé (fente)               | Noyé                 | [Fente Larinier](./fente_noyee.md)    | à définir par projeteur | Cloison aval                                                      |
@@ -18,7 +18,7 @@
 | Vannes / orifices en charge                                 | Rectangulaire          | Vanne de fond                            | Dénoyé               | [Vanne de fond dénoyée (Bernoulli)](./vanne_denoyee.md) | 0,6                     | Lois d'ouvrages                                                   |
 |                                                             | Rectangulaire          | Vanne de fond                            | Noyé                 | [Vanne de fond noyée](./vanne_noyee.md) | 0,8                     | Lois d'ouvrages                                                   |
 |                                                             | Indéfini               | Orifice  | Dénoyé               | [Orifice dénoyé (Bernoulli)](./orifice_denoye.md)     | 0,7                     | Lois d'ouvrages                                                   |
-|                                                             | Indéfini               | Orifice                                  | Noyé                 | [Orifice noyé (Bernoulli)](./orifice_noye.md)       | 0,7                     | Lois d'ouvrages, cloisons, cloison aval  
+|                                                             | Indéfini               | Orifice                                  | Noyé                 | [Orifice noyé (Bernoulli)](./orifice_noye.md)       | 0,7                     | Lois d'ouvrages, cloisons, cloison aval
 
 Table: Liste des équations d'ouvrages
 
@@ -26,15 +26,15 @@ Table: Liste des équations d'ouvrages
 
 Extrait de CETMEF, 2005. Notice sur les déversoirs : synthèse des lois d’écoulement au droit des seuils et déversoirs. Centre d’Études Techniques Maritimes Et Fluviales, Compiègne.
 
-> Le type de seuil est relatif à l’écoulement au droit de l’ouvrage. 
-> 
-> En effet, plus l’épaisseur de la crête du seuil est négligeable devant la hauteur d’eau amont au-dessus de celui-ci, plus le seuil paraît transparent vis-à-vis de l’écoulement et donc plus la crête du seuil paraît mince. 
+> Le type de seuil est relatif à l’écoulement au droit de l’ouvrage.
 >
-> A l’inverse, plus la ligne d’eau amont se rapproche de la crête du seuil, plus la largeur du seuil paraît grande vis-à-vis de l’épaisseur de la lame d’eau qui y transite et donc plus la crête du seuil paraît épaisse. 
-> Un déversoir en rivière appartient ainsi à l’une des trois catégories suivantes : 
+> En effet, plus l’épaisseur de la crête du seuil est négligeable devant la hauteur d’eau amont au-dessus de celui-ci, plus le seuil paraît transparent vis-à-vis de l’écoulement et donc plus la crête du seuil paraît mince.
+>
+> A l’inverse, plus la ligne d’eau amont se rapproche de la crête du seuil, plus la largeur du seuil paraît grande vis-à-vis de l’épaisseur de la lame d’eau qui y transite et donc plus la crête du seuil paraît épaisse.
+> Un déversoir en rivière appartient ainsi à l’une des trois catégories suivantes :
 > - seuil à crête mince
 > - seuil à crête épaisse
-> - seuil à crête non définie 
+> - seuil à crête non définie
 >
 > Afin de déterminer le type de seuil étudié, les conditions suivantes doivent être vérifiées :
 > - si $C < \frac{H_1}{2}$, alors le seuil est à crête mince ;
diff --git a/docs/latex/cassiopee_doc_en.tex b/docs/latex/cassiopee_doc_en.tex
index 5403656ec..94ae4c2a2 100644
--- a/docs/latex/cassiopee_doc_en.tex
+++ b/docs/latex/cassiopee_doc_en.tex
@@ -86,6 +86,22 @@
 
 %*******************************************************************************
 
+% degree also in math mode https://tex.stackexchange.com/a/84471
+\usepackage{gensymb}
+\DeclareUnicodeCharacter{00B0}{\degree}
+% Other unicode characters
+\usepackage{newunicodechar}
+\newunicodechar{α}{\ensuremath{\alpha}}
+\newunicodechar{α}{\ensuremath{\alpha}}
+\newunicodechar{β}{\ensuremath{\beta}}
+\newunicodechar{μ}{\ensuremath{\mu}}
+\newunicodechar{Δ}{\ensuremath{\Delta}}
+\newunicodechar{☰}{\ensuremath{\equiv}}
+\newunicodechar{≈}{\ensuremath{\approx}}
+\newunicodechar{ϵ}{\ensuremath{\in}}
+\newunicodechar{↵}{\ensuremath{\hookleftarrow}}
+\newunicodechar{≤}{\ensuremath{\leq}}
+
 \begin{document}
 %Supprime les veuves et orphelines
 \widowpenalty=10000
-- 
GitLab


From c6ebb5b4b611423cf0648371082544786a817e2f Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Wed, 24 Jan 2024 16:37:27 +0000
Subject: [PATCH 02/22] docs: remove superfluous doc

Refs #656
---
 docs/en/calculators/hyd_en_charge/lechapt-calmon.md | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/docs/en/calculators/hyd_en_charge/lechapt-calmon.md b/docs/en/calculators/hyd_en_charge/lechapt-calmon.md
index ba97396cb..43c88ff2d 100644
--- a/docs/en/calculators/hyd_en_charge/lechapt-calmon.md
+++ b/docs/en/calculators/hyd_en_charge/lechapt-calmon.md
@@ -44,16 +44,3 @@ The correlation table of the coefficients is as follows:
 | Hydraulically smooth pipe - 0.25 &le; D &le; 1 | 0.00 | 0.971 | 1.81 | 4.81 |
 
 Table: Materials and coefficients used in the Lechapt and Calmon formula
-
-## Singular head loss
-
-$$ J_S = K_S \frac{V^2}{2g}$$
-
-With:
-
-- \(K_S\)&nbsp;: singular head loss coefficient
-- \(V\)&nbsp;: water speed in the pipe (\(V = 4 Q / \pi / D^2\))
-
-## Darcy's head loss coefficient
-
-$$ f_D = \frac{2g J D}{l_T V^2}
-- 
GitLab


From 0e257b3e9a7561344e9ea136637651e1b5ec40bd Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Wed, 24 Jan 2024 16:38:21 +0000
Subject: [PATCH 03/22] fix(docs): malformed itemize in latex

Refs #656
---
 docs/en/calculators/structures/kivi.md | 1 +
 docs/fr/calculators/structures/kivi.md | 1 +
 2 files changed, 2 insertions(+)

diff --git a/docs/en/calculators/structures/kivi.md b/docs/en/calculators/structures/kivi.md
index 5e18dea59..5e32fc83e 100644
--- a/docs/en/calculators/structures/kivi.md
+++ b/docs/en/calculators/structures/kivi.md
@@ -39,6 +39,7 @@ Villemonte proposes the following formula:
 $$K = \frac{Q_{submerged}}{Q_{free}} = \left [ 1- \left ( \frac{h2}{h1} \right)^n \right]^{0.385}$$
 
 With:
+
 - \(h_1\) the upstream water level above the weir crest
 - \(h_2\) the downstream water level above the weir crest
 - \(n\) the exponent in free flow relationships (rectangular=1.5, triangular=2.5, parabolic=2)
diff --git a/docs/fr/calculators/structures/kivi.md b/docs/fr/calculators/structures/kivi.md
index 362200179..632215205 100644
--- a/docs/fr/calculators/structures/kivi.md
+++ b/docs/fr/calculators/structures/kivi.md
@@ -39,6 +39,7 @@ Villemonte propose la formule suivante&nbsp;:
 $$K = \frac{Q_{noyé}}{Q_{dénoyé}} = \left [ 1- \left ( \frac{h2}{h1} \right)^n \right]^{0.385}$$
 
 Avec&nbsp;:
+
 - \(h_1\)la hauteur d'eau amont au dessus de la crête du déversoir
 - \(h_2\)la hauteur d'eau aval au dessus de la crête du déversoir
 - \(n\)l'exposant dans les relations d'écoulement dénoyé (rectangulaire=1.5, triangulaire=2.5, parabolique=2)
-- 
GitLab


From fd315ca175ead68effc798b284ee43001d446b50 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Wed, 24 Jan 2024 16:40:05 +0000
Subject: [PATCH 04/22] fix(docs): malformed formulas in latex

Refs #656
---
 docs/en/calculators/structures/cem_88_d.md | 5 ++---
 docs/fr/calculators/structures/cem_88_d.md | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/docs/en/calculators/structures/cem_88_d.md b/docs/en/calculators/structures/cem_88_d.md
index 1937778a3..84de84900 100644
--- a/docs/en/calculators/structures/cem_88_d.md
+++ b/docs/en/calculators/structures/cem_88_d.md
@@ -12,7 +12,7 @@ Classical formulation of the free flow weir (\(\mu_F \simeq 0.4\)).
 ## Weir - submerged flow
 (\(h_1 < W\) and \(h_2 \geq \frac{2}{3} h_1\))
 
-\(Q = \mu_S L \sqrt{2g} (h_1-h_2)^{1/2} h_2\)
+$$Q = \mu_S L \sqrt{2g} (h_1-h_2)^{1/2} h_2$$
 
 Classical formulation of the submerged weir.
 
@@ -51,8 +51,7 @@ There are two formulations depending on whether the orifice is partially submerg
 ### Totally submerged flow
 (\(h_1 \geq W\) and \(\frac{2}{3} h_1 + \frac{W}{3} < h_2\))
 
-\(Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} \left[ h_2 - (h_2 - W) \right]
-\Rightarrow Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} W\)
+$$Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} \left[ h_2 - (h_2 - W) \right] \Rightarrow Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} W$$
 
 Classical formulation of submerged orifices, with \(\mu' = \mu_S\).
 
diff --git a/docs/fr/calculators/structures/cem_88_d.md b/docs/fr/calculators/structures/cem_88_d.md
index 9d5d6fdf4..8f40ee292 100644
--- a/docs/fr/calculators/structures/cem_88_d.md
+++ b/docs/fr/calculators/structures/cem_88_d.md
@@ -12,7 +12,7 @@ Formulation classique du déversoir dénoyé (\(\mu_F \simeq 0.4\)).
 ## Déversoir - régime noyé
 (\(h_1 < W\) et \(h_2 \geq \frac{2}{3} h_1\))
 
-\(Q = \mu_S L \sqrt{2g} (h_1-h_2)^{1/2} h_2\)
+$$Q = \mu_S L \sqrt{2g} (h_1-h_2)^{1/2} h_2$$
 
 Formulation classique du déversoir noyé.
 
@@ -51,8 +51,7 @@ Il existe deux formulations suivant que l’on est partiellement noyé ou totale
 ### Régime totalement noyé
 (\(h_1 \geq W\) et \(\frac{2}{3} h_1 + \frac{W}{3} < h_2\))
 
-\(Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} \left[ h_2 - (h_2 - W) \right]
-\Rightarrow Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} W\)
+$$Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} \left[ h_2 - (h_2 - W) \right] \Rightarrow Q = \mu' L \sqrt{2g} (h_1-h_2)^{1/2} W$$
 
 Formulation classique des orifices noyés, avec \(\mu' = \mu_S\).
 
-- 
GitLab


From e2aabfd32c6ff2acf6e0124d45158b980360f342 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 11:04:06 +0000
Subject: [PATCH 05/22] fix(docs): missing part in latex

Due to malfunction of internal link removal

Refs #656
---
 scripts/mkdocs2pdf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index 54012b0e5..a51bfd25e 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -226,7 +226,7 @@ def buildDocForLang(lang):
     mergedDocFilename = mergedDocFilenamePrefix + lang
     mergedDocOutputPath = os.path.join(pdfBuildDir, mergedDocFilename)
     # remove internal links @TODO convert them to hyperref ?
-    s = re.sub(r'\[([^/]+)\]\([^ ]+\.md\)', r'\1', s)
+    s = re.sub(r'\[([^/\^]+?)\]?\([^ ]+?\.md\)', r'\1', s)
     with open('{}.md'.format(mergedDocOutputPath), 'w') as f:
         f.writelines(s)
 
-- 
GitLab


From abaf60098b1004bcb4ebe642afe4efa86c518ff3 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 11:07:11 +0000
Subject: [PATCH 06/22] clean(docs): warning in Latex

LaTeX Warning: `!h' float specifier changed to `!ht'

Refs #656
---
 scripts/mkdocs2pdf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index a51bfd25e..ba327d013 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -141,7 +141,7 @@ def convertMdToTex(filePath):
         # adjust images max width/height
         l = l.replace('\\includegraphics', '\\includegraphics[max size={\\textwidth}{0.9\\textheight}]')
         # force figures placement
-        l = l.replace('\\begin{figure}', '\\begin{figure}[h!]')
+        l = l.replace('\\begin{figure}', '\\begin{figure}[ht!]')
         # make som subsubsections invisible (for CHANGELOG)
         l = re.sub(r'(\\subsubsection)({[0-9]+.[0-9]+.[0-9]+)', r'\1*\2', l)
         ls[i] = l
-- 
GitLab


From 11b3bf12ccf22068d2b4cd1843ac9eccb6dc977a Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 11:24:21 +0000
Subject: [PATCH 07/22] refactor(docs): factoring latex preamble into a single
 source

Refs #656
---
 docs/latex/cassiopee_doc_en.tex   | 78 ++-----------------------------
 docs/latex/cassiopee_doc_fr.tex   | 62 ++----------------------
 docs/latex/cassiopee_preamble.tex | 76 ++++++++++++++++++++++++++++++
 scripts/mkdocs2pdf.py             |  5 +-
 4 files changed, 84 insertions(+), 137 deletions(-)
 create mode 100644 docs/latex/cassiopee_preamble.tex

diff --git a/docs/latex/cassiopee_doc_en.tex b/docs/latex/cassiopee_doc_en.tex
index 94ae4c2a2..0b7095d1f 100644
--- a/docs/latex/cassiopee_doc_en.tex
+++ b/docs/latex/cassiopee_doc_en.tex
@@ -42,82 +42,10 @@
 \newcommand{\website}{\url{www.g-eau.fr}\\\url{www.inrae.fr}}
 
 
-% ******************* FOR PANDOC V2+ *************************
-
-\usepackage{fancyvrb}
-\newcommand{\VerbBar}{|}
-\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
-\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
-% Add ',fontsize=\small' for more characters per line
-\newenvironment{Shaded}{}{}
-\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
-\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
-\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
-\newcommand{\BuiltInTok}[1]{#1}
-\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
-\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
-\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
-\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
-\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
-\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
-\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
-\newcommand{\ExtensionTok}[1]{#1}
-\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
-\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
-\newcommand{\ImportTok}[1]{#1}
-\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
-\newcommand{\NormalTok}[1]{#1}
-\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
-\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
-\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
-\newcommand{\RegionMarkerTok}[1]{#1}
-\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
-\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
-\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-% https://github.com/jgm/pandoc-templates/blob/bc7a16b590122a2dc99d1f17f222b72152acc1e7/default.latex#L310
-\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
-
 %*******************************************************************************
-
-% degree also in math mode https://tex.stackexchange.com/a/84471
-\usepackage{gensymb}
-\DeclareUnicodeCharacter{00B0}{\degree}
-% Other unicode characters
-\usepackage{newunicodechar}
-\newunicodechar{α}{\ensuremath{\alpha}}
-\newunicodechar{α}{\ensuremath{\alpha}}
-\newunicodechar{β}{\ensuremath{\beta}}
-\newunicodechar{μ}{\ensuremath{\mu}}
-\newunicodechar{Δ}{\ensuremath{\Delta}}
-\newunicodechar{☰}{\ensuremath{\equiv}}
-\newunicodechar{≈}{\ensuremath{\approx}}
-\newunicodechar{ϵ}{\ensuremath{\in}}
-\newunicodechar{↵}{\ensuremath{\hookleftarrow}}
-\newunicodechar{≤}{\ensuremath{\leq}}
-
-\begin{document}
-%Supprime les veuves et orphelines
-\widowpenalty=10000
-\clubpenalty=10000
-\raggedbottom
-
-% Integre la page de garde
-%\input{title.tex}
-\input{rapport_inrae/cover_inrae}
-\input{rapport/headfoot_content}
-
-\cleardoublepage
-
-% Table des matières
-\cleardoublepage
-\tableofcontents
+% Preamble common for all languages
+%*******************************************************************************
+\input{cassiopee_preamble.tex}
 
 
 %*******************************************************************************
diff --git a/docs/latex/cassiopee_doc_fr.tex b/docs/latex/cassiopee_doc_fr.tex
index 49e0bed8f..2c4c95990 100644
--- a/docs/latex/cassiopee_doc_fr.tex
+++ b/docs/latex/cassiopee_doc_fr.tex
@@ -42,66 +42,10 @@
 \newcommand{\website}{\url{www.g-eau.fr}\\\url{www.inrae.fr}}
 
 
-% ******************* FOR PANDOC V2+ *************************
-
-\usepackage{fancyvrb}
-\newcommand{\VerbBar}{|}
-\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
-\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
-% Add ',fontsize=\small' for more characters per line
-\newenvironment{Shaded}{}{}
-\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
-\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
-\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
-\newcommand{\BuiltInTok}[1]{#1}
-\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
-\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
-\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
-\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
-\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
-\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
-\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
-\newcommand{\ExtensionTok}[1]{#1}
-\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
-\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
-\newcommand{\ImportTok}[1]{#1}
-\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
-\newcommand{\NormalTok}[1]{#1}
-\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
-\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
-\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
-\newcommand{\RegionMarkerTok}[1]{#1}
-\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
-\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
-\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
-\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
-% https://github.com/jgm/pandoc-templates/blob/bc7a16b590122a2dc99d1f17f222b72152acc1e7/default.latex#L310
-\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
-
 %*******************************************************************************
-
-\begin{document}
-%Supprime les veuves et orphelines
-\widowpenalty=10000
-\clubpenalty=10000
-\raggedbottom
-
-% Integre la page de garde
-%\input{title.tex}
-\input{rapport_inrae/cover_inrae}
-\input{rapport/headfoot_content}
-
-\cleardoublepage
-
-% Table des matières
-\cleardoublepage
-\tableofcontents
+% Preamble common for all languages
+%*******************************************************************************
+\input{cassiopee_preamble.tex}
 
 
 %*******************************************************************************
diff --git a/docs/latex/cassiopee_preamble.tex b/docs/latex/cassiopee_preamble.tex
new file mode 100644
index 000000000..dc914bc2d
--- /dev/null
+++ b/docs/latex/cassiopee_preamble.tex
@@ -0,0 +1,76 @@
+% ******************* FOR PANDOC V2+ *************************
+
+\usepackage{fancyvrb}
+\newcommand{\VerbBar}{|}
+\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
+\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
+% Add ',fontsize=\small' for more characters per line
+\newenvironment{Shaded}{}{}
+\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
+\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
+\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
+\newcommand{\BuiltInTok}[1]{#1}
+\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
+\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
+\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
+\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
+\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
+\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
+\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
+\newcommand{\ExtensionTok}[1]{#1}
+\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
+\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
+\newcommand{\ImportTok}[1]{#1}
+\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
+\newcommand{\NormalTok}[1]{#1}
+\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
+\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
+\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
+\newcommand{\RegionMarkerTok}[1]{#1}
+\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
+\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
+\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+% https://github.com/jgm/pandoc-templates/blob/bc7a16b590122a2dc99d1f17f222b72152acc1e7/default.latex#L310
+\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
+%*******************************************************************************
+
+% degree also in math mode https://tex.stackexchange.com/a/84471
+\usepackage{gensymb}
+\DeclareUnicodeCharacter{00B0}{\degree}
+% Other unicode characters
+\usepackage{newunicodechar}
+\newunicodechar{α}{\ensuremath{\alpha}}
+\newunicodechar{α}{\ensuremath{\alpha}}
+\newunicodechar{β}{\ensuremath{\beta}}
+\newunicodechar{μ}{\ensuremath{\mu}}
+\newunicodechar{Δ}{\ensuremath{\Delta}}
+\newunicodechar{☰}{\ensuremath{\equiv}}
+\newunicodechar{≈}{\ensuremath{\approx}}
+\newunicodechar{ϵ}{\ensuremath{\in}}
+\newunicodechar{↵}{\ensuremath{\hookleftarrow}}
+\newunicodechar{≤}{\ensuremath{\leq}}
+
+\begin{document}
+%Supprime les veuves et orphelines
+\widowpenalty=10000
+\clubpenalty=10000
+\raggedbottom
+
+% Integre la page de garde
+%\input{title.tex}
+\input{rapport_inrae/cover_inrae}
+\input{rapport/headfoot_content}
+
+\cleardoublepage
+
+% Table des matières
+\cleardoublepage
+\tableofcontents
diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index ba327d013..ffe468e5d 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -174,9 +174,8 @@ def injectContentIntoModel(mergedDocFilenameTex, lang):
     os.chdir(modelDir)
     relPathToMergedTexDoc = os.path.join('..', mergedDocFilenameTex)
     createLink(relPathToMergedTexDoc)
-    latexTemplate = filenamePrefix + lang + '.tex'
-    relPathToLatexTemplate = os.path.join(latexSourceDir, latexTemplate)
-    createLink(relPathToLatexTemplate)
+    createLink(os.path.join(latexSourceDir, filenamePrefix + lang + '.tex'))
+    createLink(os.path.join(latexSourceDir, "cassiopee_preamble.tex"))
     createLink(os.path.join(latexSourceDir, 'logo_pole.png'))
     createLink('{}/schema_rugosite_fond.png'.format(os.path.join(baseDir, 'docs', lang, 'calculators', 'pam')))
     createLink('{}/bloc_cylindre.png'.format(os.path.join(baseDir, 'docs', lang, 'calculators', 'pam')))
-- 
GitLab


From 3672a4a5a28d93d36b0cbbf9717d040592cda8be Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 13:33:08 +0000
Subject: [PATCH 08/22] fix(docs): missing utf8 French characters in Latex

IN math formulas need to put proper latex accent instructions as \acute{}

Refs #656
---
 docs/fr/calculators/structures/kivi.md        |  2 +-
 .../calculators/structures/villemonte_1947.md |  2 +-
 docs/latex/cassiopee_doc_en.tex               | 24 ++++++++++++++++++
 docs/latex/cassiopee_doc_fr.tex               | 25 +++++++++++++++++++
 docs/latex/cassiopee_preamble.tex             | 18 +------------
 scripts/mkdocs2pdf.py                         |  6 ++---
 6 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/docs/fr/calculators/structures/kivi.md b/docs/fr/calculators/structures/kivi.md
index 632215205..4c190a36d 100644
--- a/docs/fr/calculators/structures/kivi.md
+++ b/docs/fr/calculators/structures/kivi.md
@@ -36,7 +36,7 @@ Pour une cote de l'eau aval supérieure à la cote de la crête du déversoir, l
 
 Villemonte propose la formule suivante&nbsp;:
 
-$$K = \frac{Q_{noyé}}{Q_{dénoyé}} = \left [ 1- \left ( \frac{h2}{h1} \right)^n \right]^{0.385}$$
+$$K = \frac{Q_{noy\acute{e}}}{Q_{d\acute{e}noy\acute{e}}} = \left [ 1- \left ( \frac{h2}{h1} \right)^n \right]^{0.385}$$
 
 Avec&nbsp;:
 
diff --git a/docs/fr/calculators/structures/villemonte_1947.md b/docs/fr/calculators/structures/villemonte_1947.md
index e6831d481..66e09214c 100644
--- a/docs/fr/calculators/structures/villemonte_1947.md
+++ b/docs/fr/calculators/structures/villemonte_1947.md
@@ -12,7 +12,7 @@ Pour une cote de l'eau aval supérieure à la cote de la crête du déversoir, l
 
 Villemonte propose la formule suivante&nbsp;:
 
-$$K = \frac{Q_{noyé}}{Q_{dénoyé}} = \left [ 1- \left ( \frac{h2}{h1} \right)^n \right]^{0.385}$$
+$$K = \frac{Q_{noy\acute{e}}}{Q_{d\acute{e}noy\acute{e}}} = \left [ 1- \left ( \frac{h2}{h1} \right)^n \right]^{0.385}$$
 
 Avec&nbsp;:
 
diff --git a/docs/latex/cassiopee_doc_en.tex b/docs/latex/cassiopee_doc_en.tex
index 0b7095d1f..57ad984e4 100644
--- a/docs/latex/cassiopee_doc_en.tex
+++ b/docs/latex/cassiopee_doc_en.tex
@@ -47,6 +47,30 @@
 %*******************************************************************************
 \input{cassiopee_preamble.tex}
 
+%*******************************************************************************
+% Preamble specific for this language
+%*******************************************************************************
+
+
+%*******************************************************************************
+% Begin the document
+%*******************************************************************************
+\begin{document}
+%Supprime les veuves et orphelines
+\widowpenalty=10000
+\clubpenalty=10000
+\raggedbottom
+
+% Integre la page de garde
+%\input{title.tex}
+\input{rapport_inrae/cover_inrae}
+\input{rapport/headfoot_content}
+
+\cleardoublepage
+
+% Table des matières
+\cleardoublepage
+\tableofcontents
 
 %*******************************************************************************
 % Contenu de la documentation en anglais, généré par pandoc via mkdocs2pdf.py
diff --git a/docs/latex/cassiopee_doc_fr.tex b/docs/latex/cassiopee_doc_fr.tex
index 2c4c95990..3004415c4 100644
--- a/docs/latex/cassiopee_doc_fr.tex
+++ b/docs/latex/cassiopee_doc_fr.tex
@@ -48,6 +48,31 @@
 \input{cassiopee_preamble.tex}
 
 
+%*******************************************************************************
+% Preamble specific for this language
+%*******************************************************************************
+
+
+%*******************************************************************************
+% Begin the document
+%*******************************************************************************
+\begin{document}
+%Supprime les veuves et orphelines
+\widowpenalty=10000
+\clubpenalty=10000
+\raggedbottom
+
+% Integre la page de garde
+%\input{title.tex}
+\input{rapport_inrae/cover_inrae}
+\input{rapport/headfoot_content}
+
+\cleardoublepage
+
+% Table des matières
+\cleardoublepage
+\tableofcontents
+
 %*******************************************************************************
 % Contenu de la documentation en français, généré par pandoc via mkdocs2pdf.py
 %*******************************************************************************
diff --git a/docs/latex/cassiopee_preamble.tex b/docs/latex/cassiopee_preamble.tex
index dc914bc2d..7ab1ac950 100644
--- a/docs/latex/cassiopee_preamble.tex
+++ b/docs/latex/cassiopee_preamble.tex
@@ -51,26 +51,10 @@
 \newunicodechar{α}{\ensuremath{\alpha}}
 \newunicodechar{β}{\ensuremath{\beta}}
 \newunicodechar{μ}{\ensuremath{\mu}}
+\newunicodechar{σ}{\ensuremath{\sigma}}
 \newunicodechar{Δ}{\ensuremath{\Delta}}
 \newunicodechar{☰}{\ensuremath{\equiv}}
 \newunicodechar{≈}{\ensuremath{\approx}}
 \newunicodechar{ϵ}{\ensuremath{\in}}
 \newunicodechar{↵}{\ensuremath{\hookleftarrow}}
 \newunicodechar{≤}{\ensuremath{\leq}}
-
-\begin{document}
-%Supprime les veuves et orphelines
-\widowpenalty=10000
-\clubpenalty=10000
-\raggedbottom
-
-% Integre la page de garde
-%\input{title.tex}
-\input{rapport_inrae/cover_inrae}
-\input{rapport/headfoot_content}
-
-\cleardoublepage
-
-% Table des matières
-\cleardoublepage
-\tableofcontents
diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index ffe468e5d..b1ad16ead 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -196,11 +196,11 @@ def buildPDF(lang):
     # copy Cassiopée version LateX file
     cvt = os.path.join(buildDir, 'cassiopee_version.tex')
     shutil.copy(cvt, modelDir)
-
+    cmdline = 'latexmk -f -pdf -interaction=nonstopmode'
     if verbose:
-        os.system('latexmk -f -xelatex -interaction=nonstopmode {0} > {0}.latexmk.log'.format(sourceTexFile))
+        os.system('{0} {1} > {1}.latexmk.log'.format(cmdline, sourceTexFile))
     else:
-        os.system('latexmk -f -xelatex -interaction=nonstopmode {} > /dev/null 2>&1'.format(sourceTexFile))
+        os.system('{} {} > /dev/null 2>&1'.format(cmdline, sourceTexFile))
 
     # copy generated PDF to release directory
     shutil.copy(outputPdfFile, outputDir)
-- 
GitLab


From 04da5a3b17782d5c5ab7b1fbe29bd7b90b69dbf4 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 13:33:30 +0000
Subject: [PATCH 09/22] clean(docs/latex): remove superfluous ? in removal
 internal links regex

Refs #656
---
 scripts/mkdocs2pdf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index b1ad16ead..efe540f15 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -225,7 +225,7 @@ def buildDocForLang(lang):
     mergedDocFilename = mergedDocFilenamePrefix + lang
     mergedDocOutputPath = os.path.join(pdfBuildDir, mergedDocFilename)
     # remove internal links @TODO convert them to hyperref ?
-    s = re.sub(r'\[([^/\^]+?)\]?\([^ ]+?\.md\)', r'\1', s)
+    s = re.sub(r'\[([^/\^]+?)\]\([^ ]+?\.md\)', r'\1', s)
     with open('{}.md'.format(mergedDocOutputPath), 'w') as f:
         f.writelines(s)
 
-- 
GitLab


From 824f67268f93210412158ffd8db3af83373f4c47 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 13:34:28 +0000
Subject: [PATCH 10/22] fix(docs): removed weird characters

Refs #656
---
 docs/en/calculators/pam/macrorugo_theorie.md  | 2 +-
 docs/en/calculators/structures/fente_noyee.md | 4 ++--
 docs/fr/calculators/pam/macrorugo_theorie.md  | 2 +-
 docs/fr/calculators/structures/fente_noyee.md | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/en/calculators/pam/macrorugo_theorie.md b/docs/en/calculators/pam/macrorugo_theorie.md
index ba7b9845e..09fa8ad9f 100644
--- a/docs/en/calculators/pam/macrorugo_theorie.md
+++ b/docs/en/calculators/pam/macrorugo_theorie.md
@@ -240,4 +240,4 @@ $$C_f = \frac{2}{(5.1 \mathrm{log} (h/k_s)+6)^2}$$
 
 [^4]: Larinier, Michel, Courret, D., Gomes, P., 2006. Guide technique pour la conception des passes à poissons “naturelles,” Rapport GHAPPE RA. Compagnie Nationale du Rhône / Agence de l’Eau Adour Garonne. http://dx.doi.org/10.13140/RG.2.1.1834.8562
 
-[^5]: Rice C. E., Kadavy K. C., et Robinson K. M., 1998. Roughness of Loose Rock Riprap on Steep Slopes. Journal of Hydraulic Engineering 124, 179‑85. https://doi.org/10.1061/(ASCE)0733-9429(1998)124:2(179)
+[^5]: Rice C. E., Kadavy K. C., et Robinson K. M., 1998. Roughness of Loose Rock Riprap on Steep Slopes. Journal of Hydraulic Engineering 124, 179-85. https://doi.org/10.1061/(ASCE)0733-9429(1998)124:2(179)
diff --git a/docs/en/calculators/structures/fente_noyee.md b/docs/en/calculators/structures/fente_noyee.md
index b7a3fac75..4aed854ea 100644
--- a/docs/en/calculators/structures/fente_noyee.md
+++ b/docs/en/calculators/structures/fente_noyee.md
@@ -44,6 +44,6 @@ Ballu A., Pineau G., Calluaud D., David L. (2015). Experimental study of the inf
 
 Ballu A. (2017). Étude numérique et expérimentale de l’écoulement turbulent au sein des passes à poissons à fentes verticales. Analyse de l’écoulement tridimensionnel et instationnaire. *Thèse de l’Université de Poitiers*, 223p.
 
-Ballu A., Calluaud D., Pineau G., david L. (2017). Experimental study of the influence of macro‑roughnesses on vertical slot fishway flows. *La Houille Blanche*, 2: 9-14.
+Ballu A., Calluaud D., Pineau G., david L. (2017). Experimental study of the influence of macro-roughnesses on vertical slot fishway flows. *La Houille Blanche*, 2: 9-14.
 
-Wang R.W., David L., Larinier M. (2010). Contribution of experimental fluid mechanics to the design of vertical slot fish passes. *Knowledge and Management of Aquatic Ecosystems*, 396(2).
+Wang R.W., David L., Larinier M. (2010). Contribution of experimental fluid mechanics to the design of vertical slot fish passes. *Knowledge and Management of Aquatic Ecosystems*, 396(2).
diff --git a/docs/fr/calculators/pam/macrorugo_theorie.md b/docs/fr/calculators/pam/macrorugo_theorie.md
index 4af840788..de028e450 100644
--- a/docs/fr/calculators/pam/macrorugo_theorie.md
+++ b/docs/fr/calculators/pam/macrorugo_theorie.md
@@ -237,4 +237,4 @@ $$C_f = \frac{2}{(5.1 \mathrm{log} (h/k_s)+6)^2}$$
 
 [^4]: Larinier, Michel, Courret, D., Gomes, P., 2006. Guide technique pour la conception des passes à poissons “naturelles,” Rapport GHAPPE RA. Compagnie Nationale du Rhône / Agence de l’Eau Adour Garonne. http://dx.doi.org/10.13140/RG.2.1.1834.8562
 
-[^5]: Rice C. E., Kadavy K. C., et Robinson K. M., 1998. Roughness of Loose Rock Riprap on Steep Slopes. Journal of Hydraulic Engineering 124, 179‑85. https://doi.org/10.1061/(ASCE)0733-9429(1998)124:2(179)
+[^5]: Rice C. E., Kadavy K. C., et Robinson K. M., 1998. Roughness of Loose Rock Riprap on Steep Slopes. Journal of Hydraulic Engineering 124, 179-85. https://doi.org/10.1061/(ASCE)0733-9429(1998)124:2(179)
diff --git a/docs/fr/calculators/structures/fente_noyee.md b/docs/fr/calculators/structures/fente_noyee.md
index b31bdfb8c..846a6aea6 100644
--- a/docs/fr/calculators/structures/fente_noyee.md
+++ b/docs/fr/calculators/structures/fente_noyee.md
@@ -44,6 +44,6 @@ Ballu A., Pineau G., Calluaud D., David L. (2015). Experimental study of the inf
 
 Ballu A. (2017). Étude numérique et expérimentale de l’écoulement turbulent au sein des passes à poissons à fentes verticales. Analyse de l’écoulement tridimensionnel et instationnaire. *Thèse de l’Université de Poitiers*, 223p.
 
-Ballu A., Calluaud D., Pineau G., david L. (2017). Experimental study of the influence of macro‑roughnesses on vertical slot fishway flows. *La Houille Blanche*, 2: 9-14.
+Ballu A., Calluaud D., Pineau G., david L. (2017). Experimental study of the influence of macro-roughnesses on vertical slot fishway flows. *La Houille Blanche*, 2: 9-14.
 
-Wang R.W., David L., Larinier M. (2010). Contribution of experimental fluid mechanics to the design of vertical slot fish passes. *Knowledge and Management of Aquatic Ecosystems*, 396(2).
+Wang R.W., David L., Larinier M. (2010). Contribution of experimental fluid mechanics to the design of vertical slot fish passes. *Knowledge and Management of Aquatic Ecosystems*, 396(2).
-- 
GitLab


From 28e936a420eafae2709ac2da20cb79df434b9f3f Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 14:20:49 +0000
Subject: [PATCH 11/22] docs: pdf build script optimisation

Refs #656
---
 scripts/mkdocs2pdf.py | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index efe540f15..47ee5c1c3 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -160,7 +160,7 @@ def getLatexModel():
         os.chdir(os.path.dirname(os.getcwd()))
     else:
         runCommand('git clone {} {}'.format(latexModelRepository, latexModelDir))
-    # back to original working drectory
+    # back to original working directory
     os.chdir(baseDir)
 
 # Inject generated merged documentation and necessary resources (template, logos…)
@@ -210,11 +210,6 @@ def buildPDF(lang):
 # Creates the PDF documentation file for the given language
 def buildDocForLang(lang):
 
-    # Prepare temporary build directory
-    createEmptyDir(pdfBuildDir)
-    # Prepare output directory
-    createDir(outputDir)
-
     # Read config
     yamlPath = 'mkdocs/mkdocs-' + lang + '.yml'
     dMkdocsYaml = readConfig(yamlPath)
@@ -232,20 +227,26 @@ def buildDocForLang(lang):
     # Convert to tex format
     convertMdToTex(mergedDocOutputPath)
 
-    # Get INRAE report LaTeX model and inject merged content inside
-    getLatexModel()
+    # Inject merged content inside Latex model
     injectContentIntoModel(mergedDocFilename + '.tex', lang)
 
     # Build PDF from LaTeX source
     buildPDF(lang)
 
-    # Clean build dir
-    if not verbose: shutil.rmtree(pdfBuildDir)
-    #raise RuntimeError()
-
 
 if __name__ == '__main__':
 
+    # Prepare temporary build directory
+    createEmptyDir(pdfBuildDir)
+    # Prepare output directory
+    createDir(outputDir)
+
+    # Get INRAE report LaTeX model
+    getLatexModel()
+
     for l in ['fr', 'en']:
         print('building PDF doc for language "{}"'.format(l))
         buildDocForLang(l)
+
+    # Clean build dir
+    if not verbose: shutil.rmtree(pdfBuildDir)
-- 
GitLab


From b9c5b296ea19f34823f7c2e8d989fc2547ff50b9 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 14:21:43 +0000
Subject: [PATCH 12/22] docs: malformed lists

Refs #656
---
 docs/en/calculators/structures/liste.md           | 4 +++-
 docs/fr/calculators/structures/liste.md           | 4 +++-
 docs/fr/calculators/structures/villemonte_1947.md | 6 +++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/docs/en/calculators/structures/liste.md b/docs/en/calculators/structures/liste.md
index a31432a13..59ee1a21f 100644
--- a/docs/en/calculators/structures/liste.md
+++ b/docs/en/calculators/structures/liste.md
@@ -22,7 +22,7 @@
 
 Table: Stage-discharge equations list
 
-## Sharp-crested or broad-crested weir ?
+## Sharp-crested or broad-crested weir?
 
 Extract from CETMEF, 2005. Note on weirs : synthesis of flow laws at the right of weirs and spillways. Centre d'Études Techniques Maritimes Et Fluviales, Compiègne.
 
@@ -32,10 +32,12 @@ Extract from CETMEF, 2005. Note on weirs : synthesis of flow laws at the right o
 >
 > On the other hand, the closer the upstream water line is to the weir crest, the greater the width of the weir appears in relation to the breadth of the water flowing over it and therefore the broader the weir crest appears.
 > A weir in a river thus belongs to one of the three following categories:
+>
 > - sharp-crested weir
 > - broad-crested weir
 > - weir with undefined crest
 >
 > In order to determine the type of weir studied, the following conditions must be verified:
+>
 > - if $C < \frac{H_1}{2}$, then the threshold is sharp-crested;
 > - if $C > \frac{2H_1}{3}$, then the threshold is broad-crested.
diff --git a/docs/fr/calculators/structures/liste.md b/docs/fr/calculators/structures/liste.md
index 125242c45..29f05d56b 100644
--- a/docs/fr/calculators/structures/liste.md
+++ b/docs/fr/calculators/structures/liste.md
@@ -32,10 +32,12 @@ Extrait de CETMEF, 2005. Notice sur les déversoirs : synthèse des lois d’
 >
 > A l’inverse, plus la ligne d’eau amont se rapproche de la crête du seuil, plus la largeur du seuil paraît grande vis-à-vis de l’épaisseur de la lame d’eau qui y transite et donc plus la crête du seuil paraît épaisse.
 > Un déversoir en rivière appartient ainsi à l’une des trois catégories suivantes :
+>
 > - seuil à crête mince
 > - seuil à crête épaisse
 > - seuil à crête non définie
 >
 > Afin de déterminer le type de seuil étudié, les conditions suivantes doivent être vérifiées :
+>
 > - si $C < \frac{H_1}{2}$, alors le seuil est à crête mince ;
-> - si $C > \frac{2H_1}{3}$, alors le seuil est à crête épaisse.
\ No newline at end of file
+> - si $C > \frac{2H_1}{3}$, alors le seuil est à crête épaisse.
diff --git a/docs/fr/calculators/structures/villemonte_1947.md b/docs/fr/calculators/structures/villemonte_1947.md
index 66e09214c..6c5f1ac14 100644
--- a/docs/fr/calculators/structures/villemonte_1947.md
+++ b/docs/fr/calculators/structures/villemonte_1947.md
@@ -16,8 +16,8 @@ $$K = \frac{Q_{noy\acute{e}}}{Q_{d\acute{e}noy\acute{e}}} = \left [ 1- \left ( \
 
 Avec&nbsp;:
 
- - \(h_1\) la hauteur d'eau amont au dessus de la crête du déversoir
- - \(h_2\) la hauteur d'eau aval au dessus de la crête du déversoir
- - \(n\) l'exposant dans les relations d'écoulement dénoyé (rectangulaire=1.5, triangulaire=2.5, parabolique=2)
+ - \(h_1\), la hauteur d'eau amont au dessus de la crête du déversoir
+ - \(h_2\),  la hauteur d'eau aval au dessus de la crête du déversoir
+ - \(n\),  l'exposant dans les relations d'écoulement dénoyé (rectangulaire=1.5, triangulaire=2.5, parabolique=2)
 
 [^Villemonte1947]: Villemonte, J.R., 1947. Submerged weir discharge studies. Engineering news record 866, 54–57.
-- 
GitLab


From df01cfb266034049675cd936ed9f1cc2c392cd31 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 15:10:30 +0000
Subject: [PATCH 13/22] docs(latex): format title level 5 (paragraph)

Refs #656
---
 docs/latex/cassiopee_preamble.tex | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/latex/cassiopee_preamble.tex b/docs/latex/cassiopee_preamble.tex
index 7ab1ac950..ca5487a12 100644
--- a/docs/latex/cassiopee_preamble.tex
+++ b/docs/latex/cassiopee_preamble.tex
@@ -58,3 +58,8 @@
 \newunicodechar{ϵ}{\ensuremath{\in}}
 \newunicodechar{↵}{\ensuremath{\hookleftarrow}}
 \newunicodechar{≤}{\ensuremath{\leq}}
+
+\titleformat{\paragraph}
+	[block]
+	{\bfseries\sffamily\raggedright}
+	{\theparagraph}{0.5em}{}
-- 
GitLab


From ac435338a8f5e532ddbbeff83ea38c4b4d73bb4c Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 15:14:39 +0000
Subject: [PATCH 14/22] fix(docs/latex): correct title if previous file has no
 terminal new line

Refs #656
---
 scripts/mkdocs2pdf.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index 47ee5c1c3..ddabae3bd 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -82,7 +82,7 @@ def shiftMdHeaders(mdContent, level):
         if len(item) > 0 :
             if item[0] == "#":
                 lMd[i] = ("#" * level) + item
-    return "\n".join(lMd)
+    return "\n".join(lMd) + "\n"
 
 # Browses MkDocs configuration file and merges .md files
 def exploreAndMerge(docs_dir, nav, output = '', level = 0):
@@ -100,11 +100,13 @@ def exploreAndMerge(docs_dir, nav, output = '', level = 0):
             # Triple "../" because file will be compiled from pdf_build/latex_models
             path = os.path.join(baseDir, os.path.dirname(filepath))
             s = f.read() + "\n"
+            if s[-2] != "\n\n":
+                s += "\n"
             # Modification of image and links paths
             s = re.sub(r'(\!\[.+\]\()(.+)(\))', r'\1'+path+r'/\2\3', s)
             s = re.sub(r'(\\\()(.+?)(\\\))', r'$\2$', s)
             s = shiftMdHeaders(s, level)
-            output += "\n" + s
+            output += s
 
         elif type(d) is dict:
             level += 1
-- 
GitLab


From 238058cd7bb7ab98f1ab2e5946b9db03f9c0ba72 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 15:41:36 +0000
Subject: [PATCH 15/22] ci: debugging -commit to remove-

---
 .gitlab-ci.yml        | 1 +
 scripts/mkdocs2pdf.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ccd95cd86..af628beb2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -78,6 +78,7 @@ test:
     expire_in: 10 min
     paths:
       - dist/
+      - build
   script:
     # -baseref option is used by npm to set the npm_config_basehref environment variable
     # used in package.json
diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index ddabae3bd..662122c23 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -21,7 +21,7 @@ import re
 import shutil
 
 # verbose output
-verbose = False
+verbose = True
 
 baseDir = os.getcwd()
 buildDir = os.path.join(baseDir, 'build')
-- 
GitLab


From 26ecd09e615dbee849d7fc0ae982f05bae5d6354 Mon Sep 17 00:00:00 2001
From: David Dorchies <david.dorchies@inrae.fr>
Date: Fri, 26 Jan 2024 16:50:06 +0000
Subject: [PATCH 16/22] fix(docs/latex): remove weird character

Refs #656
---
 CHANGELOG.md | 74 ++++++++++++++++++++++++++--------------------------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8da44a7a..a991b3413 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,7 +33,7 @@
 * Clean npm dependencies ([jalhyd#356](https://forgemia.inra.fr/cassiopee/jalhyd/-/issues/356))
 * CI: automatically publish jalhyd package on NPM ([jalhyd#359](https://forgemia.inra.fr/cassiopee/jalhyd/-/issues/359))
 
-### 4\.17.1 - 2023-11-20
+### 4.17.1 - 2023-11-20
 
 #### Correction de bogues
 
@@ -48,7 +48,7 @@
 
 * CI: change cache strategy for node modules ([jalhyd#358](https://forgemia.inra.fr/cassiopee/jalhyd/-/issues/358), [nghyd#630](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/630))
 
-### 4\.17.0 - 2023-05-30
+### 4.17.0 - 2023-05-30
 
 #### Nouvelles fonctionnalités
 
@@ -111,13 +111,13 @@
 * Tests E2E: Vérifier la cohérence entre le json de description des calculettes et le flag visible des paramètres ([nghyd#550](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/550))
 * Thème Angular Material personnalisé : avertissements dart-sass à la compilation ([nghyd#414](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/414))
 
-### 4\.16.3 - 2023-01-11
+### 4.16.3 - 2023-01-11
 
 #### Correction de bogues
 
 * Lechapt et Calmon : erreur de sélection de matériau ([jalhyd#337](https://forgemia.inra.fr/cassiopee/jalhyd/-/issues/337), [nghyd#589](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/589))
 
-### 4\.16.1 - 2022-11-16
+### 4.16.1 - 2022-11-16
 
 #### Correction de bogues
 
@@ -129,7 +129,7 @@
 * Rajouter François Grand comme auteur de la documentation PDF ([nghyd#573](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/573))
 * Ajouter les références pour les schémas des lois d'ouvrages ([nghyd#575](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/575))
 
-### 4\.16.0 - 2022-10-12 (Anguilla anguilla)
+### 4.16.0 - 2022-10-12 (Anguilla anguilla)
 
 #### Nouvelles fonctionnalités
 
@@ -173,7 +173,7 @@
 * Mise à jour de Chartjs ([nghyd#554](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/554))
 * MAJ vers PrimeNG 10 ([nghyd#481](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/481))
 
-### 4\.15.1 - 2022-07-04
+### 4.15.1 - 2022-07-04
 
 #### Nouvelles fonctionnalités
 
@@ -212,7 +212,7 @@
 
 * Path error in stable deployment version on the dev server [nghyd#540](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/540)
 
-### 4\.15.0 - 2022-05-04 (Salmo trutta)
+### 4.15.0 - 2022-05-04 (Salmo trutta)
 
 #### Nouvelles fonctionnalités
 
@@ -251,7 +251,7 @@
 * CI : les jobs build en schedule de master et devel plantent ([nghyd#527](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/527))
 * CI : affiner la gestion du cache ([nghyd#526](https://forgemia.inra.fr/cassiopee/nghyd/-/issues/526))
 
-### 4\.14.2 - 2021-03-25
+### 4.14.2 - 2021-03-25
 
 #### Nouvelles fonctionnalités
 
@@ -266,7 +266,7 @@
 
 * Macrorugo : Documentation de Cd0 avec schéma ([nghyd#492](https://forgemia.inra.fr/cassiopee/nghyd/issues/492))
 
-### 4\.14.1 - 2021-02-17
+### 4.14.1 - 2021-02-17
 
 #### Nouvelles fonctionnalités
 
@@ -276,7 +276,7 @@
 
 * Vérificateur de passe: message erroné pour les passes à macro-rugosités submergées ([jalhyd#292](https://forgemia.inra.fr/cassiopee/jalhyd/issues/292))
 
-### 4\.14.0 - 2021-02-16 (Scomber scombrus)
+### 4.14.0 - 2021-02-16 (Scomber scombrus)
 
 #### Nouvelles fonctionnalités
 
@@ -299,7 +299,7 @@
 * MacroRugo: erreur de formule de correction de Cd dans la documentation ([nghyd#488](https://forgemia.inra.fr/cassiopee/nghyd/issues/488))
 * Documentation du module de calcul de la cote amont / aval d'un bief ([nghyd#490](https://forgemia.inra.fr/cassiopee/nghyd/issues/490))
 
-### 4\.13.1 - 2020-10-02
+### 4.13.1 - 2020-10-02
 
 #### Correction de bogues
 
@@ -307,7 +307,7 @@
 * PreBarrage: erreur de calcul sur Z2 > Z1 initiale ([jalhyd#280](https://forgemia.inra.fr/cassiopee/jalhyd/issues/280))
 * Prebarrage : avec Chrome (et electron) le schéma est mal rendu ([nghyd#482](https://forgemia.inra.fr/cassiopee/nghyd/issues/482))
 
-### 4\.13.0 - 2020-09-24 (Michel Larinier)
+### 4.13.0 - 2020-09-24 (Michel Larinier)
 
 #### Nouvelles fonctionnalités
 
@@ -328,7 +328,7 @@
 * Aide du Jet / de la pente : mentionner l'inversion de la pente pour le module Jet ([nghyd#475](https://forgemia.inra.fr/cassiopee/nghyd/issues/475))
 * Ajouter à l'accueil de la documentation un chapitre "contact, bugs, remarques…" ([nghyd#472](https://forgemia.inra.fr/cassiopee/nghyd/issues/472))
 
-### 4\.12.1 - 2020-09-15
+### 4.12.1 - 2020-09-15
 
 #### Correction de bogues
 
@@ -342,7 +342,7 @@
 
 * Lechapt-Calmon : documentation du coefficient de pertes de charges singulières ([nghyd#338](https://forgemia.inra.fr/cassiopee/nghyd/issues/338))
 
-### 4\.12.0 - 2020-09-09 (Les critères de Francis Blanche − ils peuvent le faire !)
+### 4.12.0 - 2020-09-09 (Les critères de Francis Blanche - ils peuvent le faire !)
 
 #### Nouvelles fonctionnalités
 
@@ -380,7 +380,7 @@
 * Electron 10
 * Mathjax 3 ([nghyd#416](https://forgemia.inra.fr/cassiopee/nghyd/issues/416))
 
-### 4\.11.1 - 2020-08-11
+### 4.11.1 - 2020-08-11
 
 #### Nouvelles fonctionnalités
 
@@ -397,7 +397,7 @@
 
 * Mise à jour de la documentation de la loi de Cunge ([nghyd#441](https://forgemia.inra.fr/cassiopee/nghyd/issues/441))
 
-### 4\.11.0 - 2020-07-28 (Puisque tu PAR)
+### 4.11.0 - 2020-07-28 (Puisque tu PAR)
 
 #### Nouvelles fonctionnalités
 
@@ -419,7 +419,7 @@
 
 * Passes à ralentisseurs ([nghyd#398](https://forgemia.inra.fr/cassiopee/nghyd/issues/398))
 
-### 4\.10.6 - 2020-07-21
+### 4.10.6 - 2020-07-21
 
 #### Nouvelles fonctionnalités
 
@@ -435,7 +435,7 @@
 * Erreur dans l'équation de Cunge
 * Corrections mineures sur Vanne Dénoyée
 
-### 4\.10.5 - 2020-06-30
+### 4.10.5 - 2020-06-30
 
 #### Nouvelles fonctionnalités
 
@@ -462,7 +462,7 @@
 * Documentation de la loi Cunge80 ([nghyd#403](https://forgemia.inra.fr/cassiopee/nghyd/issues/403))
 * Documentation des grilles: il manque la définition des variables ([nghyd#401](https://forgemia.inra.fr/cassiopee/nghyd/issues/401))
 
-### 4\.10.4 - 2020-04-17
+### 4.10.4 - 2020-04-17
 
 #### Nouvelles fonctionnalités
 
@@ -486,7 +486,7 @@
 * Fusionner "Section paramétrée" et "Variables hydrauliques" ([nghyd#390](https://forgemia.inra.fr/cassiopee/nghyd/issues/390))
 * Sections : documentation du champ Hauteur de berge
 
-### 4\.10.3 - 2020-03-12
+### 4.10.3 - 2020-03-12
 
 #### Nouvelles fonctionnalités
 
@@ -510,7 +510,7 @@
 * Section Paramétrée : tableau de résultats fixes en plusieurs exemplaires lors de l'utilisation avec le Solveur ([nghyd#377](https://forgemia.inra.fr/cassiopee/nghyd/issues/377))
 * Bief : calcul des sections amont et aval ([nghyd#376](https://forgemia.inra.fr/cassiopee/nghyd/issues/376))
 
-### 4\.10.2 - 2020-02-25
+### 4.10.2 - 2020-02-25
 
 #### Correction de bogues
 
@@ -520,13 +520,13 @@
 
 * Documentation : ajout de liens vers la page de téléchargement
 
-### 4\.10.1 - 2020-02-25
+### 4.10.1 - 2020-02-25
 
 #### Correction de bogues
 
 * Electron : erreur de détection de mise à jour (comparaison chaînes semver)
 
-### 4\.10.0 - 2020-02-24 (Langue Hilare Neuve)
+### 4.10.0 - 2020-02-24 (Langue Hilare Neuve)
 
 #### Nouvelles fonctionnalités
 
@@ -556,7 +556,7 @@
 * Typescript 3.7 ([jalhyd#197](https://forgemia.inra.fr/cassiopee/jalhyd/issues/197))
 * mise à jour de toutes les dépendances jalhyd/nghyd sauf Mermaid (provoque un bug) et Mathjax (adaptations importantes nécessaires)
 
-### 4\.9.0 - 2020-01-15 (On Fusionne Bien)
+### 4.9.0 - 2020-01-15 (On Fusionne Bien)
 
 #### Nouvelles fonctionnalités
 
@@ -578,7 +578,7 @@
 * Jasmine 3.5
 * Karma 4.4
 
-### 4\.8.1 - 2019-12-20
+### 4.8.1 - 2019-12-20
 
 #### Nouvelles fonctionnalités
 
@@ -612,7 +612,7 @@
 * Grille: Pas d'invalidation des résultats sur le choix du profil des barreaux ([nghyd#335](https://forgemia.inra.fr/cassiopee/nghyd/issues/335))
 * MacroRugoCompound: radier incliné - changer la répartition des cellules ([jalhyd#173](https://forgemia.inra.fr/cassiopee/jalhyd/issues/173))
 
-### 4\.8.0 - 2019-11-26 (Affine et forte à la fois, par amour du remous)
+### 4.8.0 - 2019-11-26 (Affine et forte à la fois, par amour du remous)
 
 #### Nouvelles fonctionnalités
 
@@ -632,7 +632,7 @@
 * Remous : en fluvial uniquement avec forte pente, les abscisses sont fausses ([nghyd#328](https://forgemia.inra.fr/cassiopee/nghyd/issues/328))
 * Calcul en chaîne : ERR inopiné dans le tableau de résultats fixes ([nghyd#329](https://forgemia.inra.fr/cassiopee/nghyd/issues/329))
 
-### 4\.7.0 - 2019-10-29 (AGB - Agence Grolandaise pour la Biodiversité)
+### 4.7.0 - 2019-10-29 (AGB - Agence Grolandaise pour la Biodiversité)
 
 #### Nouvelles fonctionnalités
 
@@ -654,7 +654,7 @@
 
 * chartjs-plugin-zoom 0.7.4
 
-### 4\.6.1 - 2019-10-15
+### 4.6.1 - 2019-10-15
 
 #### Nouvelles fonctionnalités
 
@@ -665,7 +665,7 @@
 
 * chartjs-plugin-zoom 0.7.4
 
-### 4\.6.0 - 2019-10-14 (Bluefish délavé)
+### 4.6.0 - 2019-10-14 (Bluefish délavé)
 
 #### Nouvelles fonctionnalités
 
@@ -703,7 +703,7 @@
 * ngx-markdown 8.2.1
 * electron 6.0.10
 
-### 4\.5.0 - 2019-09-09 (Fish ramps that rock!)
+### 4.5.0 - 2019-09-09 (Fish ramps that rock!)
 
 #### Nouvelles fonctionnalités
 
@@ -726,7 +726,7 @@
 * Passe à bassins: il manque l'édition de la cote de radier de la cloison aval ([nghyd#277](https://forgemia.inra.fr/cassiopee/nghyd/issues/277))
 * Résultats fixés: l'unité des paramètres calculés n'est pas affichée ([nghyd#274](https://forgemia.inra.fr/cassiopee/nghyd/issues/274))
 
-### 4\.4.2 - 2019-08-06
+### 4.4.2 - 2019-08-06
 
 #### Nouvelles fonctionnalités
 
@@ -749,7 +749,7 @@
 * Graphiques : ne pas représenter les données de type ENUM ([nghyd#260](https://forgemia.inra.fr/cassiopee/nghyd/issues/260))
 * Remous : l'itérateur d'abscisses est en retard sur le dessin du graphe ([nghyd#267](https://forgemia.inra.fr/cassiopee/nghyd/issues/267))
 
-### 4\.4.1 - 2019-07-30
+### 4.4.1 - 2019-07-30
 
 #### Nouvelles fonctionnalités
 
@@ -780,7 +780,7 @@
 
 * Angular 8.1.2
 
-### 4\.4.0 - 2019-07-16 (Basse à Sapins)
+### 4.4.0 - 2019-07-16 (Basse à Sapins)
 
 #### Nouvelles fonctionnalités
 
@@ -814,7 +814,7 @@
 * Nettoyage de code
 * Limitation de la précision numérique à différents endroits
 
-### 4\.3.0 - 2019-04-12 (Éditions LLL)
+### 4.3.0 - 2019-04-12 (Éditions LLL)
 
 #### Nouvelles fonctionnalités
 
@@ -835,7 +835,7 @@
 * Mise à jour intempestive des paramètres calculés dans le formulaire de saisie
 * Précision d'affichage des données dans les infobulles
 
-### 4\.2.0 - 2019-03-11
+### 4.2.0 - 2019-03-11
 
 #### Nouvelles fonctionnalités
 
@@ -864,7 +864,7 @@
 * conservation du type de graphe lorsqu'on change de module
 * ajout de tests exhaustifs sur le calcul des paramètres et le clonage des modules
 
-### 4\.1.0 - 2019-02-20
+### 4.1.0 - 2019-02-20
 
 #### Nouvelles fonctionnalités
 
@@ -903,4 +903,4 @@
 * suppression de MDBootstrap
 * suppression de FontAwesome
 
-### 4\.0.0 - 2018-07-23
\ No newline at end of file
+### 4.0.0 - 2018-07-23
\ No newline at end of file
-- 
GitLab


From 3c97316f42ebe10f7c555bb8e1f6984894927d91 Mon Sep 17 00:00:00 2001
From: Dorch <14124454+DDorch@users.noreply.github.com>
Date: Mon, 29 Jan 2024 06:20:54 +0000
Subject: [PATCH 17/22] chore: move mkdocs config to docs folder

Refs #656
---
 {mkdocs => docs}/mkdocs-en.yml | 0
 {mkdocs => docs}/mkdocs-fr.yml | 0
 scripts/mkdocs2pdf.py          | 2 +-
 scripts/prepare_mkdocs.sh      | 2 +-
 4 files changed, 2 insertions(+), 2 deletions(-)
 rename {mkdocs => docs}/mkdocs-en.yml (100%)
 rename {mkdocs => docs}/mkdocs-fr.yml (100%)

diff --git a/mkdocs/mkdocs-en.yml b/docs/mkdocs-en.yml
similarity index 100%
rename from mkdocs/mkdocs-en.yml
rename to docs/mkdocs-en.yml
diff --git a/mkdocs/mkdocs-fr.yml b/docs/mkdocs-fr.yml
similarity index 100%
rename from mkdocs/mkdocs-fr.yml
rename to docs/mkdocs-fr.yml
diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index 662122c23..f3d2f58f3 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -213,7 +213,7 @@ def buildPDF(lang):
 def buildDocForLang(lang):
 
     # Read config
-    yamlPath = 'mkdocs/mkdocs-' + lang + '.yml'
+    yamlPath = 'docs/mkdocs-' + lang + '.yml'
     dMkdocsYaml = readConfig(yamlPath)
 
     # Create string with merged MarkDown
diff --git a/scripts/prepare_mkdocs.sh b/scripts/prepare_mkdocs.sh
index af53d10dc..8cf1a93ca 100644
--- a/scripts/prepare_mkdocs.sh
+++ b/scripts/prepare_mkdocs.sh
@@ -13,7 +13,7 @@ function prepareMkdocs
   # - add Cassiopée version
   # - modify path to input files
   # - modify path to output files
-  cat mkdocs/mkdocs-$lang.yml \
+  cat docs/mkdocs-$lang.yml \
   | sed "/^site_name:/ s/$/ v$VER/" \
   | sed "/^docs_dir:/ s/docs_dir: /docs_dir: ..\//" \
   | sed "/^site_dir:/ s/site_dir: /site_dir: ..\//" > $BUILD_DIR/mkdocs-$1.yml
-- 
GitLab


From f1b843eda636a5736e682cbd3a7fba068b7720c5 Mon Sep 17 00:00:00 2001
From: Dorch <14124454+DDorch@users.noreply.github.com>
Date: Mon, 29 Jan 2024 06:23:57 +0000
Subject: [PATCH 18/22] docs: links pdf doc to current version not
 systematically to prod one

Refs #656
---
 docs/en/index.md | 2 +-
 docs/fr/index.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/en/index.md b/docs/en/index.md
index 1fb2aeaeb..0134dcbe1 100644
--- a/docs/en/index.md
+++ b/docs/en/index.md
@@ -19,7 +19,7 @@ Offline versions are available for the Windows, Linux, macOS, Android platforms.
 
 ## Documentation
 
-Download [documentation in PDF format](https://cassiopee.g-eau.fr/assets/docs/pdf/cassiopee_doc_en.pdf)
+Download [documentation in PDF format](../pdf/cassiopee_doc_en.pdf)
 
 Download [illustrated quick start guide (in french) in PDF format](https://cassiopee.g-eau.fr/assets/docs/pdf/cassiopee_notice_illustree_fr.pdf)
 
diff --git a/docs/fr/index.md b/docs/fr/index.md
index a2718ab7d..db2484f52 100644
--- a/docs/fr/index.md
+++ b/docs/fr/index.md
@@ -19,7 +19,7 @@ Des versions hors-ligne sont installables sur les plateformes Windows, Linux, ma
 
 ## Documentation
 
-Télécharger [la documentation au format PDF](https://cassiopee.g-eau.fr/assets/docs/pdf/cassiopee_doc_fr.pdf)
+Télécharger [la documentation au format PDF](../pdf/cassiopee_doc_fr.pdf)
 
 Télécharger [le guide de prise en main illustrée au format PDF](https://cassiopee.g-eau.fr/assets/docs/pdf/cassiopee_notice_illustree_fr.pdf)
 
-- 
GitLab


From 1cdd96649225a86d6c3214c746ec4a5d1050ad20 Mon Sep 17 00:00:00 2001
From: Dorch <14124454+DDorch@users.noreply.github.com>
Date: Mon, 29 Jan 2024 08:42:21 +0000
Subject: [PATCH 19/22] docs(pdf): handle multiline internal links

Refs #656
---
 scripts/mkdocs2pdf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index f3d2f58f3..e734e7601 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -222,7 +222,7 @@ def buildDocForLang(lang):
     mergedDocFilename = mergedDocFilenamePrefix + lang
     mergedDocOutputPath = os.path.join(pdfBuildDir, mergedDocFilename)
     # remove internal links @TODO convert them to hyperref ?
-    s = re.sub(r'\[([^/\^]+?)\]\([^ ]+?\.md\)', r'\1', s)
+    s = re.sub(r'\[([^/\^]+?)\]\([^ ]+?\.md\)', r'\1', s, flags=re.MULTILINE)
     with open('{}.md'.format(mergedDocOutputPath), 'w') as f:
         f.writelines(s)
 
-- 
GitLab


From cea0d9803b9411ac7840727f58f3cbbf6f36f333 Mon Sep 17 00:00:00 2001
From: Dorch <14124454+DDorch@users.noreply.github.com>
Date: Mon, 29 Jan 2024 08:44:02 +0000
Subject: [PATCH 20/22] docs(pdf): syntax issues

Refs #656
---
 docs/en/calculators/pab/pab.md               | 4 +++-
 docs/en/calculators/pam/macrorugo_remous.md  | 2 +-
 docs/en/calculators/pam/macrorugo_theorie.md | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/en/calculators/pab/pab.md b/docs/en/calculators/pab/pab.md
index 10fc6c482..f6a24c74a 100644
--- a/docs/en/calculators/pab/pab.md
+++ b/docs/en/calculators/pab/pab.md
@@ -77,7 +77,9 @@ During the calculation, if the calculated crest elevation is less than *minZDV*
 
 ## Calculation results
 
-The results are presented in the form of a summary table of hydraulic calculations for all basins and walls. It contains all the data calculated by the modules [Cross walls](cloisons.md) and [Power dissipation](volume.md).
+The results are presented in the form of a summary table of hydraulic
+calculations for all basins and walls. It contains all the data calculated
+by the modules [Cross walls](cloisons.md) and [Power dissipation](volume.md).
 
 Two graphs are present:
 
diff --git a/docs/en/calculators/pam/macrorugo_remous.md b/docs/en/calculators/pam/macrorugo_remous.md
index 7d260dbd9..acfd62227 100644
--- a/docs/en/calculators/pam/macrorugo_remous.md
+++ b/docs/en/calculators/pam/macrorugo_remous.md
@@ -15,7 +15,7 @@ calculation&nbsp;
 - The space step used to discretise the curve calculation.
 
 N.B.&nbsp;: As the backwater curve can only be calculated for one set of
-parameters, the [simple rock-ramp fishpass] module (macrorugo.md)
+parameters, the [simple rock-ramp fishpass](macrorugo.md) module
 cannot contain [varied parameters](../../general/principe_fonctionnement.md).
 
 The theoretical calculation carried out in the macro-roughness channel
diff --git a/docs/en/calculators/pam/macrorugo_theorie.md b/docs/en/calculators/pam/macrorugo_theorie.md
index 09fa8ad9f..5ea81ee43 100644
--- a/docs/en/calculators/pam/macrorugo_theorie.md
+++ b/docs/en/calculators/pam/macrorugo_theorie.md
@@ -146,7 +146,7 @@ For the cylindrical form of the blocks, \(\sigma\) is equal to \(\pi / 4\) and f
 
 ### Ratio between the average speed downstream of a block and the maximum speed *r*
 
-The values of (\r\) depends on the block shapes (Cassan et al., 2014[^2] et Tran et al. 2016 [^3]):
+The values of \(r\) depends on the block shapes (Cassan et al., 2014[^2] et Tran et al. 2016 [^3]):
 
 - round : \(r_Q=1.1\)
 - "rounded face" shape : \(r=1.2\)
-- 
GitLab


From 63a45f73b73a01f4eb9f6e695cfa7bf99ff38856 Mon Sep 17 00:00:00 2001
From: Dorch <14124454+DDorch@users.noreply.github.com>
Date: Mon, 29 Jan 2024 08:47:33 +0000
Subject: [PATCH 21/22] docs(pdf): correct link

Refs #656
---
 docs/en/calculators/pab/pab.md | 3 +--
 docs/fr/calculators/pab/pab.md | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/docs/en/calculators/pab/pab.md b/docs/en/calculators/pab/pab.md
index f6a24c74a..39205ef5a 100644
--- a/docs/en/calculators/pab/pab.md
+++ b/docs/en/calculators/pab/pab.md
@@ -91,5 +91,4 @@ If several results are available due to the variation of one or two hydraulic pa
 ## Example session
 
 An example illustrating the conception of a fish ladder can be directly loaded
-at the address:
-https://cassiopee.g-eau.fr/#/loadsession/app%2Fexamples%2Fpab-complete-chain.json
+through this [link](https://cassiopee.g-eau.fr/#/loadsession/app%2Fexamples%2Fpab-complete-chain.json).
diff --git a/docs/fr/calculators/pab/pab.md b/docs/fr/calculators/pab/pab.md
index b1f99c72d..0a4833e0a 100644
--- a/docs/fr/calculators/pab/pab.md
+++ b/docs/fr/calculators/pab/pab.md
@@ -88,5 +88,5 @@ Si plusieurs résultats sont disponibles du fait de la variation d'un ou deux pa
 
 ## Session exemple
 
-Un exemple de conception de passe à bassins peut être directement chargée à l'adresse&nbsp;:
-https://cassiopee.g-eau.fr/#/loadsession/app%2Fexamples%2Fpab-complete-chain.json
+Un exemple de conception de passe à bassins peut être directement chargée via ce
+[lien](https://cassiopee.g-eau.fr/#/loadsession/app%2Fexamples%2Fpab-complete-chain.json).
-- 
GitLab


From 8b22b51958913215cfefad3c916b04cd989fbe55 Mon Sep 17 00:00:00 2001
From: Dorch <14124454+DDorch@users.noreply.github.com>
Date: Mon, 29 Jan 2024 09:20:11 +0000
Subject: [PATCH 22/22] docs(pdf): missing final newline in md

Make a section disappear...

Refs #656
---
 docs/fr/calculators/pab/prebarrage.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/fr/calculators/pab/prebarrage.md b/docs/fr/calculators/pab/prebarrage.md
index d56604d6f..291eb4cf0 100644
--- a/docs/fr/calculators/pab/prebarrage.md
+++ b/docs/fr/calculators/pab/prebarrage.md
@@ -41,4 +41,4 @@ Si le calcul produit une série de résultats, une liste déroulante permet de c
 
 La première partie de l'écran montre un synoptique du pré-barrage avec les débits et les chutes au niveau des cloisons, la puissance moyenne dissipée et la profondeur moyenne au niveau des bassins, et le débit et les cotes de l'eau aux conditions limites amont et aval. Pour afficher les résultats chiffrés au niveau des bassins, l'utilisateur doit cliquer sur un des ces éléments sur le schéma. Pour afficher les résultats chiffrés au niveau d'une cloison, cliquer sur la cloison correspondante sur le schéma.
 
-Un bouton "Exporter tous les résultats" permet de récupérer un tableau au format Excel comprenant les résultats des conditions limites, des bassins et des cloisons pour toute la série de calcul.
\ No newline at end of file
+Un bouton "Exporter tous les résultats" permet de récupérer un tableau au format Excel comprenant les résultats des conditions limites, des bassins et des cloisons pour toute la série de calcul.
-- 
GitLab