Align* environment inside tabbing environment?

  • Context: MHB 
  • Thread starter Thread starter Ackbach
  • Start date Start date
Click For Summary

Discussion Overview

The discussion centers around the compatibility of the align* environment within a tabbing environment in LaTeX. Participants explore various environments for aligning equations and seek to understand the limitations and functionalities of these formatting options.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions whether it is permissible to use an align* environment inside a tabbing environment.
  • Another participant suggests trying the alignat* environment as an alternative.
  • A later reply indicates that the alignat* environment did not yield better results than align* in their experience.
  • One participant references the User's Guide for the amsmath Package, explaining that certain multi-equation environments are designed to occupy the full line width, which may affect their use within other environments.
  • Another participant expresses appreciation for the quoted guide, indicating it helped clarify the issue and suggests they will experiment with the information provided.
  • A participant shares a modified version of the code that worked for them, noting they made slight adjustments for alignment.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the use of align* within tabbing, as some express challenges while others find success with alternative environments. Multiple competing views remain regarding the best approach to achieve the desired formatting.

Contextual Notes

There are limitations regarding the assumptions about the environments' widths and their compatibility, as well as unresolved issues related to specific formatting needs.

Ackbach
Gold Member
MHB
Messages
4,148
Reaction score
94
Why doesn't this code work?

Code:
\begin{tabbing}\qquad \= 11.\quad \= 
\kill

\>1.\>
\begin{align*}
f(x)&=2x+4\\
a&=3\\
\end{align*}
\\
\end{tabbing}

Is it not allowed to put an align* environment inside a tabbing environment?
 
Physics news on Phys.org
Ackbach said:
Why doesn't this code work?

Code:
\begin{tabbing}\qquad \= 11.\quad \= 
\kill

\>1.\>
\begin{align*}
f(x)&=2x+4\\
a&=3\\
\end{align*}
\\
\end{tabbing}

Is it not allowed to put an align* environment inside a tabbing environment?
Have you tried \alignat* ?
 
\begin{tabbing}\qquad \= 11.\quad \=
\kill

\>1.\>
\begin{alignat*}{1}
f(x)&=2x+4\\
a&=3\\
\end{alignat*}
\\
\end{tabbing}

The alignat* environment didn't work any better than align*, so far as I can see.
 
Here is a quote from the User's Guide for the amsmath Package.

Like equation, the multi-equation environments gather, align, and alignat are designed to produce a structure whose width is the full line width. This means, for example, that one cannot readily add parentheses around the entire structure. But variants gathered, aligned, and alignedat are provided whose total width is the actual width of the contents; thus they can be used as a component in a containing expression.

In my test, the environment aligned worked.
 
Evgeny.Makarov said:
Here is a quote from the User's Guide for the amsmath Package.
Like equation, the multi-equation environments gather, align, and alignat are designed to produce a structure whose width is the full line width. This means, for example, that one cannot readily add parentheses around the entire structure. But variants gathered, aligned, and alignedat are provided whose total width is the actual width of the contents; thus they can be used as a component in a containing expression.
In my test, the environment aligned worked.

Wonderful! The quote you so helpfully posted helps me understand why it doesn't work, as well as showing me why the substitute environment does. Fantastic. I'll give it a try when I have some time.
 
Worked just fine. Had to tweak it a hair to get the alignment what I wanted. Final working code:

Code:
\begin{tabbing}\qquad \= 11.\quad \= \hpsace{0.4\linewidth} \= 11.\quad \=
\kill

\>$\phantom{1}$1.\>
$\begin{aligned}[t]
f(x)&=2x+4\\
a&=3\\
L&=10\\
\varepsilon&=0.01
\end{aligned}$
\>$\phantom{1}$5.\>
$\begin{aligned}[t]
f(x)&=6x-10\\
a&=-2\\
L&=-22\\
\varepsilon&=0.4
\end{aligned}$\\
\end{tabbing}

Thanks much!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 6 ·
Replies
6
Views
1K
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
872