Repository navigation
feat(cli): add latex output format - #4101
Conversation
Expose the LaTeXDocSerializer from docling-core as a CLI output format: docling <source> --to latex writes <name>.tex next to the other exports. Addresses the LaTeX part of docling-project#343. Signed-off-by: INTFRAME <hello@intframe.com>
|
✅ DCO Check Passed Thanks @aron-intframe, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks for the approval. Before it lands I re-verified the branch as it stands ( Correction to the PR body: "reproduces the corresponding The whole delta is the trailing I have not changed this on the branch, because it is what the CLI already does for its other text outputs — Tests re-run on the branch: The two failures are Not verified, stated plainly: (1) |
The LaTeX serializer has been available in docling-core since v2.54 (docling-project/docling-core#445), but the docling CLI cannot emit it. This adds
latextoOutputFormatand wires it throughexport_documents, sodocling <source> --to latexwrites<name>.tex(standalone document, default serializer params). Addresses the LaTeX part of #343; mathpix-markdown-it is not covered.Verified against docling-core's own golden files: converting
test/data/doc/{2408.09869v3_enriched,activities,polymers}.jsonwith--to latexreproduces the corresponding.gt.texexactly (43,965 / 1,344 / 10,909 chars). Also smoke-tested end-to-end ontests/data/pdf/sources/2305.03393v1-pg9.pdf(sections, table, caption render as expected).Known limitations, stated upfront: pictures are emitted as
% imageplaceholders (referenced-image wiring could follow in a later PR), andconvert-remoteneeds a service version that also knowslatex.Checklist:
docs/usage/supported_formats.md; the CLI reference is auto-generated)tests/test_cli.py::test_cli_exports_latex)