我想将多个方程式对齐。但是,我不知道该如何编码。我使用以下序言:
\documentclass[11pt]{article}
%comments
%pdflatex, bibtex, pdflatex, pdflatex
\usepackage{titling}
\setlength{\droptitle}{-12cm}
\usepackage{graphics, float}
\usepackage[pdftex]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{siunitx} %allows SI units by using \SI{unit}
\usepackage{amsmath} %allows \begin{equation} \end{equation}
\usepackage{geometry}
\usepackage{changepage} %allows you to widen or shorten the page width from the left or the right.
因为F_{hkl}
我想对齐下面的方程。第二个方程的等号应该放在第一个方程的等号正下方。有人能帮我解决这个问题吗?
我现在正在使用下面的代码,但还不满意。
\begin{equation*}
\mathrm{F_{hkl}} = \mathrm{f_{j}}
( \operatorname{e} ^ {2\pi \cdot i (h\cdot0 + k\cdot0 + l\cdot0)} +
\operatorname{e} ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} + l\cdot0)} +
\operatorname{e} ^ {2\pi i (h\cdot0 + k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
\operatorname{e} ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot0 + l\cdot\frac{1}{2})} )
\end{equation*}
\begin{equation*}
\mathrm{F_{hkl}} = \mathrm{f_{j}}
( \operatorname{e} ^ {2\pi i \cdot 0} +
\operatorname{e} ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} } +
\operatorname{e} ^ {2\pi i (k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
\operatorname{e} ^ {2\pi i (h\cdot\frac{1}{2} + l\cdot\frac{1}{2})} )
\end{equation*}
答案1
这种类型的对齐是使用开箱即用的amsmath
的align
环境:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\ee}{\mathrm{e}}
\begin{document}
\[
\mathrm{F_{hkl}} = \mathrm{f_{j}}
( \ee ^ {2\pi \cdot i (h\cdot0 + k\cdot0 + l\cdot0)} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} + l\cdot0)} +
\ee ^ {2\pi i (h\cdot0 + k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot0 + l\cdot\frac{1}{2})} )
\]
\[
\mathrm{F_{hkl}} = \mathrm{f_{j}}
( \ee ^ {2\pi i \cdot 0} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} } +
\ee ^ {2\pi i (k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + l\cdot\frac{1}{2})} )
\]
\begin{align*}
\mathrm{F_{hkl}} &= \mathrm{f_{j}}
( \ee ^ {2\pi \cdot i (h\cdot0 + k\cdot0 + l\cdot0)} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} + l\cdot0)} +
\ee ^ {2\pi i (h\cdot0 + k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot0 + l\cdot\frac{1}{2})} ) \\
\mathrm{F_{hkl}} &= \mathrm{f_{j}}
( \ee ^ {2\pi i \cdot 0} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} } +
\ee ^ {2\pi i (k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
\ee ^ {2\pi i (h\cdot\frac{1}{2} + l\cdot\frac{1}{2})} )
\end{align*}
\end{document}
使用 确保对齐&=
。
答案2
除了使用align*
环境将两个方程式的=
符号对齐之外,您可能还想研究使用mathastext
包来避免输入大量的\mathrm
“包装器”语句。
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{mathastext}
\begin{document}
\begin{align*}
F_{hkl} &= f_{j} \bigl(
e ^ {2\pi \cdot i (h\cdot0 + k\cdot0 + l\cdot0)} +
e ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} + l\cdot0)} +
e ^ {2\pi i (h\cdot0 + k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
e ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot0 + l\cdot\frac{1}{2})} \bigr)\\
F_{hkl} &= f_{j} \bigl(
e ^ {2\pi i \cdot 0} +
e ^ {2\pi i (h\cdot\frac{1}{2} + k\cdot\frac{1}{2} } +
e ^ {2\pi i (k\cdot\frac{1}{2} + l\cdot\frac{1}{2})} +
e ^ {2\pi i (h\cdot\frac{1}{2} + l\cdot\frac{1}{2})} \bigr)
\end{align*}
\end{document}