I am trying to define a message that includes a computed number.
\RequirePackage{expl3}
\ExplSyntaxOn
\int_set:Nn \l_tmpa_int { 42 }
\msg_new:nnn { package } { message } {
The~number~ \int_use:N \l_tmpa_int ~is~too~large
}
\msg_error:nn { package } { message }
This results in
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! package error: "message"
!
! The number 42is too large
!
! See the package documentation for further information.
!
! Type <return> to continue.
!...............................................
Note the missing space after the number. To insert it I could
- make the number an argument, passed when the message is issued. This would take care of the problem in messages, but I suppose it to affect all output material.
- Replacing the space after the number with
\c_space_tl
also works. But this does not look like something\c_space_tl
was intended for. Is it even save to use\c_space_tl
or does it have to be wrapped in\tl_use:N
?
Is there a better or even recommended way to insert a space after such a LaTeX3 command?
\c_space_tl
good enough? You can also use\space
... – Werner Sep 23 '15 at 23:24\c_space_tl
just a\space
clone or does it do fancy stuff besides that? – 1010011010 Sep 23 '15 at 23:31\space
is not LaTeX3 and looks quite out of place.\c_space_tl
is from the context of token lists, so I wonder if it is semantically fit here. If the answer is yes, this should be the accepted answer to this question and I have a follow-up: Does it have to be wrapped in\tl_use:N
? – XZS Sep 23 '15 at 23:33\c_space_tl
is exactly the same as\space
. – egreg Sep 24 '15 at 7:26~
is not usable). – Bruno Le Floch Sep 24 '15 at 16:20