我想要得到如下的结果,但是我对结果不满意:
\documentclass[12pt,parskip]{scrartcl}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\usepackage[english]{babel}
\selectlanguage{english}
\begin{document}
$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;
\;\;$\begin{minipage}[r]{8cm}
\begin{flalign*}
\beta_0
&=
\cos\left(\frac{\Phi}{2}\right)\longrightarrow&
\Phi
&=2\arccos\left(\beta_0\right)
=
118.67^\circ\\
\beta_1
&=
e_1\sin\left(\frac{\Phi}{2}\right)\longrightarrow&
e_1
&=
\frac{\beta_1}{\sin\left(\frac{\Phi}{2}\right)}
=
-0.857716\\
\beta_2
&=
e_2\sin\left(\frac{\Phi}{2}\right)\longrightarrow&
e_2
&=
\frac{\beta_2}{\sin\left(\frac{\Phi}{2}\right)}
=
-0.513132\\
\beta_3
&=
e_3\sin\left(\frac{\Phi}{2}\right)\longrightarrow&
e_3
&=
\frac{\beta_3}{\sin\left(\frac{\Phi}{2}\right)}
=
-0.031914
\end{flalign*}
\end{minipage}\\
\end{document}
抱歉格式不好,我还是 LaTex 的新手。我想用箭头连接方程式,但箭头也应该对齐。方程式应该靠得很近……我用了一个 minipage 来解决问题,但我认为这也不是最好的解决方案。谢谢!
答案1
您可以使用alignat
在多个位置对齐:
\documentclass[12pt,parskip]{scrartcl}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{alignat*}{3}
\beta_0 &= \cos(\tfrac{\Phi}{2}) && \longrightarrow\ & \Phi &=2\arccos(\beta_0)=118.67^\circ \\
\beta_1 &= e_1\sin(\tfrac{\Phi}{2}) && \longrightarrow\ & e_1 &=\frac{\beta_1}{\sin(\tfrac{\Phi}{2})}=-0.857716 \\
\beta_2 &= e_2\sin(\tfrac{\Phi}{2}) && \longrightarrow\ & e_2 &=\frac{\beta_2}{\sin(\tfrac{\Phi}{2})}=-0.513132 \\
\beta_3 &= e_3\sin(\tfrac{\Phi}{2}) && \longrightarrow\ & e_3 &=\frac{\beta_3}{\sin(\frac{\Phi}{2})}=-0.031914
\end{alignat*}
\end{document}
考虑阅读赫伯特·沃斯的mathmode
文档. 具体部分25align
种环境(第 43 页及以上)
array
也可以使用标准进行对齐。以下是其中一条建议:
\documentclass[12pt,parskip]{scrartcl}
\begin{document}
\[
\begin{array}{r@{{}={}}l@{\quad\longrightarrow\quad}r@{{}={}}l@{{}={}}l}
\beta_0 & \cos(\frac{\Phi}{2}) & \Phi & 2\arccos(\beta_0) & 118.67^\circ \\
\beta_1 & e_1\sin(\frac{\Phi}{2}) & e_1 & \frac{\beta_1}{\sin(\frac{\Phi}{2})} & -0.857716 \\
\beta_2 & e_2\sin(\frac{\Phi}{2}) & e_2 & \frac{\beta_2}{\sin(\frac{\Phi}{2})} & -0.513132 \\
\beta_3 & e_3\sin(\frac{\Phi}{2}) & e_3 & \frac{\beta_3}{\sin(\frac{\Phi}{2})} & -0.031914
\end{array}
\]
\end{document}
在单元格之间使用@{{}={}}
插入内容作为“列分隔符”,同时也确保间距与常规二元关系相匹配。=
array