[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FR] Recognize L3 \msg_line_context: on warning parsing
From: |
Florent Rougon |
Subject: |
Re: [FR] Recognize L3 \msg_line_context: on warning parsing |
Date: |
Thu, 09 Sep 2021 00:30:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi,
Tassilo Horn <tsdh@gnu.org> wrote:
> We could do that only if l3msg is loaded for the current document. I
> would like to try it but cannot find out which TeXLive package I need
> for l3msg. I have
>
> texlive-{bin,core,latexextra,bibtexextra,pictures,science,fontsextra}
>
> but apparently there is no l3msg... Any hints?
l3msg is just this:
https://github.com/latex3/latex3/blob/main/l3kernel/l3msg.dtx
It's a “chapter” of the LaTeX kernel in its literate programming form
('texdoc interface3' calls it a module). There is no \usepackage nor any
'import'-alike thingy needed to have it available. If you run current
LaTeX, l3msg is there, in the format (in earlier releases of the LaTeX
kernel, \usepackage{expl3} was needed).
Unrelated to your question but related to the thread: there is another,
less common way to print error messages, which works in expansion-only
contexts: \msg_expandable_error:nnn and friends. Since neither \message
nor \write work in expansion-only contexts, \msg_expandable_error:nnn
works by triggering a specially crafted “Undefined control sequence”
error, as it seems. The result is slightly ugly as compared to normal
error messages, but this is the only way I know to print error messages
in expansion-only contexts. The attached document shows an example,
which yields the following output on the terminal:
./document.tex:19: Undefined control sequence.
<argument> \::error
! foo: This is an error message: 'some stuff'.
l.19 \edef\zzz{\foomsg{some stuff}
}
Regards
--
Florent
document.tex
Description: Expandable message printing