正确的代码无法编译(在 Texmaker 中):由于依赖性?

正确的代码无法编译(在 Texmaker 中):由于依赖性?

我最初的目标是创建具有某些属性的表,在这里我得到了一个很好的答案:我想要的。不幸的是,在 Texmaker 中运行它确实给了我一个致命错误。不过,代码本身是正确的,因为我在一些在线 LaTeX 编辑器中尝试过它。我不确定为什么它不能编译。代码如下:

\documentclass[12pt]{article}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters suitably
\usepackage{booktabs}
\usepackage{siunitx} % for 'S' column type
\newcolumntype{T}[1]{S[table-format=#1]} % handy shortcut macro

\begin{document}

\noindent
\begingroup % localize scope of the next instruction
\setlength\tabcolsep{0pt} % let LaTeX figure out intercol. sapce
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} 
    c *{3}{T{2.1}T{2.1}T{3.0}} }  
\toprule
$N_p$ & \multicolumn{3}{c}{Isotropic}
      & \multicolumn{3}{c}{Inpainting Once}
      & \multicolumn{3}{c}{Inpainting Twice} \\
\cmidrule{2-4} \cmidrule{5-7} \cmidrule{8-10}
& {error} & {correlation} & {time} & 
  {error} & {correlation} & {time} & 
  {error} & {correlation} & {time} \\ 
\midrule
10 & 13.6 & 98.4 & 113 & 12.4 & 98.7 & 285 & 12.3 & 98.7 & 411 \\
15 &  8.4 & 99.4 & 135 \\
20 &  6.2 & 99.7 & 140 \\
\bottomrule
\end{tabular*}
\endgroup

\end{document}

欢迎任何建议。

第一行错误:

Package: l3keys2e 2020-02-14 LaTeX2e option processing using LaTeX3 keys
)
\l__siunitx_tmp_box=\box48
\l__siunitx_tmp_dim=\dimen159
\l__siunitx_tmp_int=\count183
! LaTeX3 Error: '\tl_to_lowercase:n' deprecated on 2018-03-05. Use
(LaTeX3) '\tex_lowercase:D '.
Type <return> to continue.
...
l.318 \tl_to_lowercase:n
{
LaTeX does not know anything more about this error, sorry.

答案1

通过分析 OP 日志文件,我们发现 MikTeX 正在加载一个额外的文件夹,其中有一个siunitx版本自称为

Package: siunitx 2012/07/16 v2.5f A comprehensive (SI) units package

这当然与现代版本的expl3软件包不兼容。

如果不需要那个额外的根文件夹,则在 MikTeX 设置中禁用额外的根文件夹。

如果额外文件夹中有需要的内容,则重命名siunitx.sty其中的超旧版本。

相关内容