Page LayoutWhy are tags missing in alignment sublevels?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
andrew comly
Posts: 1
Joined: Tue Nov 22, 2016 12:30 pm

Why are tags missing in alignment sublevels?

Post by andrew comly »

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

Code: Select all

\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:

Code: Select all

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

The next two attempts I use: http://tex.stackexchange.com/questions/ ... nvironment
On this page there are two solutions: 2) Steven B. Segletes and 3) David Carlisle

### Attempt 02: Segletes

Code: Select all

\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

Code: Select all

\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.

But notice that only the first 4 lines are tagged with integers 1-4. TAGS 5-end 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?
Attachments
Target Results (Desired Results)
Target Results (Desired Results)
Target.png (20.57 KiB) Viewed 2064 times
Current Results {fail}
Current Results {fail}
01-3_Results_highlighted2.png (83.26 KiB) Viewed 2064 times
Last edited by Stefan Kottwitz on Tue Nov 22, 2016 1:41 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Why are tags missing in alignment sublevels?

Post by rais »

Hi there,
I guess you could make the first attempt (enumerate/itemize) work your way by adding an empty pair of brackets to each \item command, such as \item[].
Then again, this looks all a bit complicated...how about

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{showframe}
\newcommand*\main{&}
\newcommand*\subi{&\mspace{72mu}}
\newcommand*\subii{&\mspace{144mu}}
\begin{document}
  \begin{flalign}
    \main \frac{d}{dx}[f(x)]&\\
    \main \frac{d}{dx}[g(x)]&\\
    \subi \frac{d}{dx}[h(x)]&\\
    \subii \frac{d}{dx}[A(x)]&\\
    \subii \frac{d}{dx}[H(x)]&
  \end{flalign}
\end{document}
KR
Rainer
Post Reply