在熱力學函數上寫兩個下標

在熱力學函數上寫兩個下標

在 的熱力學模組中\chemmacro,我希望能夠定義兩個下標,一個在函數的左側,另一個在右側,如下圖所示

在此輸入影像描述

我嘗試

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{inputenc} 
\usepackage[french]{babel}

\usepackage{chemmacros}
\chemsetup{modules=all}

\RenewChemState\enthalpy{ subscript-left = ,subscript-right =  , unit=\joule} \par

\begin{document}
\enthalpy(r)(1){}
\end{document}

答案1

這就能解決問題:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{inputenc} 
\usepackage[french]{babel}

\usepackage[charter]{mathdesign}

\usepackage[modules={all}]{chemmacros}
\chemsetup{formula=chemformula,greek=mathdesign}

\RenewChemState\enthalpy{ symbol=H, subscript-left = ,subscript-right =  , unit=\joule}
\begin{document}
    \state_r{H}_1^0 = \qty{6}{\joule} \hspace{2cm}  
    \enthalpy(r, subscript-right= 1, superscript=0){6}
\end{document}

這些chemmacros模組現在作為選項載入。 new 中的選項ChemState會作為逗號分隔選項載入。

焓

筆記:我使用這一行定義一個新的得到相同的結果ChemState

\RenewChemState\enthalpy{ symbol=H, unit=\joule}

該條目symbol=H是必需的,而下標條目則不是。

筆記2:要在函數中使用參數,enthalpy需要定義一個新指令。例如這樣:

\newcommand{\argenthalpy}[4]{\chemDelta $_{\text{#1}}H_{#2}^{#3}$ = \qty{#4}{\joule} }

使用時,此指令接受四個放在大括號中的參數,如下所示:

\argenthalpy{r}{1}{0}{6}

輸出與其他兩個範例相同。

相關內容