Closed akiyks closed 6 months ago
Ah,
\IfInstanceExist(TF)
were reintroduced to the kernel in commit latex3/latex2e@41f33bc4 (Re-introduce \IfInstanceExist(TF), 2024-02-15). It's just not included in any public nor dev releases.
https://github.com/latex3/latex3/issues/1514#issuecomment-2014349473
So the problem is already fixed in latest code base (of the LaTeX2e kernel), and what you encountered with xelatex-dev
is a temp situation.
So the problem is already fixed in latest code base (of the LaTeX2e kernel), and what you encountered with
xelatex-dev
is a temp situation.
Thank @muzimuzhi for taking the time!
As a workaround with LaTeX2e 2024-06-01 pre-release 1, you can add definitions of \IfInstanceExist(TF)
manually, before loading xeCJK
, or even before \documentclass
.
\ExplSyntaxOn
\cs_if_exist:NF \IfInstanceExistTF
{
\cs_new:Npn \IfInstanceExistTF #1#2
{ \__template_if_instance_exist:nnTF {#1} {#2} }
\cs_new:Npn \IfInstanceExistT #1#2
{ \__template_if_instance_exist:nnT {#1} {#2} }
\cs_new:Npn \IfInstanceExistF #1#2
{ \__template_if_instance_exist:nnF {#1} {#2} }
}
\ExplSyntaxOff
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Noto Serif CJK SC}
\begin{document}
中文 \LaTeX 示例。
\end{document}
A more robust workaround which works for both 2023-11-01 and 2024-06-01 pre-release 1 LaTeX2e releases would be
\ExplSyntaxOn
\makeatletter
\bool_lazy_all:nT
{
{ ! \cs_if_exist_p:N \IfInstanceExistTF } % just in case
{ \str_if_eq_p:ee { \fmtversion } { 2024-06-01 } }
{ \str_if_eq_p:ee { \patch@level } { -1 } }
}
{
\cs_new:Npn \IfInstanceExistTF #1#2
{ \__template_if_instance_exist:nnTF {#1} {#2} }
\cs_new:Npn \IfInstanceExistT #1#2
{ \__template_if_instance_exist:nnT {#1} {#2} }
\cs_new:Npn \IfInstanceExistF #1#2
{ \__template_if_instance_exist:nnF {#1} {#2} }
}
\makeatother
\ExplSyntaxOff
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Noto Serif CJK SC}
\begin{document}
中文 \LaTeX 示例。
\end{document}
But unfortunately it makes use of LaTeX2e internals.
FYI, a new pre-release, LaTeX2e 2024-06-02 pre-release 2 is now available from CTAN mirrors, which resolves the problem reported here.
MWE (test.tex):
Running
xelatex test.tex
works fine, provided "Noto Serif CJK" font is available. Runningxelatex-dev test.tex
stops with:It might well be an intermittent regression in -dev packages, but can someone have a look into this?