Skip to content

What the document said reaches the caller - #361

Merged
tannevaled merged 1 commit into
mainfrom
message-channel
Sep 13, 2026
Merged

tannevaled merged 1 commit into
mainfrom
message-channel

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

\message and \typeout are the one channel TeX gives a source for reporting what it decided — which branch an \ifx took, which driver a package picked, what \the of a length holds. A real TeX prints it to the terminal and the log.

The engine collected it all along: Run returns it as its first result. But the rendering entry points (CompileToPDFDiag and the rest) did not, so every tool built on them was deaf to it — gotex included. Diagnosing pgf today, a probe written the way TeX documents it printed nothing, and the answers had to be typeset onto a page and read back with pdftotext instead.

$ gotex -messages doc.tex
gotex: wrote doc.pdf (1 page)
gotex: the document said:
[hello 345.0pt]

Diagnostics gains Messages; gotex gains -messages. Off by default, and no heading is printed when the document said nothing, so a quiet render stays quiet. All three states are tested.

🤖 Generated with Claude Code

\message and \typeout are the one channel TeX gives a SOURCE for reporting what
it decided — which branch an \ifx took, which driver a package picked, what \the
of a length holds. A real TeX prints it to the terminal and the log.

The engine collected it all along: Run returns it as its first result. But the
rendering entry points (CompileToPDFDiag and the rest) did not, so every tool
built on them was deaf to it — including our own gotex. Diagnosing pgf today, a
probe written the way TeX documents it printed nothing at all, and the answers
had to be typeset onto a page and read back with pdftotext instead.

Diagnostics gains Messages, and gotex a -messages flag that prints it to stderr.
Off by default, and it prints no heading when the document said nothing, so a
quiet render stays quiet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 7c0dfd2 into main Sep 13, 2026
18 checks passed
@tannevaled
tannevaled deleted the message-channel branch September 13, 2026 04:01
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.

1 participant