我有一个特定的 LaTeX 项目,它生成了一个 250 页的 PDF 文件,其日志文件中充满了“无数学字母表更改为冻结版本正常输入行等等”消息。事实上,该文件是这样的
syzygy:carcajes mariano$ grep -c 'No math alphabet' temas.log
19958
前几天我在评论中问过这个问题这个答案关于这一点,这似乎与一些更新有关,允许我们使用更多的数学字母,这总是好的。
我会将此归类为可用性错误。也许再节俭一点也无妨?
每行通常有几条消息:
syzygy:carcajes mariano$ grep ^ine temas.log | sort | uniq -c | sort -nr | head -n 1
159 ine 1956.
这个计数不是很精确,因为它可能累积了组成运行的几个 .tex 文件中从 1956 行开始的消息,但这些只有十二个文件。
答案1
\documentclass{article}
\usepackage[T1]{fontenc}
\DeclareSymbolFont{aa}{T1}{cmr}{m}{n}
\DeclareSymbolFont{bb}{T1}{cmr}{m}{n}
\DeclareSymbolFont{cc}{T1}{cmr}{m}{n}
\DeclareSymbolFont{dd}{T1}{cmr}{m}{n}
\usepackage{amsfonts,bm}
\DeclareSymbolFont{ee}{T1}{cmr}{m}{n}
\DeclareSymbolFont{ff}{T1}{cmr}{m}{n}
\begin{document}
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathit{A}$
$\mathsf{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathit{A}$
$\mathbf{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathit{A}$
$\mathtt{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathit{A}$
$\mathsf{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathit{A}$
$\mathbf{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathit{A}$
$\mathtt{A}$
$\mathtt{A}$
$\mathtt{A}$
$\mathtt{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
$\mathcal{A}\mathbb{A}\mathrm{A}\mathtt{A}$
\end{document}
产自grep 'math alphabet' file.log
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 149.
LaTeX Font Info: Freeze math alphabet allocation in version normal.
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: No math alphabet change to frozen version normal on input l
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: No math alphabet change to frozen version normal on input l
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
您可以通过在序言中添加以下内容来禁用新机制
\setcounter{localmathalphabets}{0}
但后来你得到了
! LaTeX Error: Too many math alphabets used in version normal.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.15 $\mathit{A}
$
?
这就是添加新机制的原因。
但是默认值是 2,因此您可以尝试将其设置为 1 或 0,以查看您的文档在没有本地分配的情况下是否可以工作。
如果没有,你可以添加
\makeatletter
\def\@font@info#1{}
\makeatother
要使字体信息消息静音,上述搜索将不会显示任何结果。
这可能被认为有点激进,所以第三种可能性是
\makeatletter
\let\old@font@info\@font@info
\def\@font@info#1{%
\expandafter\ifx\csname\detokenize{#1}\endcsname\relax
\old@font@info{#1}%
\fi
\expandafter\xdef\csname\detokenize{#1}\endcsname{}%
}
\makeatother
这样可以保证每个字体信息消息只发出一次,因此产生
$ grep 'math alphabet' file.log
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 149.
LaTeX Font Info: Freeze math alphabet allocation in version normal.
LaTeX Font Info: Undo math alphabet allocation in version normal on input li
LaTeX Font Info: No math alphabet change to frozen version normal on input l
答案2
大卫·卡莱尔演示如何禁用所有 LaTeX 字体信息或“安排每个字体信息消息仅发出一次”。作为第三种选择,只需通过以下方式抑制“不将数学字母表更改为冻结版本”消息:
\usepackage{xstring}
\makeatletter
\def\@font@info#1{%
\IfBeginWith{#1}{No math alphabet change to frozen version}{\relax}{%
\GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
{LaTeX Font Info: \space\space\space#1}%
}%
}%
\makeatother