概述
執行 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
概述
執行
pdflatex編譯並解析 log 檔,將錯誤分類為結構化報告。檔案
packages/pdf-to-latex-swift/Sources/PDFToLaTeXCore/TexCompileChecker.swiftpackages/pdf-to-latex-swift/Tests/PDFToLaTeXCoreTests/TexCompileCheckerTests.swift功能
.log檔,分類錯誤:undefinedCommand:! Undefined control sequencemissingMath:! Missing $ insertedmissingBrace:! Missing } insertedenvironment:! LaTeX Error: \begin{X} ended by \end{Y}other: 其他pdflatex -interaction=nonstopmode,回傳結構化[CompileError]compile-report.json$、加\newcommandstub)設計文件
詳見
docs/plans/2026-03-08-phase2-consolidation-design.mdPart 2c