File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
docling_core/transforms/serializer Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -656,7 +656,9 @@ def serialize_doc(
656656 # Build optional preamble
657657 preamble_lines : list [str ] = []
658658 if params .document_class :
659- preamble_lines .append (params .document_class + "\n " )
659+ # Add document class and a blank line after it
660+ preamble_lines .append (params .document_class )
661+ preamble_lines .append ("" )
660662 for pkg in params .packages :
661663 line = pkg .strip ()
662664 if not line :
@@ -671,7 +673,7 @@ def serialize_doc(
671673 preamble_lines .append (title_cmd )
672674
673675 header = (
674- "\n " .join (preamble_lines + ["\n \\ begin{document}" ])
676+ "\n " .join (preamble_lines + ["" , " \\ begin{document}" ])
675677 if preamble_lines
676678 else "\\ begin{document}"
677679 )
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ \section{\textit{Partially formatted} heading to\_escape \texttt{not_to_escape}
4545
4646\textit {Partially formatted } heading to\_ escape \texttt {not_to_escape } $ E=mc^2 $ \& ampersand
4747
48+ A hyperlink on \texttt {code in a line }
49+
50+ \begin {verbatim }
51+ A hyperlink on code as paragraph
52+ \end {verbatim }
53+
4854The end.
4955
5056\end {document }
Original file line number Diff line number Diff line change 1313from docling_core .types .doc .base import ImageRefMode
1414from docling_core .types .doc .document import DoclingDocument
1515
16- from .conftest import _construct_doc
17- from .conftest import _rich_table_doc as _construct_rich_table_doc
1816from .test_data_gen_flag import GEN_TEST_DATA
1917
2018
@@ -81,8 +79,8 @@ def test_dummy_doc():
8179 verify_or_update (exp_file = src .with_suffix (".gt.tex" ), actual = actual )
8280
8381
84- def test_constructed_doc ():
85- doc = _construct_doc ()
82+ def test_constructed_doc (sample_doc : DoclingDocument ):
83+ doc = sample_doc
8684
8785 ser = LaTeXDocSerializer (
8886 doc = doc ,
@@ -96,8 +94,8 @@ def test_constructed_doc():
9694 verify_or_update (exp_file = src .with_suffix (".gt.tex" ), actual = actual )
9795
9896
99- def test_constructed_rich_table_doc ():
100- doc = _construct_rich_table_doc ()
97+ def test_constructed_rich_table_doc (rich_table_doc : DoclingDocument ):
98+ doc = rich_table_doc
10199
102100 ser = LaTeXDocSerializer (
103101 doc = doc ,
You can’t perform that action at this time.
0 commit comments