## 编译环境 操作系统 * [x ] Windows 7/8/10 * [ ] macOS * [ ] Linux `若需勾选,请把[ ]改成[x]` Tex发行版 * [x ] TexLive `2020` * [ ] MikTeX `版本号` * [ ] CTeX `若需勾选,请把[ ]改成[x]` ## 我的问题 最简单的一段文档 ```\documentclass{article} \usepackage[UTF8]{ctex} \begin{document} zhfdf \end{document}``` 如果不加使用ctex的宏包,那么会正常编译通过,但加上宏包就会报错,如下: ``` (c:/Users/LibraFFly/libraffly/softWare/latex/texlive/2020/texmf-dist/tex/latex/ l3kernel/expl3.sty ! Undefined control sequence. l.58 \cs _if_exist:NF \c__expl_def_ext_tl ``` 这个报错是用的自带的Texworks软件,如果用TexStudio会报更多的错误,但最先出现错误的就是expl3.sty,如下: ``` 行 58: Undefined control sequence. \cs 行 58: Missing $ inserted. \cs_ 行 58: Missing \begin{document}. \cs_ 行 58: Double subscript. \cs_if_exist:NF \c__ 行 59: Undefined control sequence. { \tl 行 59: Double subscript. { \tl_const:Nn \c__ 行 60: Undefined control sequence. \cs 行 60: You can't use `macro parameter character #' in math mode. ...d:Npn \__kernel_sys_configuration_load:n # 行 63: Undefined control sequence. \cs 行 63: You can't use `macro parameter character #' in math mode. \cs_undefine:c { ver@ # 行 67: Argument of \@onefilewithoptions has an extra }. } 行 67: Paragraph ended before \@onefilewithoptions was complete. } 行 67: Missing $ inserted. } 行 67: Missing } inserted. } 行 67: Too many }'s. } 行 68: Undefined control sequence. \cs 行 68: Missing $ inserted. \cs_ 行 68: Missing \begin{document}. \cs_ 行 68: You can't use `macro parameter character #' in math mode. ...n \__kernel_sys_configuration_load_std:n # 行 70: Undefined control sequence. \cs 行 70: You can't use `macro parameter character #' in math mode. \cs_undefine:c { ver@ # 行 73: Argument of \@onefilewithoptions has an extra }. } 行 73: Paragraph ended before \@onefilewithoptions was complete. } 行 73: Missing $ inserted. } 行 73: Missing } inserted. } 行 73: Too many }'s. } 行 74: Undefined control sequence. \cs 行 74: Missing $ inserted. \cs_ 行 74: Missing \begin{document}. \cs_ 行 74: Missing { inserted. \cs_if_exist:NF \l__ 行 75: Undefined control sequence. { \clist 行 75: Missing { inserted. { \clist_new:N \l__ 行 79: Undefined control sequence. \keys 行 79: Double subscript. \keys_ 行 83: Undefined control sequence. { \sys 行 83: You can't use `macro parameter character #' in math mode. { \sys_load_backend:n {# 行 86: Undefined control sequence. \sys 行 87: Undefined control sequence. \debug 行 89: You can't use `macro parameter character #' in math mode. driver .meta:n = { backend = # 行 91: Undefined control sequence. \sys 行 94: Undefined control sequence. \sys 行 95: Undefined control sequence. \debug 行 98: Undefined control sequence. = \g 行 98: Missing { inserted. = \g__ 行 102: Undefined control sequence. \bool 行 102: Undefined control sequence. \bool_gset_true:N \g 行 102: Missing { inserted. \bool_gset_true:N \g__ 行 103: Undefined control sequence. \sys 行 106: Undefined control sequence. \keys 行 106: Missing { inserted. \keys_set:nV { sys } \l__ 行 107: Undefined control sequence. \str 行 108: Undefined control sequence. { \sys 行 109: Undefined control sequence. \cs 行 109: Undefined control sequence. \cs_if_exist:NT \@pushfilenameaux 行 111: Undefined control sequence. \cs 行 48: Missing $ inserted. 行 48: Missing } inserted. 行 48: Missing } inserted. 行 48: Missing } inserted. 行 48: Missing } inserted. 行 48: Missing } inserted. 行 48: Missing } inserted. 行 72: Missing $ inserted. \tl_clear_new:N \l_ 行 72: Missing \begin{document}. \tl_clear_new:N \l_ 行 72: Missing { inserted. \tl_clear_new:N \l__ 行 73: Missing { inserted. \int_new:N \l__ 行 74: Missing number, treated as zero. \box_ 行 74: Missing { inserted. \box_new:N \l__ 行 75: Missing { inserted. \dim_new:N \l__ 行 76: Undefined control sequence. \cs 行 76: Undefined control sequence. \cs_new_protected:Npn \ctex 行 76: You can't use `macro parameter character #' in math mode. ...new_protected:Npn \ctex_file_wrapper:nnn # 行 76: You can't use `macro parameter character #' in math mode. ...w_protected:Npn \ctex_file_wrapper:nnn #1# 行 76: You can't use `macro parameter character #' in math mode. ...protected:Npn \ctex_file_wrapper:nnn #1#2# 行 78: Undefined control sequence. \use 行 81: Missing number, treated as zero. \char_ 行 82: You can't use `macro parameter character #' in math mode. # 行 83: You can't use `macro parameter character #' in math mode. \exp_not:n {# 行 84: Undefined control sequence. \bool 行 84: Missing { inserted. \bool_if:NTF \l__ 行 87: Missing number, treated as zero. \char_ 行 87: Missing number, treated as zero. \char_set_catcode:nn { 64 } { \char_ 行 88: You can't use `macro parameter character #' in math mode. # 行 91: Undefined control sequence. \cs 行 91: Undefined control sequence. \cs_new_protected_nopar:Npn \ctex 行 91: You can't use `macro parameter character #' in math mode. ...w_protected_nopar:Npn \ctex_file_input:n # 行 92: Undefined control sequence. { \ctex 行 92: Undefined control sequence. { \ctex_file_wrapper:nnn { } { \file 行 92: You can't use `macro parameter character #' in math mode. ...ex_file_wrapper:nnn { } { \file_input:n {# 行 93: Undefined control sequence. \cs 行 93: Undefined control sequence. \cs_new_protected_nopar:Npn \ctex 行 93: You can't use `macro parameter character #' in math mode. ...protected_nopar:Npn \ctex_scheme_input:n # 行 95: Undefined control sequence. \ctex 行 98: Undefined control sequence. \tl 行 98: Double subscript. \tl_if_exist:NTF \c__ 行 100: Undefined control sequence. \file 行 100: You can't use `macro parameter character #' in math mode. ... \file_if_exist_input:nF { ctex-scheme- # 行 100: Double subscript. ...f_exist_input:nF { ctex-scheme- #1 - \c__ 行 101: Undefined control sequence. { \file 行 101: You can't use `macro parameter character #' in math mode. ... { \file_input:n { ctex-scheme- # 行 103: Undefined control sequence. { \file 行 103: You can't use `macro parameter character #' in math mode. { \file_input:n { ctex-scheme- # 行 107: Undefined control sequence. \cs 行 107: Undefined control sequence. \cs_generate_variant:Nn \ctex 行 108: Undefined control sequence. \int_new:N \g 行 108: Missing { inserted. \int_new:N \g__ 行 109: Undefined control sequence. \int_gset:Nn \g 行 109: Missing { inserted. \int_gset:Nn \g__ 行 110: Undefined control sequence. \msg 行 111: You can't use `macro parameter character #' in math mode. { Support~package~`# 行 113: You can't use `macro parameter character #' in math mode. ...e~an~up~to~date~version~of~the~package~`# 行 116: Undefined control sequence. \sys 行 117: Undefined control sequence. { \cs 行 117: Undefined control sequence. { \cs_new_eq:NN \ifctexpdf 行 3: Incomplete \if; all text was ignored after line 117. : Incomplete \if; all text was ignored after line 117. 行 58: Command \c invalid in math mode 行 59: Command \c invalid in math mode 行 58: Overfull \hbox (115.80017pt too wide) in paragraph 行 68: Overfull \hbox (20.03395pt too wide) in paragraph 行 74: Command \l invalid in math mode 行 75: Command \l invalid in math mode 行 106: Command \l invalid in math mode 行 107: Command \c invalid in math mode 行 48: Overfull \hbox (2088.27568pt too wide) in paragraph 行 98: Command \c invalid in math mode 行 100: Command \c invalid in math mode ``` 重装了几次也不行,有没有大佬帮忙解决一下哇!谢谢!

3 回答3

0
把 `\documentclass` 的内容也写上呗,差了那一句我们也复现不了问题呀。
  • 噢噢噢,写掉了,抱歉。我就是写的\documentclass{article} – 源稚。 2020-10-04 10:59 回复
0
https://github.com/CTeX-org/forum/issues/119
  • 这个我试了,还是一样的报错 – 源稚。 2020-10-04 11:23 回复
0
感谢大家,问题解决了,用```update-tlmgr-latest.exe```更新了tlmgr,然后把所有宏包更新了一遍,最后用```@sikouhjw```所给的命令执行完后就可以了。

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。