5

I am using mathmode with split. How can you use multiple tab stops. I want to span an equation across multiple lines, but then the last few I want to indent even more.

\[
\begin{split}

some& stuff here \\
    &some &more stuff here \\
          &even more stuff here

\end{split}
\]

Notice the 2nd tab stop and I want to look like it's shown with the tabs.

4
  • Does this post help: tex.stackexchange.com/questions/29612/aligning-polynomial-terms/…
    – cmhughes
    Oct 13, 2011 at 3:05
  • @cmhuges not really as that uses align, but i found \qquad which is fine for me.
    – Matt
    Oct 13, 2011 at 3:15
  • 1
    Could you provide a screenshot of what you'd like?
    – cmhughes
    Oct 13, 2011 at 3:15
  • 1
    If you post an example of the kind of equation you'd like to typeset, I'm pretty sure people will come up with solutions that might work better for you than using \qquad. \qquad is not the same as a tab, as it just adds a fixed amount of space and doesn't ensure proper alignment.
    – Jake
    Oct 13, 2011 at 3:21

2 Answers 2

8

amsmath provides the alignat environment that is able to provide tab stops as needed. Some overlap support may be required via mathtools. It provides the mathematical equivalent of \llap and \rlap. Although it's also possible using a regular align with some \phantoms for spacing:

alignat in amsmath

\documentclass{article}

\usepackage{mathtools}% Also loads amsmath

\begin{document}

\begin{alignat*}{2}
  E &= \mathrlap{mc^2 - 2x^4 + abc} \\
    &\phantom{{}={}} ayz - 2 && + 3 + 2 \\
    &                        && - b + \operatorname{ord}(xyz - ijk)
\end{alignat*}

\begin{align*}
  E &= mc^2 - 2x^4 + abc \\
    &\phantom{{}={}} ayz - 2 + 3 + 2 \\
    &\phantom{{}= ayz - 2} - b + \operatorname{ord}(xyz-ijk)
\end{align*}

\end{document}
2
  • 1
    What does rlap do?, also i see phantom a lot, what does that do? Is there no way to do this with split? Thanks!
    – Matt
    Oct 13, 2011 at 3:43
  • 1
    \rlap{<stuff>} is equivalent to \makebox[0pt][l]{<stuff>} (providing a right overlap), while \llap{<stuff>} does the same for a right overlap (\makebox[0pt][r]{<stuff>}). \phantom{<stuff>} prints a box of width & height of <stuff> without actually typesetting <stuff>. Similarly, \hphantom{<stuff>} and \vphantom{<stuff>} provides horizontal/vertical-only spacing of <stuff> without actually typesetting anything. The split environment only allows a single alignment character &, so you'd have to use spacing (\quad or otherwise).
    – Werner
    Oct 13, 2011 at 3:58
4

The nath package provides \wall and \return to align at arbitrary locations. Here is Werner's example coded using nath syntax.

\documentclass{article}
\usepackage{nath}
\begin{document}
\begin{equation}
  E \wall = m c^2 - 2x^2 + abca \\
          \quad ayz-2 \wall{} +3+2 \\
              {} - b + `ord (xyz-ijk) 
      \return \return
\end{equation}
\end{document}

which gives

enter image description here

1
  • Why is the first \wall before the =? If it was after the =, the \quad on the next line would not be required, which is better IMO.
    – matj1
    Mar 15 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .