0

I am trying to display a derivation that should look like:

f(x) = (expression 1) + (expression 2)
                      - (expression 3)

     = (expression 4)

I can get this to display just the way I want, except centered, by using:

\begin{equation*}
\begin{alignedat}{2}
f(x)    &= (\text{expression 1})    &&+ (\text{expression 2}) \\
        &                           &&- (\text{expression 3}) \\ \\
        &= (\text{expression 4})    &&
\end{alignedat}
\end{equation*}

The issue is that if I try any tricks I’ve seen mentioned here on Stack Exchange to left-align equations (such as \flalign), I lose the ability to align my equations relative to each other as desired. I’m fairly new to TeX so might be missing something simple.

1
  • This was made with this code. Does it seem in line with what you're after?
    – Werner
    Commented Jan 18, 2019 at 18:35

2 Answers 2

2

If it is for some equations, and not the whole document, the fleqn environment from nccmath does just that:

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath, nccmath}

\begin{document}

Some text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.

\begin{fleqn}
\begin{equation*}
\begin{alignedat}{2}
f(x) &= (\text{expression 1}) &&+ (\text{expression 2}) \\
        & &&- (\text{expression 3}) \\ \\
        &= (\text{expression 4}) &&
\end{alignedat}
\end{equation*}\end{fleqn}

\end{document} 

enter image description here

1

Since you don't want an equation number, the simplest thing is to use just $...$. BTW, there are no vertical alignments whatsoever in your equation, all alignments are horizontal.

\documentclass{article}
\usepackage{amsmath}
\usepackage{showframe} % just for illustration

\begin{document}

\noindent%
$\displaystyle
\begin{alignedat}{2}
f(x)    &= (\text{expression 1})    &&+ (\text{expression 2}) \\
        &                           &&- (\text{expression 3}) \\ \\
        &= (\text{expression 4})    &&
\end{alignedat}
$

\end{document}

enter image description here

You must log in to answer this question.

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