Skip to content

Use TinyTeX's maintained regex.json for LaTeX error detection #13612

Open

Description

@cderv

We manually maintain LaTeX error regex patterns in parse-error.ts, which requires ongoing maintenance when new LaTeX error formats appear.

TinyTeX publishes a comprehensive regex.json file as a release asset, generated by their build workflow (https://github.com/rstudio/tinytex/blob/d6e2c0d312e7a7782baab715ba24764a0452639d/.github/workflows/build.yaml#L173-L176). This file contains production-tested patterns used by RStudio's TinyTeX package manager.

Latest release: https://github.com/rstudio/tinytex-releases/releases/tag/daily

We could use TinyTeX's patterns as our source of truth for LaTeX error detection. This would keep us synchronized with battle-tested patterns that are updated daily by the RStudio team.

We could automate periodic sync to maintain alignment without manual effort.

Activity

  1. added
    enhancementNew feature or request
    latexLaTeX engines related libraries and technologies
    on Oct 24, 2025
  2. self-assigned this
    on Oct 24, 2025
  3. added this to the v1.9 milestone on Oct 24, 2025
  4. cderv commented on Nov 26, 2025

    @cderv
    MemberAuthor

    We've implemented a semi-automated approach to this in PR

    What Was Implemented

    1. Daily Verification Workflow (.github/workflows/verify-tinytex-patterns.yml)

      • Runs daily at 2am UTC
      • Downloads regex.tar.gz from tinytex-releases
      • Compares with cached version
      • Auto-creates/updates GitHub issue when patterns change
      • Detects changes within 24 hours
    2. Pattern Implementation (src/command/render/latexmk/parse-error.ts)

      • 96% pattern coverage (22/23 patterns from TinyTeX)
      • Adapted patterns for Quarto's full-text matching
    3. Documentation (dev-docs/tinytex-pattern-maintenance.md)

      • Pattern adaptation methodology
      • Testing procedures
      • Why manual adaptation is needed
    4. Test Coverage (tests/unit/latexmk/parse-error.test.ts)

      • 100% test coverage (19/19 error examples)

    Why Not Fully Automated?

    TinyTeX patterns are designed for line-by-line matching in R code, while Quarto matches against the entire log as a single string. This fundamental difference requires careful pattern adaptation:

    • Multiline flag adjustments
    • Anchor modifications
    • Filter function updates

    With ~4 pattern updates per year, manual adaptation after automated detection has proven practical.

    Current Status

    We're synchronized with TinyTeX (automated detection) but not fully automated (manual adaptation). This issue remains open for potential future work on complete automation, though the current semi-automated approach works well in practice.

  5. modified the milestones: v1.9, Future on Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestlatexLaTeX engines related libraries and technologies

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions