无论我做什么,我都无法让线条正确定位。align*
总是想移动它。而且我无法\noalign
在内使用\cee
,或者也许我没有正确使用它(这里是初学者)?这是一个 MWE:
\documentclass{article} % [10] =10pt|11pt|12pt
\usepackage[fleqn]{amsmath} % standard math package 1/3
\usepackage[version=3]{mhchem} % insert chem equations
\usepackage[detect-none]{siunitx} % use proper si units
\usepackage{cancel} %strike out text
\begin{document}
\begin{align*}
\cee{
\cancel{\mathrm{MgCl_{2(aq)}}} + \cancel{\mathrm{H_{2}O_{(l)}}} &-> MgO_{(s)} + \cancel{\mathrm{2HCl_{(aq)}}}
&\Delta H_r&=\SI{105.037}{\kJ\per\mole} \\
Mg_{(s)} + \cancel{\mathrm{2HCl_{(aq)}}} &-> \cancel{\mathrm{MgCl_{2(aq)}}} + \cancel{\mathrm{H_{2(g)}}}
&\Delta H_r&=\SI{-447.667}{\kJ\per\mole}\\
\cancel{\mathrm{H_{2(g)}}} + 1/2O2_{(g)} &-> \cancel{\mathrm{H_{2}O_{(l)}}}
&\Delta H_r&=\SI{-285.8}{\kJ\per\mole} \\
\rule{6cm}{1pt} \\
Mg_{(s)} + 1/2O_{(g)} &-> MgO_{(s)}
}
\end{align*}
\end{document}
答案1
使用\intertext
。
梅威瑟:
\documentclass{article} % [10] =10pt|11pt|12pt
\usepackage[fleqn]{amsmath} % standard math package 1/3
\usepackage[version=3]{mhchem} % insert chem equations
\usepackage[detect-none]{siunitx} % use proper si units
\usepackage{cancel} %strike out text
\begin{document}
\begin{align*}
\cee{
\cancel{\mathrm{MgCl_{2(aq)}}} + \cancel{\mathrm{H_{2}O_{(l)}}} &-> MgO_{(s)} + \cancel{\mathrm{2HCl_{(aq)}}}
&\Delta H_r&=\SI{105.037}{\kJ\per\mole} \\
Mg_{(s)} + \cancel{\mathrm{2HCl_{(aq)}}} &-> \cancel{\mathrm{MgCl_{2(aq)}}} + \cancel{\mathrm{H_{2(g)}}}
&\Delta H_r&=\SI{-447.667}{\kJ\per\mole}\\
\cancel{\mathrm{H_{2(g)}}} + 1/2O2_{(g)} &-> \cancel{\mathrm{H_{2}O_{(l)}}}
&\Delta H_r&=\SI{-285.8}{\kJ\per\mole}}
\intertext{\centerline{\rule{6cm}{1pt}}}
\cee{
Mg_{(s)} + 1/2O_{(g)} &-> MgO_{(s)}
}
\end{align*}
\end{document}
输出:
否则,如果你不想要那么多的间距,请加载mathtools
(加载amsmath
)并使用\shortintertext
梅威瑟:
\documentclass{article} % [10] =10pt|11pt|12pt
\usepackage[fleqn]{mathtools} % standard math package 1/3
\usepackage[version=3]{mhchem} % insert chem equations
\usepackage[detect-none]{siunitx} % use proper si units
\usepackage{cancel} %strike out text
\begin{document}
\begin{align*}
\cee{
\cancel{\mathrm{MgCl_{2(aq)}}} + \cancel{\mathrm{H_{2}O_{(l)}}} &-> MgO_{(s)} + \cancel{\mathrm{2HCl_{(aq)}}}
&\Delta H_r&=\SI{105.037}{\kJ\per\mole} \\
Mg_{(s)} + \cancel{\mathrm{2HCl_{(aq)}}} &-> \cancel{\mathrm{MgCl_{2(aq)}}} + \cancel{\mathrm{H_{2(g)}}}
&\Delta H_r&=\SI{-447.667}{\kJ\per\mole}\\
\cancel{\mathrm{H_{2(g)}}} + 1/2O2_{(g)} &-> \cancel{\mathrm{H_{2}O_{(l)}}}
&\Delta H_r&=\SI{-285.8}{\kJ\per\mole}}
\shortintertext{\centerline{\rule{6cm}{1pt}}}
\cee{
Mg_{(s)} + 1/2O_{(g)} &-> MgO_{(s)}
}
\end{align*}
\end{document}
输出:
答案2
使用
\rlap{\rule{6cm}{1pt}} \\
那么它的宽度为 0pt