Could anyone help me align this multiline equation correctly? I am having very little luck. It is too long for one line, so I have spread it over 4 lines. I am trying to get all the +(#) terms after '\chemspec_\text{vit}' to be aligned to the left to remove the white space between the equations (so all the plus signs sit underneath each other).
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\begin{document}
% commands
\newcommand{\dydx}[2]{\frac{\text{d}#1}{\text{d}#2}}
\newcommand{\pRPEc}[1]{p_\text{RPE}^{(#1)}}
\newcommand{\pILMc}[1]{p_\text{ILM}^{(#1)}}
\newcommand{\kelc}[1]{k_\text{el}^{(#1)}}
\newcommand{\Sret}{S_\text{ret}}
\newcommand{\Vvit}{V_\text{vit}}
\newcommand{\SVit}{\frac{\Sret}{\Vvit}}
\newcommand{\konv}{k_\text{on}^{(v)}}
\newcommand{\koffv}{k_\text{off}^{(v)}}
\newcommand{\KDv}{K_\text{D}^{(v)}}
\newcommand{\konn}{k_\text{on}^{(n)}}
\newcommand{\koffn}{k_\text{off}^{(n)}}
\newcommand{\chemspec}{\R}
\newcommand{\area}{\text{ret}}
\newcommand{\V}{v}
\newcommand{\R}{r}
\newcommand{\VR}{c}
\newcommand{\RVR}{h}
\newcommand{\N}{n}
\newcommand{\RN}{m}
\newcommand{\VRN}{f}
\newcommand{\RVRN}{\left(n_0-\left\{\N+\RN+\VRN\right\}\right)}
\newcommand{\Rone}[1] {\koffv \VR_#1 - 2\konv\V_#1\R_#1} % R1
\newcommand{\Rtwo}[1] {2\koffv \RVR_#1 - \konv\R_#1\VR_#1} % R2
\newcommand{\Rthree}[1]{\koffn \RN - \konn\R_#1\N} % R3
\newcommand{\Rfivec}[1]{\koffv \RVRN - \konv\R_#1\VRN} % R5c
\begin{alignat}{2}
% derivative
\dydx{\chemspec_\area}{t} &=
% transfer
\left(\SVit\right)\pILMc{\chemspec}\chemspec_\text{ret} % ret --> vit
-\left[\left(\SVit\right)\pILMc{\chemspec}+\kelc{\chemspec}\right]\chemspec_\text{vit} % vit --> ret
% reactions
&+\left(\Rone{\area}\right)\\ % R1
&&+\left(\Rtwo{\area}\right)\nonumber\\ % R2
&&+\left(\Rthree{\area}\right)\nonumber\\ % R3
&&+\left(\Rfivec{\area}\right)\nonumber % R5c
\end{alignat}
\end{document}
EDIT: I explained that poorly, this is what I'm trying to achieve:
Best Answer
Just add one extra
&
to each of these lines:The alignment of elements in
alignat
isOther changes:
geometry
package to get your page width\mathrm
instead of\text
for consistent typesetting (\text
changes with the surrounding formatting)\left...\right
by specific sizing commands,\left...\right
are often too bigYou could instead consider using an
aligned
(e.g. as\begin{aligned}[t]
) for the last block. That will make it easier to move to a new line if needed. E.g.