화학식의 화살표를 더 짧게 만드는 방법은 무엇입니까? (mhchem 사용)

화학식의 화살표를 더 짧게 만드는 방법은 무엇입니까? (mhchem 사용)

나는 사용하고있다mhchem다음 예와 같이 화학식을 작성하려면클레멘스(아래 표시). ->두 번째 방정식에서 기본 화살표를 고정된 값만큼 짧게 만드는 방법이 있나요 ?

코드는 다음과 같습니다.

\documentclass{article}
\usepackage[version=4]{mhchem}
\begin{document}

\ce{Na2SO4 ->[H2O] Na+ + SO4^2-}

\ce{(2Na+,SO4^2- ) + (Ba^2+, 2Cl- ) -> BaSO4 v + 2NaCl}

\end{document}

여기에 이미지 설명을 입력하세요

답변1


\documentclass{article}
\usepackage[version=4]{mhchem}

\ExplSyntaxOn
\keys_define:nn { mhchem }
 {
  arrow-min-length .code:n =
   \cs_set:Npn \__mhchem_arrow_options_minLength:n { {#1} } % default is 2em
 }
\ExplSyntaxOff

\begin{document}

\ce{(2Na+,SO4^2- ) + (Ba^2+, 2Cl- ) -> BaSO4 v + 2NaCl}

\mhchemoptions{arrow-min-length=1em}

\ce{(2Na+,SO4^2- ) + (Ba^2+, 2Cl- ) -> BaSO4 v + 2NaCl}

\mhchemoptions{arrow-min-length=10em}

\ce{(2Na+,SO4^2- ) + (Ba^2+, 2Cl- ) -> BaSO4 v + 2NaCl}

\end{document}

여기에 이미지 설명을 입력하세요

답변2

태그를 고려하면,, LaTeX의 기본 명령을 사용하여 화학 반응을 구축할 수도 있습니다. 예를 들어 \xrightarrow{\hspace*{6cm}}화살표의 길이를 늘리거나 줄일 수 있습니다. 방정식이 모두 정렬되었습니다.

여기에 이미지 설명을 입력하세요

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}

\begin{document}
\[
\begin{aligned}
\mathrm{Na}_2\mathrm{SO}_6 & \overset{\mathrm{H}_2\mathrm{O}}{\longrightarrow} \mathrm{Na}^+ + \mathrm{SO}_4^{2-}\\
(2\mathrm{Na}^+\mathrm{SO}_4^{2-})+(\mathrm{Ba}^{2+}, 2\mathrm{Cl}^-) & \longrightarrow \mathrm{Ba}\mathrm{SO}_4\!\downarrow+2\mathrm{NaCl} \\
\mathrm{Na}_2\mathrm{SO}_6 & \overset{\mathrm{H}_2\mathrm{O}}{\xrightarrow{\hspace*{5cm}}} \mathrm{Na}^+ + \mathrm{SO}_4^{2-}\\
(2\mathrm{Na}^+\mathrm{SO}_4^{2-})+(\mathrm{Ba}^{2+}, 2\mathrm{Cl}^-) & \xrightarrow{\hspace*{6cm}} \mathrm{Ba}\mathrm{SO}_4\!\downarrow+2\mathrm{NaCl}
\end{aligned}
\]
\end{document}

관련 정보