Skip to content

Nemotron and DOTS exports alter inline LaTeX from model responses #4904

Open

Description

@PierreMesure

Bug

Nemotron Parse 2.0 and DOTS keep inline LaTeX in ordinary text items. Markdown export escapes underscores, and Nemotron's Markdown-to-text path can interpret math asterisks as emphasis. This changes formulas already present in the model response.

Steps to reproduce

  • Parse a Nemotron Text region containing The value is $x_1 * y_2 * z_3$..
  • Or parse a DOTS JSON Text element containing **Value** $x_1 * y_2 * z_3$..
  • Export Markdown.

Actual: math contains x\_1, y\_2, and z\_3. Expected: inline formula items holding the original LaTeX and an export containing $x_1 * y_2 * z_3$.

The fix should share the math-aware Markdown extension and rich HTML mapping. It must preserve code spans, literal/escaped currency, surrounding content, and the native block's single coordinate owner. This is a focused VLM-response conversion issue related to #2352; it does not address formula recognition in the standard PDF pipeline.

Docling version

Current main d01c9c0991920924cf17f6b8366079ac035ffc38 (2.140.0); reproduced locally on Python 3.12.

Activity

  1. PierreMesure commented on Oct 22, 2026

    @PierreMesure
    ContributorAuthor

    This issue remains open until #4908 merges. That PR is now rebased onto current main and includes the currency-range review fix. The focused suites pass (124 tests), and the combined tests with #4789 pass (267 passed, 1 skipped). The new CI runs will validate the rebased head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions