Skip to content

Auto-generate .bb bounding box data from image files to fix broken image imports #128

@ArhumJain

Description

@ArhumJain

When using \includegraphics with image files (JPEG, PNG, etc.), I am getting an extremely broken ouput; figures overlap text, alignment is completely destroyed, and references are unknown. However, compiling the same document with standard LaTeX/XeLaTeX produces a correct PDF.

I think the main reason is that TeXpresso's virtual filesystem cannot serve .bb (bounding box) files for images because they don't exist on disk. Standard LaTeX compilation doesn't produces .bb files and the xdvipdfmx driver extracts image dimensions transparently at PDF conversion time. Since TeXpresso bypasses xdvipdfmx with its own renderer, the TeX engine falls back to searching for .bb files, fails silently, and proceeds with unknown/zero image dimensions.

To reproduce

  1. Create a LaTeX document using \includegraphics with any JPEG/PNG images
  2. Verify it compiles correctly with xelatex
  3. Run build/texpresso document.tex
  4. Observe broken figure layout

Expected behavior

TeXpresso should extract image dimensions and serve synthetic .bb data through its virtual filesystem, matching the behavior you get from standard LaTeX compilation without any extra steps.

Current workaround

Manually run ebb (from dvipdfmx) on every image file to generate .bb files before launching TeXpresso. This is extremely ineffective and requires creating custom automation scripts as part of whatever editor you're using to automatically generate these .bb files in the right place.

Broken TeXpresso view:

Image

Well formed PDF Output:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions