New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
l3text: \c_group_begin_token and \c_group_end_token are not handled correctly #874
Comments
One option to handle this would be for \documentclass{minimal}
\ExplSyntaxOn
\cs_gset:Npn \__text_expand_store:n #1
{ \__text_expand_store:nw { \exp_not:n {#1} } }
\cs_gset:Npn \__text_expand_store_e:n #1
{ \__text_expand_store:nw {#1} }
\cs_gset:Npn \__text_expand_end:w #1 \__text_expand_result:n #2
{
\group_align_safe_end:
\exp_after:wN \exp_end:
\tex_expanded:D {#2}
}
\cs_gset:Npn \__text_expand_N_type_auxii:N #1
{
\token_if_eq_meaning:NNTF #1 \c_group_begin_token
{
\__text_expand_store_e:n { { \if_false: } \fi: }
\__text_expand_loop:w
}
{
\token_if_eq_meaning:NNTF #1 \c_group_end_token
{
\__text_expand_store_e:n { \if_false: { \fi: } }
\__text_expand_loop:w
}
{ \__text_expand_N_type_auxiii:N #1 }
}
}
\edef\x{\text_expand:n { \bgroup é \egroup }}\show\x
\stop But it would fail miserably if |
Why is |
I guess it depends a bit on the scope of “what should |
Equivalent to |
We can actually. |
@josephwright not true, we already know the difference, since by the time we handle |
Imho, |
@PhelypeOleinik but the argument is (per documentation) formatted text, so could contain markup (and it might be possible that some markup is mistakenly not defined as |
Related issue. The blanket statement "Implicit tokens are converted to their explicit equivalent." in the documentation of
I think this code might historically be why
|
Note that the rationale for, use of and inputs to these 'text altering commands' and related concepts needs revisiting. So there is not much point in discussing right now most of the details of 'what should happen to xyz'. But meanwhile, fixes should be added for gross infelicities such as the origin of this issue, and maybe a small number of the other contributions. |
@blefloch wrote
Indeed, this doesn't make sense. The 11/2 distinction doesn't make sense here, so I am adjusting to 'if it's a space, make a space, otherwise make an other char'. I think that should be clear enough. |
@blefloch asked
Good question! I suspect possibly not but we will need quite a bit of data, etc., to map characters otherwise. I think one to address as and when we find issues: at least at present we get 'something' out. |
OK, reading back the code comments I remember now why this code is there. If you look at the current comments, the aim is to deal with not only Looking back, it's probably better to leave all implicit chars alone in At least a couple of commits coming up. |
leaving as-is in |
Inside of
\text_expand:n
the tokens\c_group_begin_token
and\c_group_end_token
aren't handled correctly. Instead of shipping tokens to the output of\text_expand:n
they will leave{ \if_false: } \fi:
and\if_false: { \fi: }
, respectively, in the input stream in front of the\exp:w
-expansion, and place the next loop iteration afterwards.This results in a low level
Missing number, treated as zero.
error being thrown.MWE:
The text was updated successfully, but these errors were encountered: