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
내용의 너비를 억제하므로 \;
올바른 간격을 얻으려면 이 필요합니다.
답변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}