正如标题所述,当我使用 \bar 宏作为压力单位时,我收到“缺少 { 或忘记 \endgroup 错误”。这里给出了最小(不)工作示例:
\documentclass{article}
\usepackage{siunitx}
\begin{document}
$\SI{10}{\bar}$
\end{document}
LaTeX 似乎无法识别后者。错误消息如下:
! Missing { inserted.
<to be read again>
\egroup
l.6 $\SI{10}{\bar}
$
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
(If you're confused by all this, try typing `I}' now.)
! Missing } inserted.
<inserted text>
}
l.6 $\SI{10}{\bar}
$
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
[1
{C:/Users/lenna/AppData/Local/MiKTeX/pdftex/config/pdftex.map}]
(troubleshoot.aux) )
但是,当使用 \meter 而不是 \bar 时,它确实可以编译并给出预期的输出。尽管 bar 不是 SI 单位,但它在文档中列出,并且以前也曾使用过。我知道这个 MWE 可能可以在我的电脑以外的任何地方运行,所以我使用的是:MikTex 21.3 和 TeXMaker 5.0.4。
另外,当我尝试编译我的论文时,它会出现此类错误:
! Undefined control sequence.
<argument> \glo@symb:a@desc
l.5 ...tentrycounter[]{page}\glsnumberformat{34}}}
%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
似乎与词汇表包存在额外的冲突......
请有人帮帮我,我已经尝试了一切办法,但不知道问题出在哪里。
答案1
miktex 在 siunitx 更新方面有点落后。
在当前的 siunitx 中,您将获得更好的错误消息,以及以下帮助:
BIPM 已将此单位从 SI 手册中删除。您需要使用 \DeclareSIUnit 自行定义它。
因此,请考虑您是否真的要使用弃用的单位,如果是,请定义它。