我想使用 mhchem 套件寫出含水碳酸根離子的公式。如果我寫出 CO3^{2-},它看起來應該是這樣的。 (見圖。)
但是,我想寫出:CO3^{2-}_{(aq)}。 2-電荷沿著 (aq) 狀態符號的右側移動。 (見圖。)
有什麼辦法可以解決這個問題嗎?
答案1
\documentclass[a4paper,12pt]{article}
\usepackage{mhchem}
\begin{document}
\ce{CO3^{2-}_{\rlap{(aq)}}\; ->}
\end{document}
\rlap
抑制內容的寬度,因此您需要 a\;
來獲得正確的間距。
答案2
您可以使用{}_{(aq)}
\documentclass{article}
\usepackage[version=3]{mhchem}
\begin{document}
\noindent IUPAC recommendation:\\
\ce{2H+(aq) + CO3^{2-}(aq) -> CO2(g) + H2O(l)}
\bigskip
\noindent Subscript:\\
\ce{2H+{}_{(aq)} + CO3^{2-}{}_{(aq)} -> CO2{}_{(g)} + H2O{}_{(l)}}
\end{document}
答案3
如果您不介意切換包:chemformula
包與chemmacros
包的組合允許各種不同的輸出:
\documentclass{article}
\usepackage{chemmacros}
\begin{document}
IUPAC recommendation:\par
\ch{2 H+ \aq{} + CO3^2- \aq -> CO2 \gas{} + H2O \lqd}
\bigskip
\chemsetup{phases/pos=sub}
subscript phase descriptors after the compounds:\par
\ch{2 H+ \aq{} + CO3^2- \aq -> CO2 \gas{} + H2O \lqd}
\bigskip
phase descriptors as subscripts to the compounds directly:\par
\ch{2 H^+_{(aq)} + CO3^{2-}_{(aq)} -> CO2_{(g)} + H2O_{(l)}}
\bigskip
as before but disabled horizontal shift of the charge of \ch{H+}:\par
\ch{@{charge-hshift=0pt} 2 H^+_{(aq)} + CO3^{2-}_{(aq)} -> CO2_{(g)} + H2O_{(l)}}
\end{document}