2

I am trying to break an equation and align the characters under each other. Here is an example:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align} f(a) &= f(b) + 3 + \ &\phantom{{}=f(b) + } 4 \nonumber \end{align}

\end{document}

This aligns 4 under the plus sign, however, I want 4 to be aligned under 3. Do I need to add a character to the phantom?


The code produces

enter image description here

Tyler D
  • 321

2 Answers2

4

When doing phantoms one often have to remember to have relations and binaries have something to work on, as in +1 and {}+1 does not have the same spacing.

Here we need a {} before the = and after the +:

\phantom{{}=f(b) + {}} 
daleif
  • 54,450
4

I would not use \phantom but rather move anchor & before "3" and "4":

\documentclass{article}
\usepackage{amsmath}

\begin{document} \begin{align} f(a) = f(b) + {} & 3 + {} \ & 4 \nonumber \end{align} \end{document}

enter image description here

Zarko
  • 296,517