I've a pretty long text commenting several sets of short equations. This leads me to some presentation constraints that I'd like to better handle:
- flush the equation sets to the left (short text in the center of the page is ugly),
- align the equation sets on the '=' sign between sets. This forces me to build on align, alignat or flalign because I can't interrupt an array with (short)intertext (AFAIK),
- I need to begin the equation sets with a left curly brace. I use 'dcases' but never achieved to have it functioning in 'alignat' (AFAIK)
In my MWE, the third example gives the result I expected. However, when I add a left curly brace, LaTeX adds a strange space before the '=' sign. Any idea about where this is coming from?
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc} % WARNING: Source UTF8-encoded
\usepackage{amsmath}%,amssymb}
%\usepackage{eqparbox,xintexpr}
\usepackage{mathtools} % dcases
\begin{document}
{\bf'align' means centered on '='}
\begin{align*}
\cos\theta_1 \cos\theta_2-\sin\theta_1\sin\theta_2 &= \cos(\theta_1 +\theta_2) \\
\sin\theta_1 \cos\theta_2 + \cos\theta_1 \sin\theta_2 &= \sin(\theta_1+\theta_2)
\end{align*}
{\bf'flalign' means flushed to left and aligned on '='}
\begin{flalign*}
\cos\theta_1 \cos\theta_2-\sin\theta_1\sin\theta_2 &= \cos(\theta_1 +\theta_2) &\\
\sin\theta_1 \cos\theta_2 + \cos\theta_1 \sin\theta_2 &= \sin(\theta_1+\theta_2) &% Need tailing alignment char to get all the way left
\end{flalign*}
{\bf'flalign' with a compliant indentation}
\begin{flalign*}
\hspace{\parindent}\cos\theta_1 \cos\theta_2-\sin\theta_1\sin\theta_2 &= \cos(\theta_1 +\theta_2) &\\
\hspace{\parindent}\sin\theta_1 \cos\theta_2 + \cos\theta_1 \sin\theta_2 &= \sin(\theta_1+\theta_2) &% Need tailing alignment char to get all the way left
\end{flalign*}
{\bf'In 'flalign', curly brackets have an indentation impact on '='?}
\begin{flalign*}%
\hspace{\parindent}&\begin{dcases}
\cos\theta_1 \cos\theta_2-\sin\theta_1\sin\theta_2&=\cos(\theta_1 +\theta_2)\\
\sin\theta_1 \cos\theta_2 + \cos\theta_1 \sin\theta_2&=\sin(\theta_1+\theta_2)
\end{dcases}&
\end{flalign*}
\end{document}
\bf
is depreciated. Use\mathbf
instead.align
,equation
etc will all set flush left not centred if you use thefleqn
option to\documentclass
oramsmath
.\usepackage[T1]{fontenc}
either as that forces legacy 8bit fonts. In my answer I kept the T1 encoding (and used pdflatex)cases
.