Skip to content

feat: TexCompileChecker — 編譯錯誤解析器 #5

Description

@kiki830621

概述

執行 pdflatex 編譯並解析 log 檔,將錯誤分類為結構化報告。

檔案

  • 新增: packages/pdf-to-latex-swift/Sources/PDFToLaTeXCore/TexCompileChecker.swift
  • 測試: packages/pdf-to-latex-swift/Tests/PDFToLaTeXCoreTests/TexCompileCheckerTests.swift

功能

  • parseLog() — 解析 .log 檔,分類錯誤:
    • undefinedCommand: ! Undefined control sequence
    • missingMath: ! Missing $ inserted
    • missingBrace: ! Missing } inserted
    • environment: ! LaTeX Error: \begin{X} ended by \end{Y}
    • other: 其他
  • compile() — 呼叫 pdflatex -interaction=nonstopmode,回傳結構化 [CompileError]
  • 輸出 compile-report.json
  • --fix 模式:自動修復簡單錯誤(加 $、加 \newcommand stub)

設計文件

詳見 docs/plans/2026-03-08-phase2-consolidation-design.md Part 2c

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions