From 4c396cd5b303df44e141b79a8c687817a08d9fba Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 9 Sep 2025 23:55:16 +0200 Subject: [PATCH] section_class for add_markdown fixed --- src/pyladoc/__init__.py | 3 +-- src/pyladoc/templates/default_template.tex | 4 ++-- tests/test_rendering_example2_doc.py | 7 ++++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pyladoc/__init__.py b/src/pyladoc/__init__.py index 66bd378..9fbf4dd 100644 --- a/src/pyladoc/__init__.py +++ b/src/pyladoc/__init__.py @@ -633,8 +633,7 @@ class DocumentWriter(): return html def render_to_latex() -> str: - html = _markdown_to_html( - self._equation_embedding_reescaping(norm_text)) + html = render_to_html() return latex.from_html(html) self._doc.append([render_to_html, render_to_latex]) diff --git a/src/pyladoc/templates/default_template.tex b/src/pyladoc/templates/default_template.tex index c7af98d..48b1b51 100644 --- a/src/pyladoc/templates/default_template.tex +++ b/src/pyladoc/templates/default_template.tex @@ -24,8 +24,8 @@ % Define fine print environment \newenvironment{fineprint} - {\begin{quote}\footnotesize\color{gray}} - {\end{quote}} + {\par\vspace{0.5\baselineskip}\noindent\footnotesize\color{gray}} + {\par\vspace{0.5\baselineskip}} % Geometry Settings \geometry{margin=1in} % 1-inch margins diff --git a/tests/test_rendering_example2_doc.py b/tests/test_rendering_example2_doc.py index 6d02adb..c5699bf 100644 --- a/tests/test_rendering_example2_doc.py +++ b/tests/test_rendering_example2_doc.py @@ -81,7 +81,12 @@ def make_document(): doc.add_table(df.style.hide(axis="index"), 'This is a example table', 'example1') - doc.add_text("This is a fine print test text section. It uses smaller text and uses grey color.", section_class='fineprint') + doc.add_text("This is a fine print test text section. It uses smaller text and uses grey color. This is a fine print test" + "text section. It uses smaller text and uses grey color.", section_class='fineprint') + + doc.add_text("Standard text section. This is normal text without any special formatting. It uses the default text size and color.") + + doc.add_markdown("This is a **fine print** test text section. It uses **smaller text** and uses **grey** color.", section_class='fineprint') return doc