论文写一半,latex 突然报错了,也没有加宏包什么的,后来发现模板也报错了,但之前都是好的。
19: Undefined control sequence. \ExplSyntaxOn 20: Undefined control sequence. \seq 20: Missing $ inserted. \seq_ 20: Missing \begin{documen}. \seq_ 20: Undefined control sequence. \seq_new:N \g 20: Missing { inserted. \seq_new:N \g__ 21: Undefined control sequence. \DeclareDocumentCommand 21: Undefined control sequence. \DeclareDocumentCommand \mathcolor 23: Undefined control sequence. \mode 23: \mathcolor allowed only in math mode. ...f_math:F { \non@alpherr {\mathcolor\space} 24: Undefined control sequence. \seq 24: Undefined control sequence. \seq_gpush:No \g 24: Missing { inserted. \seq_gpush:No \g__ 25: Undefined control sequence. \group 25: Undefined control sequence. \group_insert_after:N \use 26: Undefined control sequence. \IfValueTF 26: You can't use `macro parameter character #' in math mode. \IfValueTF {# 26: Illegal parameter number in definition of \@@mod. \IfValueTF {#1} { \color[#1]{#2} 26: Undefined control sequence. \IfValueTF {#1} { \color[#1]{#2} 26: Package xcolor Error: Undefined color model `##1'. \IfValueTF {#1} { \color[#1]{#2} 26: Extra }, or forgotten \endgroup. \IfValueTF {#1} { \color[#1]{#2} } 26: Illegal parameter number in definition of \XC@@tmp. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Undefined control sequence. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Missing number, treated as zero. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Undefined control sequence. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Undefined control sequence. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Missing } inserted. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Undefined control sequence. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Package xcolor Error: Undefined color model `##1'. ...lueTF {#1} { \color[#1]{#2} } { \color{#2} 26: Extra }, or forgotten \endgroup. ...eTF {#1} { \color[#1]{#2} } { \color{#2} } 27: You can't use `macro parameter character #' in math mode. # 29: Extra }, or forgotten \endgroup. } 30: Undefined control sequence. \cs 32: Undefined control sequence. \peek 34: Undefined control sequence. \group 35: Undefined control sequence. \token 37: Missing $ inserted. \c_ 37: Missing { inserted. \c_ 38: Missing $ inserted. \c_ 38: Missing { inserted. \c_ 39: Extra }, or forgotten $. } 42: Undefined control sequence. \token 44: Limit controls must follow a math operator. \limits 44: Limit controls must follow a math operator. \limits { \limits 45: Limit controls must follow a math operator. \nolimits 45: Limit controls must follow a math operator. \nolimits { \nolimits 46: Limit controls must follow a math operator. \displaylimits 46: Limit controls must follow a math operator. ... \displaylimits { \displaylimits 49: Undefined control sequence. \group 50: Undefined control sequence. ... \__mathcolor_scan_for_scripts:w \use 53: Undefined control sequence. \token 56: Missing { inserted. \c 56: Missing $ inserted. \c_ 56: Missing { inserted. \c_ 57: Extra }, or forgotten $. ... \exp_after:wN \prim@s \use 57: Undefined control sequence. ... \exp_after:wN \prim@s \use 58: Extra }, or forgotten $. } 60: Undefined control sequence. \group 62: Undefined control sequence. \seq 62: Undefined control sequence. \seq_gpop:NN \g 62: Missing { inserted. \seq_gpop:NN \g__ 65: Extra }, or forgotten $. } 66: Extra }, or forgotten $. } 67: Extra }, or forgotten $. } 68: Undefined control sequence. \cs 68: You can't use `macro parameter character #' in math mode. ...ected:Npn \__mathcolor_handle_scripts:Nw # 70: You can't use `macro parameter character #' in math mode. # 70: Missing $ inserted. #1 \c_ 70: Missing { inserted. #1 \c_ 70: Missing $ inserted. #1 \c_group_begin_token \c_ 70: Missing { inserted. #1 \c_group_begin_token \c_ 71: Undefined control sequence. \seq 71: Undefined control sequence. \seq_get:NN \g 71: Missing { inserted. \seq_get:NN \g__ 73: Undefined control sequence. \group 73: Missing $ inserted. \group_insert_after:N \c_ 73: Missing { inserted. \group_insert_after:N \c_ 74: Undefined control sequence. \group 75: Undefined control sequence. \peek 77: Undefined control sequence. \token 77: Missing $ inserted. ...token_if_eq_meaning:NNTF \l_peek_token \c_ 77: Missing { inserted. ...token_if_eq_meaning:NNTF \l_peek_token \c_ 79: Undefined control sequence. \group 80: Undefined control sequence. \peek 80: Missing $ inserted. \peek_catcode_remove:NT \c_ 80: Missing { inserted. \peek_catcode_remove:NT \c_ 81: Extra }, or forgotten $. } 83: Undefined control sequence. \exp_after:wN \group 84: Undefined control sequence. \use 84: Missing $ inserted. \use_ii_i:nn \c_ 84: Missing { inserted. \use_ii_i:nn \c_ 85: Extra }, or forgotten $. } 86: Extra }, or forgotten $. } 87: Extra }, or forgotten $. } 88: Undefined control sequence. \ExplSyntaxOff 802: Missing $ inserted. 6: Missing } inserted. \begin{document} 6: Missing $ inserted. \begin{document} 6: Missing } inserted. \begin{document} 6: Missing } inserted. \begin{document} : No journal specified, using default cha. 35: Command \l invalid in math mode 37: Command \c invalid in math mode : You have requested, on input line 109, version `2018/09/10' of package pdftexcmds, but only version `2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO)' is available.
根据最后一条我以为是 tex 或者 pdftex 或者 luatex 的版本问题,但我用的最新的 texlive2023 ,所有的宏包也是新的,然后即便我强制修改了 version 问题,其他的报错我也找不到解决方法。
TeX 3.141592653 (TeX Live 2023) pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023) This is LuaTeX, Version 1.16.0 (TeX Live 2023)
环境设置也没有问题,overleaf 可以用,但是由于我文档太大了编译时间超过了免费版的时间,所以选择本地编译,也不应该这么难吧。。。
texhash && fmtutil-sys --all
也试过了,没有用,包都是最新的。google 也搜不到相关资料,写一天论文 debug 半天也挺无力的。
1 barlogscc 2024-01-28 20:18:17 +08:00 via Android 用不同的编译器试试 |
2 sunzhuo 2024-01-28 20:43:37 +08:00 GPT4 pro 试了吗? |
![]() | 3 geelaw 2024-01-28 20:59:33 +08:00 via iPhone ![]() 技巧是看第一个错误,说的是 \ExplSyntaxOn 是未定义的控制序列,这是 LaTeX 3 的 expl3 功能,于是目前有两种可能,一是你的 TeX 没有支持它,二是某段代码破坏了这个控制序列。 我想提示到这里你可以继续尝试调试了。 |
4 ranaanna 2024-01-28 21:14:41 +08:00 如果编译通过和通不过之间环境没有任何变动,那么多半是有语法错误。 如果有变动,那么可能是用了过时的宏包。因为查了一下即使是“version `2018/09/10' of package pdftexcmds”也是过时的。也有可能是需要安装 pdftexcmds ,因为之前 pdftexcmds 是包含在 oberdiek 的,大概 19 年前后从后者分离出来了。所以如果近期更新了 oberdiek ,必须要新装 pdftexcmds ,参见 https://github.com/ho-tex |
![]() | 5 passive 2024-01-28 21:16:40 +08:00 via Android 不用去读错误报告,直接上 git bisect |
![]() | 6 A01514035 2024-01-28 21:20:17 +08:00 现在都用 overleaf 了,本地 latex 编译太恶心了。 |
7 HongyuGao 2024-01-28 21:25:09 +08:00 +1 ,第一次用,被报错给整麻了,效果也达不到预期。即使没有报错了还是会出现一些奇奇怪怪的表现,也不知道是哪里出的问题,问 gpt 也不知道该怎么描述 |
10 Cineray OP |
11 Cineray OP |
12 ranaanna 2024-01-28 21:48:11 +08:00 @Cineray 没有 latex3 ,已经停止开发了。但是相关的约定和概念都在 l3kernel 和 l3package 里面。如果要想有关的宏命令,要安装这两个包 |
![]() | 13 geelaw 2024-01-28 21:53:12 +08:00 via iPhone @A01514035 #6 我感到很困惑,因为 Overleaf 的在线编译用的是同一套软件,会出现的错误都是一样的。另外,由于通用性问题,在线每次都是全量重编译,比本地慢很多。 @ranaanna #9 我不知道,我个人使用的是 MiKTeX + 自动安装缺少的包,只会偶尔手动更新包到最新版,就没遇到过这种情况。 @Cineray #10 第一步是利用版本控制或者复制代码,不断删减直到得到较小的出错代码。 日志说第一个错误在第 19 行,后续包版本的问题却是第 109 行,并且中途显示 \begin{document} 是第 6 行,说明第一个错误不在 \begin{document} 所在的文件里面。 首先找到第一个错误所在的文件,然后找到你自己写的文件里面所有引用那个文件之前的内容并观察。 |
14 kenvix 2024-01-28 21:59:09 +08:00 ![]() latex 这东西的垃圾编译器是真的恶心,除了写论文我现在能 md 则 md ,不能 md 则 word ,最后才考虑 latex |
![]() | 16 zhuangzhuang1988 2024-01-28 22:44:36 +08:00 要不试试 Typst 虽然功能肯定没有 latex 强。 |
17 Cineray OP @zhuangzhuang1988 这种都是 paper 指定的 latex 模板。不然我觉得 word 也能写哈哈哈 |
![]() | 18 petermu 2024-01-29 00:18:49 +08:00 可以试试 TeXPage (www.texpage.com),免费版编译时长 1 分钟,大多数情况下 1 分钟够用了,TeXPage 提供 LaTeX 方面的技术支持服务,遇到问题可以通过发送邮件到 [email protected] 获取帮助。 |
19 RVRGnXxwawP5kwKW 2024-01-29 03:55:41 +08:00 via iPhone LaTeX 的 debug 确实非常麻烦,报错信息不直接,这是历史遗留问题基本上也无解了。 我的经验是,一步步把代码都注释了,直到不报错为止,然后一段段取消注释,应该就能定位到问题。 Overleaf 使用的 TeXlive ,所以 overleaf 能编译那么本地 texlive 应该也能编译。 |
20 dcoder 2024-01-29 04:54:22 +08:00 不写论文的话, 真是不想折腾这垃圾东西 |
![]() | 21 Masonn 2024-01-29 08:36:10 +08:00 用 IEEE Member 通过机构换 Overleaf 的订阅会员 |
![]() | 22 v2yllhwa 2024-01-29 08:56:37 +08:00 via Android texlive2023 我也用得有问题,切回上个版本了... |
23 Cineray OP @petermu 感谢推荐,刚刚试了一下,bib 链不上,ref 出不来,不知道哪里出了问题,我之后再研究研究。 @RVRGnXxwawP5kwKW 因为用了一个杂志的 cls 模板,内容比较多,定位起来非常耗时,后面试了一下 miktex 又好了,很奇怪。 @v2yllhwa 也是类似的问题吗?我到时候也切回 2022 试试 |
24 chengandc 2024-01-29 14:58:35 +08:00 可以试下这个 latex 在线协作编写器,https://scienhub.com/ |
![]() | 26 petermu 2024-02-29 15:30:54 +08:00 @Scirocco 学校整体采购有比较大的优惠,也会帮助对接学校的统一身份认证登录,您可以邮箱联系 [email protected] 获取报价单。 |