幾天以來:使用 \listoftables 或 \listoffigures 時 mhchem 出現問題

幾天以來:使用 \listoftables 或 \listoffigures 時 mhchem 出現問題

我在處理包裹時遇到了麻煩mhchem。當我有一個帶有涉及環境的單獨目錄條目的圖時\ce{},我收到錯誤訊息,指出控制序列\aaaa未定義。幾天前另一位也遇到了同樣的問題,透過重新安裝 MiKTeX 解決了,但這對我來說不起作用。在家裡,使用舊版本的軟體包,MWE 可以工作,但在新版本中則不行。這是我的 MWE:

\documentclass{scrreprt}
\usepackage[T1]{fontenc}            
\usepackage[version=3]{mhchem}  
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\begin{figure}[htbp]
\centering
test
\caption[\ce{SiO2}]{\ce{SiO2}}
    \label{fig:test}
\end{figure}
\end{document}

謝謝你的幫忙!同一個版本的文件幾天前運行沒有任何問題!

答案1

我的猜測是新版本的軟體包中存在一些錯誤輸入。我附上了我認為應該在那裡使用的補丁。

%! *latex malmhchem.tex
%   two runs
\documentclass{scrreprt}
\usepackage[T1]{fontenc}            
\usepackage[version=3]{mhchem}  
\begin{document}
\def\aaaa#1{\ce{#1}}
\chapter{Chemistry}
\section{My mhchem}
Some text.
\tableofcontents
\listoffigures
\listoftables
\begin{figure}[!htbp]
\centering Testing phase.
\caption[\ce{SiO2}]{\ce{SiO2}}
    \label{fig:test}
\end{figure}
\end{document}

姆韋

答案2

哎呀! 3.17 版修復了該問題並將很快推出。

2014-03-27 mhchem v3.17
• fix of the 3.16 expansion fix – sorry, my quality control failed

相關內容