Skip to content
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

New release breaks in ConTeXt MkIV (LuaTeX) #800

Closed
ghost opened this issue Sep 4, 2020 · 2 comments
Closed

New release breaks in ConTeXt MkIV (LuaTeX) #800

ghost opened this issue Sep 4, 2020 · 2 comments
Assignees
Labels
bug Something isn't working generic-mode Use with plain TeX or ConTeXt l3backend Issues with the low-level backend code

Comments

@ghost
Copy link

ghost commented Sep 4, 2020

The previous release worked fine with ConTeXt (LuaTeX). However, now the following input:

\input expl3-generic
\starttext ... \stoptext

Gives the following message:

tex error       > tex error on line 43 in file <path/to/l3backend>/l3backend-luatex.def: ! Undefined control sequence

\__file_mismatched_dependency_error:nn ...oup_begin: \cs_set:Npn \\{\MessageBreak }\cs_set_eq:NN \ \c_space_tl \@latex@error 
                                                                                                                             {Mismatched LaTeX support files detected.\\Loading '#2' aborted!\tl_if_exist:NT \c__kernel_expl_date_tl {\\\\The L3 progra...
l.43   }
      

33           {l3backend-luatex.def}
34       }
35       {
36         \cs_if_exist_use:cF { @latex@error } { \errmessage }
37           {
38             Mismatched~LaTeX~support~files~detected. \MessageBreak
39             Loading~aborted!
40           }
41           { \use:c { @ehd } }
42         \tex_endinput:D
43 >>    }
44     \cs_new_eq:NN \__kernel_backend_literal:e \tex_special:D
45     \cs_new_protected:Npn \__kernel_backend_literal:n #1
46       { \__kernel_backend_literal:e { \exp_not:n {#1} } }
47     \cs_generate_variant:Nn \__kernel_backend_literal:n { x }
48     \cs_new_protected:Npn \__kernel_backend_literal_pdf:n #1
49       {
50         \tex_pdfextension:D literal
51           { \exp_not:n {#1} }
52       }
53     \cs_generate_variant:Nn \__kernel_backend_literal_pdf:n { x }
@josephwright josephwright added bug Something isn't working generic-mode Use with plain TeX or ConTeXt l3backend Issues with the low-level backend code labels Sep 4, 2020
@ghost
Copy link
Author

ghost commented Sep 5, 2020

I've just played a bit and I see the following works:

\unprotect
\def\@latex@error#1#2{}
\protect 

\input expl3-generic

\ExplSyntaxOn
\cs_new_protected:Npn \myuppercase #1
{\text_uppercase:n{#1}}
\ExplSyntaxOff
\starttext  
\myuppercase{aéreos août}
\stoptext 

I've tested random examples from StackExchange and they seem to work fine in ConTeXt.

Some commands as \@latex@error (the apparent culprit), \MessageBreak or \@ehd are only defined on LaTeX. I could copypaste them from LaTeX as a temporary fix, but I'm not sure that's a good idea. In the meanwhile, is it safe to silence the error message?

@PhelypeOleinik
Copy link
Member

The problem was that when I wrote the version-check code for expl3 I forgot to define the token list to track the current expl3 date in the generic loader. I pushed a fix to this, so loading in generic mode should work properly in the next release.


About your workaround:

Redefining an error message command (such as \@latex@error) is never the right solution, as the error happens anyhow: you just don't see the pretty-printed message telling you what happened (though here the situation is really not good: the error message isn't printed at all, due to the missing \@latex@error, so your workaround is not entirely bad).

However defining \def\@latex@error#1#2{} doesn't solve the problem, as the loading of the backend files would be interrupted anyhow, so backend-dependent operations (drawing, colour, transformation, etc.) would be broken:

\unprotect
\def\@latex@error#1#2{}
\protect

\input expl3-generic

\starttext
\ExplSyntaxOn
\hbox_set:Nn \l_tmpa_box { x }
\box_scale:Nnn \l_tmpa_box { 2 } { 2 }
x\box_use:N \l_tmpa_box
\ExplSyntaxOff
\stoptext

A less worse workaround would be to define \c__kernel_expl_date_tl to match the current expl3 date in your distribution:

\unprotect
\def\c__kernel_expl_date_tl{2020-09-03}
\protect

so the backend files will load cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working generic-mode Use with plain TeX or ConTeXt l3backend Issues with the low-level backend code
Projects
None yet
Development

No branches or pull requests

2 participants