Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

trouble in using flalign (LaTeX)

Tags:

latex

I am trying to put 3 equations with "=" signs aligned but also left aligned. I tried the following:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{flalign*}
RPC &= A+B\tilde{f} +C x  &\\
A   &= a+\eta             &\\
E   &= cte                &
\end{flalign*}

\end{document}

With this I get the stuff in the left and the "=" signs aligned. However, I also need A (in the second equation) and E (in the third equation) to be aligned to the R (in the first one)

Does anyone know how to get it?

thanks

like image 559
Jorge Avatar asked May 05 '10 03:05

Jorge


2 Answers

This approach avoids explicit spacing commands.

\begin{flalign*}
RPC          &= A+B\tilde{f} +C x  &\\
\omit$A$\hfil&= a+\eta             &\\
\omit$E$\hfil&= cte                &
\end{flalign*}

This way is a little less TeXish.

\begin{flalign*}
\rlap{$RPC$}\phantom{RPC} &= A+B\tilde{f} +C x  &\\
\rlap{$A$  }\phantom{RPC} &= a+\eta             &\\
\rlap{$E$  }\phantom{RPC} &= cte                &
\end{flalign*}
like image 87
David Ford Avatar answered Nov 11 '22 09:11

David Ford


I have tried all different combinations of &s and haven't found anything that works quite right. There's probably some better way of doing it, but you could just use \hphantom to make the A and E take roughly the same amount of space as RPC:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{flalign*}
RPC            & = A+B\tilde{f} +C x  \\
A\hphantom{PC} & = a+\eta \\
E\hphantom{PC} & = cte
\end{flalign*}

\end{document}
like image 44
Jason B Avatar answered Nov 11 '22 09:11

Jason B