4
\documentclass{article}

\usepackage{amsmath,amssymb}

\begin{document}

\begin{flalign}

& E=MC^2 \\

\begin{flalign}

& U = \frac{1}{2} + bh & V = \frac{1}{2} - bh & B=H \\ % want to have this sub equation indented\\

& H= \frac{1}{2}(S-X) & H1= \frac{1}{2}(S+X) & B=H \\ % want to have this sub equation indented

\end{flalign}

& Y=MX +b 

\end{flalign}

\end{document}

Please I would appreciate it if I could be helped align my sub equations within an align environment with numbering of sub equations as (2.1 a) and major equations as (2.1)

  • 1
    What you're trying to do is not clear to me, and you cannot nest an \flalign environment in another environment. Could you explain more, with a drawing if necessary? – Bernard Oct 21 '14 at 8:57
4

Like this?

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\numberwithin{equation}{section} % for equation numbering section.equation
\usepackage{blindtext} % just for demo

\begin{document}    
    \blindtext
    \setcounter{section}{2} % just for demo
    \begin{align}       
         e&=mc^2  \\                
            &&U&= \frac{1}{2} + bh  &V&= \frac{1}{2} - bh  &B&=H \tag{\theequation{} a} \\          
            &&H&= \frac{1}{2}(S-X)  &H_1&= \frac{1}{2}(S+X) &B&=H \tag{\theequation{} b} \\         
         Y&=mX +b       
    \end{align}
    \blindtext  
\end{document}

enter image description here


or alternatively:

\begin{align}       
    \MoveEqLeft[3] e=mc^2  \\ % change the number [3] to other values in order to change the indent             
        U&= \frac{1}{2} + bh  &V&= \frac{1}{2} - bh  &B&=H \tag{\theequation{} a}\\     
        H&= \frac{1}{2}(S-X)  &H_1&= \frac{1}{2}(S+X) &B&=H \tag{\theequation{} b}\\                
    \MoveEqLeft[3] Y=mX +b      
\end{align}

enter image description here


or a third alternative:

\begin{alignat}{7}  
    e&=mc^2  \\                 
        & &&U&&= \frac{1}{2} + bh,  &&V&&= \frac{1}{2} - bh,  &&B&&=H \tag{\theequation{} a}\\      
        & &&H&&= \frac{1}{2}(S-X),\quad  &&H_1&&= \frac{1}{2}(S+X),\quad &&B&&=H \tag{\theequation{} b}\\               
     Y&=mX +b       
\end{alignat}

enter image description here


And finally:

If you want to change the indent in the last example, just change the kerning in the first row:

\begin{alignat}{7}  
    e&=mc^2\mkern-20mu  \\ % change this value to nevative or positive values in order to change the indent             
        & &&U&&= \frac{1}{2} + bh,  &&V&&= \frac{1}{2} - bh,  &&B&&=H \tag{\theequation{} a}\\      
        & &&H&&= \frac{1}{2}(S-X),\quad  &&H_1&&= \frac{1}{2}(S+X),\quad &&B&&=H \tag{\theequation{} b}\\               
     Y&=mX +b\mkern-10000mu % leave this value      
\end{alignat}
  • @user28251 You are very welcome. If you think, this is your answer, you could accept it by clicking on the left side check mark. Like this, the issue gets closed. Thanks. – LaRiFaRi Oct 21 '14 at 15:26
  • Sure you got it – user28251 Oct 21 '14 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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