From 9c601994e482f423b9ee0ff2bb345dd0fc8dccdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9o=20Baras?= Date: Tue, 13 Apr 2021 11:23:49 +0200 Subject: [PATCH] =?UTF-8?q?Corrige=20les=20topsep=20si=20le=20champ=20d?= =?UTF-8?q?=C3=A9bute=20par=20une=20liste=20=C3=A0=20puces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/ressource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ressource.py b/python/ressource.py index 3ada272..e1a72da 100644 --- a/python/ressource.py +++ b/python/ressource.py @@ -42,7 +42,7 @@ def nettoie_latex(chaine): for (i, ligne) in enumerate(lignes): if "\\begin{itemize}" in ligne: # on rencontre un itemize nbre_itemize += 1 - if nbre_itemize == 1: # si c'est le 1er + if nbre_itemize == 1 and i != 0: # si c'est le 1er itemize et que ce n'est pas la 1ère ligne lignes[i] = lignes[i].replace("\\begin{itemize}", "\\begin{itemize}[topsep=5pt]") elif "\\end{itemize}" in ligne: nbre_itemize -= 1 @@ -380,7 +380,7 @@ def md_to_latex(contenu): if contenu.startswith("\\begin{itemize}"): contenu = ( - "\\vspace{-5pt}\n" + contenu + "\\vspace{-10pt}\n" + contenu ) # ajout d'un offset en cas de liste à puces contenu = contenu.replace("\\\\" * 2, "\\\\") return contenu