1

I would like to have integer tags all the way on the right hand side of each equation line.

I also need multiple alignment(horizontal) levels.

Attempt 01: Michelle Krummel's Lists tutorial

\begin{enumerate}  
\item  
    \begin{align}  
        \frac{d}{dx}[f(x)]  
    \end{align}  
\item  
    \begin{align}  
        \frac{d}{dx}[g(x)]  
    \end{align}  
\item  
    \begin{itemize}  
        \item  
            \begin{align}  
                \frac{d}{dx}[h(x)]  
            \end{align}  
            \item  
            \begin{itemize}  
                \item  
                    \begin{itemize}  
                        \item  
                            \begin{align}  
                                \frac{d}{dx}[A(x)]  
                            \end{align}  
                        \item  
                            \begin{align}  
                                \frac{d}{dx}[H(x)]  
                            \end{align}  
                    \end{itemize}  
            \end{itemize}  
\end{itemize}  
\end{enumerate}  

This way does produce an effect very close to what I want to do, except for the list numbering, bulleting, "dash", and "star" on the left hand side, Please see graphic below (towards bottom) within "CURRENT RESULTS" link under "Attempt 01: Lists".

This is a result of \begin{enumerate} and \end{enumerate}, but without it the \item trick just doesn't work. However, I find having to write the following clauses for each successive indentation a tad bit onerous:

    \begin{enumerate}
        \item 
            \begin{itemize}
                ...
            \end{itemize}
    \end{enumerate}

The next two attempts I use: How to achieve two levels of indentation inside align environment? On this page there are two solutions: 2) Steven B. Segletes and 3) David Carlisle

Attempt 02: Segletes

\documentclass[12pt,a4paper]{article}
\usepackage[fleqn]{amsmath}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{verbatim}
\usepackage[usestackEOL]{stackengine}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{Andrew}
\stackMath
\begin{document}
    Proove Theorem AAC
        \begin{align}
            \mbox{Let y } & = \Longunderstack[l] {
                f(x)        \\
                g(x)    
                }           \\
                    x & = \Longunderstack[l] {
                    h(x)        \\
                    %w & = \Longunderstack[l] {
                    %   A(x)        \\
                    %   }   
                    }
        \end{align}
    \end{document}

This works well for two levels of alignment, but notice how above I had to comment out the third level of alignment. You can't use the \Longunderstack[l] within another \Longunderstack, thus only two levels of alignment.

Attempt 03: David Carlisle

\documentclass[12pt,a4paper]{article}
\usepackage[fleqn]{amsmath}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{verbatim}
\usepackage[usestackEOL]{stackengine}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{Andrew}
\stackMath
\begin{document}
    \begin{align}
        Carlisle &              \\                  
             &Sample Explanation        \\   
                \nu(u_1)&= f(x)                                     \\  %Alignment Level 1
                                &= \cosh(x) - \sinh(x)      \\  %Alignment Level 1
                                & G(x) =
            \!\begin{aligned}[t]
                    & A(x)              \\                              %Alignment Level 2
                    & H(x) = \int^Q_O z(x) dx   \\      %Alignment Level 2
                    & L(x) =                                                %Alignment Level 2 
                    \!\begin{aligned}[t]
                        & \frac{d}{dx} P(x)                     \\          %Alignment Level 3 
                        & S(x)                                                              %Alignment Level 3
                    \end{aligned}
                \end{aligned}
        \end{align}
\end{document}

Carlisle's method better matches my purpose than Segletes' method because you can utilize \!\begin{aligned}[t] recursively, thus it seems that there is no limitation on the number of alignment levels.

CURRENT RESULTS

But notice that only the first 4 lines are tagged with integers 1-4. TAGS 5-7 aren't there since Carlisle's method uses {aligned} for sub-alignment levels, and this naturally disables tagging. I was wondering if I may have integer tags for the last few lines 5-end while preserving the present alignment. Anything else beside {aligned}[t] that can execute sub-alignment levels?

TARGET RESULTS

  • I don't understand this question. Can you show a graphic of what you're after? – Werner Nov 22 '16 at 1:19
  • ...by the way, I see tags with each align. – Werner Nov 22 '16 at 1:59
  • I see tags with each too, but not at each line defined with aligned, as expected. off-topic: why you need to load amsmath twice + mathtools three times? – Zarko Nov 22 '16 at 2:06
  • Werner, I looked for a place to upload pdf files, but apparently there is no place to upload images. I did however find a way to embed links to pictures (tex.stackexchange.com/editing-help). Perhaps you can share with me on how to do this. – afc888ny Nov 22 '16 at 4:12
  • Werner, I have found how to upload images, thanks for the idea! – afc888ny Nov 22 '16 at 4:21
1

the whole point of aligned is that these are "subsidiary" equations, and thus only one of them gets a number.

alignat can be called on to assign additional alignment points. some of the wider lines at the top of the group may have to be "finished off" with \mathrlap to lose the extra width.

here's one possibility (much of the content is stolen from the carlisle example):

\documentclass[12pt,a4paper]{article}
\usepackage[fleqn]{amsmath}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lmodern}
\begin{document}
  \begin{alignat}{3}
    First &              \\                  
      &Second        \\   
        \nu(u_1)&= f(x)   \\
                &= \mathrlap{\cosh(x) - \sinh(x) }     \\
                & G(x) ={} & A(x) &              \\
                &          & H(x) &= \int^Q_O z(x) dx   \\
                &          & L(x) &= \frac{d}{dx} P(x)  \\
                &          &      &= S(x)
  \end{alignat}
\end{document}

output of example code

another possibility is to manually position the "nested" levels with appropriate \phantoms. that is left as an exercise.

  • This solves my problem in its entirety. – afc888ny Nov 30 '16 at 23:39
  • i'm glad that this is solved. you can recognize that by accepting the answer -- clicking on the check mark below the voting "arrows". – barbara beeton Dec 22 '16 at 20:11

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.