How to set some lines right aligned in the align enviroments?
I would place the last three equations in an extra aligned
environment as follows:
\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator{\Ric}{Ric}
\newcommand{\Rico}{\Ric_o}
\DeclareMathOperator{\bi}{bi}
\begin{document}
\begin{align*}
Q(R) ={}&\bi(R,R)\\
={}&\bi(R_I+R_{\Rico}+R_W,R_I+R_{\Rico}+R_W)\\
={}&\begin{aligned}[t]
\bi(R_I,R_I)+2\bi(R_I,R_{\Rico})+2\bi(R_I,R_W)&\\
+\bi(R_{\Rico},R_{\Rico})+2\bi(R_{\Rico},R_w)&\\
+\bi(R_W,R_W)&.
\end{aligned}
\end{align*}
\end{document}
Noticed the changed placement of the alignment charecter in relation to the equals signs and the consequent use of extra braces as ={}&
to ensure correct spacing. I have also defined your missing commands with \DeclareMathOperator
. I chose to load mathtools
instead of amsmath
, but that is just personal preference; it loads amsmath
anyway.
Here's a couple of options- you didn't tell us what the \Ric
command is- please always post a complete MWE
:)
I would also use
\newcommand{\bi}{\operatorname{bi}}
for your \bi
command, assuming I have interpreted it correctly.
\documentclass{article}
\usepackage{amsmath}
\newcommand{\Rico}{Ric_o}
%\newcommand{\bi}{\mathrm{bi}\,}
\newcommand{\bi}{\operatorname{bi}}
\begin{document}
\begin{align*}
Q(R)&=\bi(R,R)\\
&=\bi(R_I+R_{\Rico}+R_W,R_I+R_{\Rico}+R_W)\\
&=\bi(R_I,R_I)+2\bi(R_I,R_{\Rico})+2\bi(R_I,R_W)\\
&\phantom{{}=}+\bi(R_{\Rico},R_{\Rico})+2\bi(R_{\Rico},R_w)\\
&\phantom{{}=}+\bi(R_W,R_W).
\end{align*}
\begin{align*}
Q(R)&=\bi(R,R)\\
&=\bi(R_I+R_{\Rico}+R_W,R_I+R_{\Rico}+R_W)\\
&=\bi(R_I,R_I)+2\bi(R_I,R_{\Rico})+2\bi(R_I,R_W)\\
&&&+\bi(R_{\Rico},R_{\Rico})+2\bi(R_{\Rico},R_w)\\
&&&+\bi(R_W,R_W).
\end{align*}
\end{document}