4

I would like to align multiple equations below each other. However, I cannot figure out how I should code this. I'm using the following preamble:

\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.

For F_{hkl} I would like to align the equations below. The equal sign of the second equation should be placed right below the equal sign in the first equation. Can someone help me figuring this out?

I am now using the following code, but I am not satisfied with it yet.

\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
  • You should use the align* environment provided by amsmath, not two equation* environments. Dec 20, 2015 at 20:11

2 Answers 2

8

This type of alignment is provided out-of-the-box using amsmath's align environment:

enter image description here

\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}

Alignments are ensured using &=.

4

In addition to using an align* environment to align the two equations on their = symbols, you may want to look into using the mathastext package to save yourself from having to type lots and lots of \mathrm "wrapper" statements.

enter image description here

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .