Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wanted to left align a set of equations. I've tried the solution provided in aligning to the left. It worked. But, I wanted to have a single equation number for the entire flalign in order to refer to it later. Like in case of equation+split. While using equation+align, I am able to get it. But, if I use equation+flalign the equations are still being centered. Is there a way to do it?

Example using equation+align,

\begin{equation}
     \begin{align}
      \mbox{Minimize } & x_1+x_2+x_3 \\
      \mbox{Subject to} & \\
       & x_1+x_2 \leq 10 \\
       & x_2+x_3 \leq 8 \\
       & x_1+x_3 \leq 5 
     \end{align}
\end{equation}

I would like to do this while the equations are left aligned. It will be even better if the equations can be spaced a little (for example, 1 cm) from the left margin instead of starting from the left margin.

Thanks in advance

share|improve this question
1  
Change align into aligned. –  egreg May 5 '12 at 12:29
    
Another hint: Since you're already using the amsmath package, you may want to use the package's command \text instead of the basic-LaTeX \mbox. In the present case, the outcome is the same. However, in more general math settings, \mbox may give you undesired results because it sets its argument always in \textstyle, whereas \text adapts the size of its output to the surrounding math mode (which could be \scriptstyle or \scriptscriptstyle). –  Mico May 5 '12 at 13:08
add comment

1 Answer

up vote 12 down vote accepted

One option will be to use

\usepackage[fleqn]{amsmath}

On the other hand, this option ([fleqn]) can be passed to \documentclass also as

\documentclass[fleqn]{article}
\usepackage{amsmath}

The MWE will be

\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage{txfonts}
\usepackage{showframe}% to show frames
\begin{document}
\begin{equation}
     \begin{aligned}
      \text{Minimize } & x_1+x_2+x_3  \\
      \text{Subject to} &\\
       & x_1+x_2 \leq 10 \\
       & x_2+x_3 \leq 8 \\
       & x_1+x_3 \leq 5 
     \end{aligned}
\end{equation}
\end{document}

The output will be

enter image description here

But all the equations in the document will be left aligned by this approach.

The equation environment will put the equation in display mode by definition. To space only one equation left aligned, as you wish, one way is to use \phantom as below:

\documentclass{article}
\usepackage{amsmath}
\usepackage{txfonts}
\usepackage{showframe}% to show frames
\begin{document}
\begin{equation}
     \begin{aligned}
      \text{Minimize } & x_1+x_2+x_3   \\
      \text{Subject to} &\\
       & x_1+x_2 \leq 10 \\
       & x_2+x_3 \leq 8 \\
       & x_1+x_3 \leq 5 
     \end{aligned}
     \phantom{\hspace{6cm}} %%<---adjust the value as you want
\end{equation}
\end{document}

enter image description here

share|improve this answer
    
It is working. Thank you. –  user492884 May 6 '12 at 18:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.