Skip to content

Fix log file tracking after unterminated info messages - #1732

Merged
deathaxe merged 2 commits into
SublimeText:masterfrom
ultravioletcatastrophe:fix/unterminated-info-log-parsing
Dec 2, 2026
Merged

deathaxe merged 2 commits into
SublimeText:masterfrom
ultravioletcatastrophe:fix/unterminated-info-log-parsing

Conversation

@ultravioletcatastrophe

Copy link
Copy Markdown
Contributor

Problem

On TeX Live with the Traditional Builder, an undefined command can produce running latexmk...error, followed by No errors. Warnings: and [Build failed!], with no source location. The .log still contains an ordinary ! Undefined control sequence. and l.<number>.

Reproduced with Sublime Text 4215, LaTeXTools 4.5.17 (also current master), latexmk 4.88 and TeX Live 2026 on macOS.

Minimal reproductions

A four-line example matching the original report:

\documentclass[debug,nobib]{tufte-book}
\begin{document}
\doesnotexist Hello.
\end{document}

A single-file example requiring only the standard article class:

\documentclass{article}
\typeout{Package demo Info: Message without a final period}
\newcount\democount
\begin{document}
\doesnotexist Hello.
\end{document}

Build with the default Traditional Builder, or generate the log using:

latexmk -cd -f -pdf -interaction=nonstopmode -synctex=1 -silent main.tex

The TeX error is intentional. The bug is the missing diagnostic/location, not the nonzero exit status.

Cause and fix

latexmk -silent appends -interaction=batchmode, changing where blank lines appear in the log. Unterminated Info: messages can then absorb register allocations and subsequent file-opening records. log-cmd-args can mistake the next file opening for a multiline parenthesized command argument; later closing parentheses corrupt the source-file scopes.

parse_log_view.extract_items recognizes the exception but only emits items inside a meta.block.log region. After the root file scope ends prematurely, later exceptions are silently discarded. This also explains misattributed warnings.

The change keeps register allocations out of info messages and reuses the existing blocks parser for file records encountered inside those messages. No builder or error-text special cases are added.

This is distinct from #1718: the reproduction uses TeX Live and the traditional ! / l.N error format, not MiKTeX's file:line error format.

Verification

  • Both new parser regression tests fail on the installed/original syntax and pass with the fix: one covers dropped exceptions, the other covers nested-file attribution and parenthesized message continuations.
  • All 695 syntax assertions pass (643 log-syntax assertions including the new cases, plus 52 build-output assertions), using Sublime's native syntax-test API.
  • Ran the real Traditional Builder inside Sublime with the patched syntax, display_log: false, and the Tufte MWE. The build panel reports tufte-patched.tex:3: Undefined control sequence ...; find_all_results() includes that source file at line 3. The build correctly remains failed because the undefined command is intentional.
  • Also verified the workaround on the unmodified installed syntax: builder_settings.display_log: true selects -verbose, keeps nonstopmode, and produces the source diagnostic in the real build panel. A top-level display_log setting is ignored. The troubleshooting docs include the correct nesting and the need to regenerate a cached failed log.
  • Full log-parser suite on this Mac: 11/12 pass after the fix. The existing test_filepath_processing fails both before and after, on Windows-path normalization/order; it is intentionally unchanged. Before the fix, the two new regressions fail in addition to that existing failure.

No private document source or full document log is included.

@ultravioletcatastrophe
ultravioletcatastrophe force-pushed the fix/unterminated-info-log-parsing branch from fe15619 to c17e6b7 Compare November 3, 2026 07:27

@deathaxe deathaxe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting and opening a PR.

Here are some suggestions for a more general fix.

Comment thread LaTeXTools Log.sublime-syntax Resolved
Comment thread LaTeXTools Log.sublime-syntax Resolved
@deathaxe
deathaxe merged commit 6692f2d into SublimeText:master Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants