正確列印化學符號詞彙表

正確列印化學符號詞彙表

程式碼

\documentclass{article}

\usepackage{glossaries} % Load the package
\makeglossaries % Generate the glossary
\usepackage{mhchem}

\begin{document}

\newglossaryentry{co2}{name=CO2, description={Carbon Dioxide}}

Calculation of the corresponding \gls{co2} emissions to cover the surplus in electricity demand. 

\printglossary[type=acronym,title={List of Abbreviations}]
% \printglossaries

\end{document}

我讀了這個其實施。我明白了

在此輸入影像描述

您看到的另一個問題是符號的下標列印不正確。

我想獲得“詞彙表縮寫”部分,包含許多項目的範例輸出

在此輸入影像描述

如何正確列印詞彙表和章節?

如何正確列印化學符號的術語表參考?

答案1

正如 mhchem 答案中一樣,使用\ce{CO2}來獲得正確的格式。

如果您想列印“縮寫清單”,請glossaries使用下列選項載入套件acronym

\usepackage[acronym]{glossaries} % Load the package

並將您的條目定義為首字母縮寫詞 \begin{document},例如

\newacronym{co2}{\ce{CO2}}{Carbon Dioxide}

微量元素:

\documentclass{article}
\usepackage[acronym]{glossaries} % Load the package
\makeglossaries % Prepare the glossary
\usepackage[version=3]{mhchem}

\newacronym{co2}{\ce{CO2}}{Carbon Dioxide}

\begin{document}

Calculation of the corresponding \gls{co2} emissions to cover
the surplus in electricity demand.

\printglossary[type=acronym,title={List of Abbreviations}]
%\printglossaries

\end{document} 

輸出:

在此輸入影像描述

答案2

這是獲得答案的第一步。要獲取化學符號,請使用此

\documentclass{article}
\usepackage{glossaries} % Load the package
%\makeglossaries % Prepare the glossary
\usepackage[version=3]{mhchem}
\begin{document}

\newglossaryentry{co2}{name={\ce{CO2}}, description={Carbon Dioxide}}

Calculation of the corresponding \gls{co2} emissions to cover
the surplus in electricity demand. 

%\printglossary[type=acronym,title={List of Abbreviations}]
% \printglossaries

\end{document}

在測試過程中,每次更改詞彙表條目時,我都必須刪除 .glsdefs 檔案。

現在您需要的是對 .gls 檔案執行排序程式。你必須告訴它,排序鍵\ce{CO2}應該是CO2。其他人可能會幫助你解決這個問題。

相關內容