I've seen this https://stackoverflow.com/questions/2632628/left-align-block-of-equations answer as well as a handful of others, but none of them gives a satisfactory solution.
The problem
Two equations need to be aligned such that equals signs are positioned one under another, and the text on the left side of the equals sign is aligned to the left.
What I tried so far
\documentclass[fleqn]
- this never aligns the test to the right of the last ampersand to the left.\begin{flalign}
- same as above.\begin{tabular}{lll}
inside\beign{equation}
- it's possible to achieve proper layout, but is very cumbersome (I need to wrap all formulas inside in$$
and such, which makes referencing difficult.
Example
% Created 2015-01-10 Sat 16:22
\documentclass[fleqn]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\usepackage[utf8]{inputenc}
\author{wvxvw}
\date{\today}
\title{test}
\hypersetup{
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 25.0.50.1 (Org mode 8.2.2)}}
\begin{document}
\maketitle
\tableofcontents
\section{Problem 1}
\label{sec-1}
\begin{align*}
U &=& \mathrm{Sp} \{ x^3 + 4x^2 - x + 3, x^3 + 5x^2 + 5, 3x^3 + 10x^2 + 5 \} & \\
W &=& \mathrm{Sp} \{ x^3 + 4x^2 + 6, x^3 + 2x^2 - x + 5, 2x^3 + 2x^2 - 3x + 9 \} &
\end{align*}
% Emacs 25.0.50.1 (Org mode 8.2.2)
\end{document}
I tried moving &
to different positions, this example only shows one combination.
align
is noteqnarray
: you just need&=
; remove the trailing&
. Unrelated: you should define\DeclareMathOperator{\Sp}{Sp}
in the preamble and use\Sp
instead of\mathrm{Sp}
;\tolerance=1000
seems quite high.\DeclareMathOperator
, just couldn't remember what the command was! Thanks a lot. Re'&=
- sorry, no, that gives ugly spaces on the right of the equals sign and the rest of the equation is aligned to the right...\tolerance
and other\usepackage
commands are generated by Emacs. I might be able to tweak it, but I don't know yet what it does, so I'll probably let it be for now.&=&
is used, not with&=
(see this picture). I've never seen the left hand side left aligned, in cases like this.&=
gives the result I wanted. Technically, this can be the answer.