我很难“粗体版本中的数学字母太多”错误。这是最新版本的 Texlive 附带的最小工作示例Ubuntu 18.04:
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
$\widetilde{\boldsymbol{\mathsf{x}}}_n$
\begin{equation}
\widetilde{\boldsymbol{\mathsf{x}}}_n
\end{equation}
\end{document}
我一直在寻找,但找不到导致错误的原因。似乎同时存在\widetilde{\boldsymbol{\mathsf{x}}}_n
内联和显示的方程式会导致此错误,但我完全不知道为什么以及如何修复此错误 :-(。
我的问题: 有没有办法来解决这个问题?
非常感谢任何帮助/提示。
PS 1:此错误似乎与 “数学字母太多”错误 所以我相信它不是重复的。
PS 2:正如 David Carlisle 在评论中指出的那样,日志文件中的第一个错误是
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax \ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup
答案1
我认为你只需要这个修复
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
\def\@mathmeasure#1#2#3{\setbox#1\hbox{%
\m@th$#2#3$}}
\makeatother
\begin{document}
$\widetilde{\boldsymbol{\mathsf{x}}}_n$
\begin{equation}
\tracingall
\widetilde{\boldsymbol{\mathsf{x}}}_n
\end{equation}
\end{document}
注意当前 amsmath 来源说
% As of 2018/12 release we don't turn off |\evermath| as this
% optimization can be harmful.
% \changes{v2.17b}{2018/12/01}{Don't drop \cs{frozen@everymath}}
那可能是我,但我不记得了,也许是弗兰克:-)
作为基本规则仅有的查看报告的第一个错误。数学字母错误完全是虚假的,但要得到它,您需要超过 18!!!!早期的错误消息:
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathsf \fi \use@mathgroup...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! Undefined control sequence.
<argument> \@nil
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
?
! LaTeX Error: Too many math alphabets used in version bold.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.8 \widetilde{\boldsymbol{\mathsf{x}}}
_n
? x