General ⇒ Left alignment of formulas with eqnarray
Left alignment of formulas with eqnarray
I know that if I want formulas to be aligned left when using \begin{equation}, I just need to add [fleqn] to the \documentclass options. However, this doesn't seem to work with \begin{eqnarry}. Here is my problem:
\begin{eqnarray}
({\hat{C_1}},0)={Y_1}+{\frac{Y_2}{1+r}}=B_0 {\mbox{ n.P.}} (\frac{Y_2}{1+r})*(1+r) \mbox{ - Alles wird in der ersten Periode konsumiert}\\
(0,\hat{C_2})=Y_2+Y_1(1+r)=D\mbox{ - Alles wird in der zweiten Periode konsumiert}
\end{eqnarray}
The second line is not left aligned, but centered.
Does anyone has a solution?
Cheers
Alex
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Left alignment of formulas with eqnarray
Edit: since you speak German, the original German version of l2tabu can be better for you. You can find it here.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Left alignment of formulas with eqnarray
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Left alignment of formulas with eqnarray
Code: Select all
\begin{align}
(\hat{C_1},0)&=Y_1+\frac{Y_2}{1+r}=B_0 \text{ n.P.}
\left(\frac{Y_2}{1+r}\right)*(1+r)
- \text{Alles wird in der ersten Periode konsumiert}, \\
(0,\hat{C_2})&=Y_2+Y_1(1+r)=D - \text{Alles wird in der zweiten
Periode konsumiert}.
\end{align}
Re: Left alignment of formulas with eqnarray
Thanks a lot for your useful advices and links, the documents you referred me to seem really useful. {align} seems a nice environment, too. I think my biggest mistake was what I was trying to do in the first place. I tried to write an equation, than comment it with a text and than add the equation number, which is probably not the best idea from an aesthetical point of view. Nevertheless, I followed your advice and did use the \begin{align} environment, however in that case the numbering for each line appeared on the following line (and not on the same as I wanted to). That's why I decided that I will just have the two equations without any text and than I will comment on them in the paragraph after!
P.S. How do you do this trick with taking a snapshot of that part of the pdf, which is relevant and than posting it together with the LaTeX-code?
Left alignment of formulas with eqnarray
Code: Select all
\begin{align}
(\hat{C_1},0)&=Y_1+\frac{Y_2}{1+r}=B_0 \text{ n.P.}
\left(\frac{Y_2}{1+r}\right)*(1+r)
&\Longleftarrow&\ \parbox[t]{0.3\linewidth}{Alles wird in der ersten
Periode konsumiert} \\
(0,\hat{C_2})&=Y_2+Y_1(1+r)=D
&\Longleftarrow&\ \parbox[t]{0.3\linewidth}{Alles wird in der zweiten
Periode konsumiert}
\end{align}
\begin{alignat}{2}
(\hat{C_1},0)&=Y_1+\frac{Y_2}{1+r}=B_0 \text{ n.P.}
\left(\frac{Y_2}{1+r}\right)*(1+r)\quad
&\Longleftarrow&\ \parbox[t]{0.3\linewidth}{Alles wird in der ersten
Periode konsumiert} \\
(0,\hat{C_2})&=Y_2+Y_1(1+r)=D
&\Longleftarrow&\ \parbox[t]{0.3\linewidth}{Alles wird in der zweiten
Periode konsumiert}
\end{alignat}
- that align supports multiple points of alignment between equations,
that one can include boxes in formulas containing long text,
that there exists environments similar to align that one could sometimes need.
P.S. How do you do this trick with taking a snapshot of that part of the pdf, which is relevant and than posting it together with the LaTeX-code?
Taking a snapshop is platform dependent. To post LaTeX code, simply click on the box "Code" just above the window where you write the post text and paste the code at the cursor position (between the bracketed "code" and "/code" labels).
Left alignment of formulas with eqnarray
\begin{flalign}
x &= a + b &&\\
c &= d + e &&\\
f &= g + h &&
\end{flalign}