Long figure caption labelled text instead of caption on 2.152.0 (caption on 2.111.0)

Open
#5,574 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@xixi-box is already working on this.

Since Nov 25, 2026.

  • #5576 by @xixi-box — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

The report identifies the PDF conversion pipeline and provides a reproduction using DocumentConverter, PdfFormatOption, and PdfPipelineOptions; it does not name implementation files or tests. Start by reproducing the caption labeling difference on the supplied page with OCR disabled, then trace how the default layout model labels and links figure captions. Done means the block is labeled caption and remains linked to the picture; an open pull request already addresses this issue.

Written by the indexing model from the issue text.

Description

bug pdf priority:medium
Bug

Split out of #5569. A long figure caption that 2.111.0 labels caption (and links to its picture) is labelled text on 2.152.0, so the picture ends up with no caption. This is a labelling change, not a matching one: #5571 does not affect it.

Layout (PDF points, bottom-left origin), one page with a single wide figure:

  • Picture: l=89, t=624, r=524, b=295.
  • Caption: one block of about 2,100 characters starting at l=82, below the picture. It begins with a short production code and then "Figure 15-35 The stepwise activation of …".
Label of that block picture.captions
2.111.0 caption linked
2.152.0 text empty

The picture box is the same in both versions. Default layout model in both runs (no layout_options set).

Expected: the block keeps the caption label and stays linked.

Steps to reproduce
from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.document_converter import DocumentConverter, PdfFormatOption

opts = PdfPipelineOptions()
opts.do_ocr = False
conv = DocumentConverter(format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=opts)})
doc = conv.convert("page.pdf").document
for pic in doc.pictures:
    print(pic.prov[0].bbox, [c.resolve(doc).text[:40] for c in pic.captions])

The page is from a copyrighted textbook, so I cannot attach it here; I can share it privately with a maintainer, and I am happy to test a patch.

Docling version

docling 2.152.0, docling-core 2.108.0, docling-ibm-models 4.0.4, docling-parse 7.27.1 (also 2.152.0 with the hunk of #5571 applied: same result).
Compared with docling 2.111.0, docling-core 2.92.0, docling-ibm-models 3.13.3, docling-parse 7.16.0.

Python version

Python 3.12, Linux x86_64, CPU only.

Dominant language
Python
Stars
71k
Forks
5.4k
Avg merge
2d 22h
Merged PRs (30d)
161

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docling-project/docling

All issues in docling-project/docling

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.