latex runtime error with Xelatex compiler

Viewed 2425

environment: ubuntu18.04 + texlive-2020 + texstudio

I have successfully installed texlive and made sure by testing with latex -v ; xelatex -v, and they worked just fine. And in texstudio I finished configuring my texstudio with latex, pdflatex, xelatex and lualatex path.

Here is my latex code, which is very easy to read:

\documentclass{article}

\usepackage{xeCJK}

\begin{document}
    
    hello,你好
    
\end{document}

However when I compiling with xelatex, I came up with such error: (I build it with pdflatex compiler and it worked just fine without chinese.)

expl3.sty error: line 148

File ended while scanning use of \__sys_tmp:w. { \sys_load_backend:n { } }

Missing number, treated as zero. { \sys_load_backend:n { } }

Missing = inserted for \ifnum. { \sys_load_backend:n { } }

Missing number, treated as zero. { \sys_load_backend:n { } }

xeCJK.sty error:

TeX capacity exceeded, sorry [save size=80000]. \xeCJKResetCharClass

And I saw the snippet expl3.sty line 148:

{ \sys_load_backend:n { } }

With neither any parentheses error nor syntax error, how does this error come out?(The exceeding error maybe caused by other errors, I believed.) My latex build log:

(/usr/local/texlive/2020/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2021-01-09 L3 programming layer (loader) 

(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
File: l3backend-xetex.def 2020-01-29 L3 backend support: XeTeX

(|extractbb --version))
Runaway argument?
\q_stop <\__int_eval:w \c_zero_int \__int_eval_end: \exp_after:wN \use_ii:nnn \
ETC.
! File ended while scanning use of \__sys_tmp:w.
<inserted text> 
                \par 
l.148   { \sys_load_backend:n { } }
                                   
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Missing number, treated as zero.
<to be read again> 
                   \__kernel_tl_set:Nx 
l.148   { \sys_load_backend:n { } }
                                   
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing = inserted for \ifnum.
<to be read again> 
                   \__kernel_tl_set:Nx 
l.148   { \sys_load_backend:n { } }
                                   
I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero.
<to be read again> 
                   \__kernel_tl_set:Nx 
l.148   { \sys_load_backend:n { } }
                                   
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

)
Package: xeCJK 2020/10/19 v3.8.6 Typesetting CJK scripts with XeLaTeX

(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
Package: l3keys2e 2020-10-27 LaTeX2e option processing using LaTeX3 keys
)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st
y
Package: xtemplate 2020-10-27 L3 Experimental prototype document functions
\l__xtemplate_tmp_dim=\dimen139
\l__xtemplate_tmp_int=\count181
\l__xtemplate_tmp_muskip=\muskip16
\l__xtemplate_tmp_skip=\skip49
) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
Package: xparse 2020-10-27 L3 Experimental document command parser

(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-generic.
tex))
\l__xeCJK_tmp_int=\count182
\l__xeCJK_tmp_box=\box47
\l__xeCJK_tmp_dim=\dimen140
\l__xeCJK_tmp_skip=\skip50
 (/usr/local/texlive/2020/texmf-dist/tex/latex/ctex/ctexhook.sty
Package: ctexhook 2020/10/19 v2.5.5 Document and package hooks (CTEX)
)
\g__xeCJK_space_factor_int=\count183
\l__xeCJK_begin_int=\count184
\l__xeCJK_end_int=\count185
\c__xeCJK_CJK_class_int=\XeTeXcharclass1
\c__xeCJK_FullLeft_class_int=\XeTeXcharclass2
\c__xeCJK_FullRight_class_int=\XeTeXcharclass3
\c__xeCJK_HalfLeft_class_int=\XeTeXcharclass4
\c__xeCJK_HalfRight_class_int=\XeTeXcharclass5
\c__xeCJK_NormalSpace_class_int=\XeTeXcharclass6
\c__xeCJK_CM_class_int=\XeTeXcharclass7
\c__xeCJK_HangulJamo_class_int=\XeTeXcharclass8

! TeX capacity exceeded, sorry [save size=80000].
<argument> ..._xeCJK_begin_int =\l__xeCJK_tmp_int 
                                                  \int_incr:N \l__xeCJK_begi...
l.656 \xeCJKResetCharClass
                          
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.

 
Here is how much of TeX's memory you used:
 973 strings out of 477220
 23745 string characters out of 5830450
 300467 words of memory out of 5000000
 20745 multiletter control sequences out of 15000+600000
 403438 words of font info for 28 fonts, out of 8000000 for 9000
 1348 hyphenation exceptions out of 8191
 67i,0n,75p,234b,80001s stack positions out of 5000i,500n,10000p,200000b,80000s
No pages of output.

So my question is:

  1. what is \sys_load_backend, is it a keyword?
  2. Is expl3.sty file broken? If it is, how can I fix it?
  3. The worst condition: Do I need to reset texlive? Though I have done this twice :(
4 Answers

I have solved this problem by Adding TexLive to TexStudio's understanding of path:

  1. Open "Configure TeXstudio..." from the "Options" dropdown menu.
  2. Check "Show Advanced Options".
  3. Go to the "Build" section.
  4. In the "Build Options", fill in the TeXLive bin directory in the "Commands ($PATH)" field.

I use miktex portable on win10 and I have got an identical error. This is what I found out:

  1. \sys_load_backend ist not the important thing, it is __sys_tmp:w instead. This code can be found in the file l3backend-xetex.def and leads the way to the solution, see below
  2. No, expl3.sty is not broken. The occurence of this file is only a symptom, but has no correlation with the error and its cause.
  3. I think the installation doesn't need to be reset; my error log file gave me this additional information, leading to the true reason:

File: l3backend-xetex.def 2021-03-18 L3 backend support: XeTeX ())
Runaway argument? Der Befehl "extractbb" ist entweder falsch geschrieben oder konnte ni\ETC. ! File ended while scanning use of __sys_tmp:w.

l3backend-xetex.def has __sys_tmp:w and very close to it a call of extractbb.exe, which obviously cannot be found in my portable installation. I fixed it his way: Add the full path to extractbb.exe to your windows system environment variables (resp. the equivalent in unix). Then it is not exactly portable anymore but at least it works. Hope this will be fixed...

I've encountered the same problem (but with CentOS 7 + TeXLive 2021) when compiling in the command line.

I've found the solution, which is simply inserting /YOUR-PATH-TO-TEXLIVE/bin/x86_86-linux/ to the first of my $PATH. I think I fix this since I have multiple versions of TeX systems installed.

Either using an explicit absolute path to xelatex binary or insert the path to xelatex posterior to other existing TeX system's path fails in my case.

I also use miktex installer version on win10 and I got the identical error as @Mark. The solution of mine is simple: run Texworks with rights of administrators. This will fix the problem.

Related