From d2193c2526c8265a65c673b36f915b4586d3706f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 4 May 2025 14:35:57 +0200 Subject: [PATCH] tests updated for linked HTML references --- tests/test_latex_embedding.py | 4 ++-- tests/test_rendering_example2_doc.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_latex_embedding.py b/tests/test_latex_embedding.py index f5447d3..80af3c0 100644 --- a/tests/test_latex_embedding.py +++ b/tests/test_latex_embedding.py @@ -23,7 +23,7 @@ def test_latex_embedding2(): j on the transport properties of component i. The interaction parameter \Phi_{ij} is given by the relation shown in @eq:ExampleFormula2. - \Phi_{ij} = \frac{1}{\sqrt{8}} \left(1 + \frac{M_i}{M_j} \right)^{-1/2} \left[ 1 + \left( \frac{\lambda_i}{\lambda_j} \right)^{1/2} \left( \frac{M_j}{M_i} \right)^{1/4} \right]^2 + \Phi_{ij} = \frac{1}{\sqrt{8}} \left(1 + \frac{M_i}{M_j} \right)^{-1/2} \left[ 1 + \left( \frac{\lambda_i}{\lambda_j} \right)^{1/2} \left( \frac{M_j}{M_i} \right)^{1/4} \right]^2 """) dummy = pyladoc.DocumentWriter() @@ -45,7 +45,7 @@ def test_latex_embedding(): expected_output = pyladoc._normalize_text_indent(r""" # Test - \Phi_{ij} = \frac{1}{\sqrt{8}} + \Phi_{ij} = \frac{1}{\sqrt{8}} This i is inline LaTeX. """) diff --git a/tests/test_rendering_example2_doc.py b/tests/test_rendering_example2_doc.py index 7873063..e9f913e 100644 --- a/tests/test_rendering_example2_doc.py +++ b/tests/test_rendering_example2_doc.py @@ -98,7 +98,9 @@ def test_html_render(): def test_latex_render(): doc = make_document() - # print(doc.to_latex()) + if WRITE_RESULT_FILES: + with open('tests/out/test_html_render2.tex', 'w', encoding='utf-8') as f: + f.write(doc.to_latex()) assert doc.to_pdf('tests/out/test_latex_render2.pdf', font_family='serif')