Tweak multi-module LaTeX output

This commit is contained in:
Louis Gesbert 2024-02-16 16:35:32 +01:00
parent f09edf443e
commit 4ee4992b54
2 changed files with 17 additions and 7 deletions

View File

@ -271,18 +271,28 @@ let rec law_structure_to_latex
file label
| A.LawInclude (A.CatalaFile _ | A.LegislativeText _) -> ()
| A.ModuleDef (id, extern) ->
Format.fprintf fmt
"\n\\textbf{This defines the \\texttt{%s} module \\texttt{%s}}"
(if extern then "external" else "catala")
(match language with
| Fr ->
Format.fprintf fmt "\n\\textbf{Ceci définit le module %s \\texttt{%s}}"
(if extern then "externe" else "catala")
| _ ->
Format.fprintf fmt "\n\\textbf{This defines the %s module \\texttt{%s}}"
(if extern then "external" else "catala"))
(pre_latexify (Mark.remove id))
| A.ModuleUse (id, alias) -> (
Format.fprintf fmt
"\n\\textbf{The following makes use of the module \\texttt{%s}"
(match language with
| Fr ->
Format.fprintf fmt "\n\\textbf{Ce qui suit utilise le module \\texttt{%s}"
| _ ->
Format.fprintf fmt
"\n\\textbf{The following makes use of the module \\texttt{%s}")
(pre_latexify (Mark.remove id));
match alias with
| None -> Format.fprintf fmt "}"
| Some al ->
Format.fprintf fmt " under the name \texttt{%s}}"
(match language with
| Fr -> Format.fprintf fmt " sous le nom \\texttt{%s}}"
| _ -> Format.fprintf fmt " under the name \\texttt{%s}}")
(pre_latexify (Mark.remove al)))
| A.LawText t -> Format.fprintf fmt "%s" (pre_latexify t)
| A.CodeBlock (_, c, false) when not print_only_law ->

View File

@ -52,7 +52,7 @@ $ catala Interpret -s A
```catala-test-inline
$ catala latex
\textbf{This defines the \texttt{catala} module \texttt{Test\_grave\_char\_en}}
\textbf{This defines the catala module \texttt{Test\_grave\_char\_en}}
\subsection{Law text should be able to contain grave accent ``'.}