How to format "sub step indentations" in LaTeX

  • Context: LaTeX 
  • Thread starter Thread starter opus
  • Start date Start date
  • Tags Tags
    Format Latex
Click For Summary

Discussion Overview

The discussion revolves around formatting "sub step indentations" in LaTeX, particularly for presenting mathematical steps clearly and effectively. Participants explore various methods to achieve proper alignment and indentation for equations, including the use of specific environments and commands.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks a way to indent steps in LaTeX to clarify subsets of a problem and align equal signs.
  • Another participant suggests using the align environment with ampersands for proper spacing and alignment of equations.
  • A third participant mentions the use of phantoms in the align environment to manage spacing when no relation is present.
  • One participant proposes using IEEEeqnarray and IEEEeqnarraybox for formatting complex equations, providing a detailed example of its application.
  • Several participants express appreciation for the suggestions and indicate they will try the proposed methods.

Areas of Agreement / Disagreement

Participants generally agree on the methods suggested for formatting equations in LaTeX, but there are multiple approaches presented without a consensus on a single best method.

Contextual Notes

Participants discuss specific LaTeX environments and commands, but the limitations of each method and the context in which they are best applied are not fully explored.

opus
Gold Member
Messages
717
Reaction score
131
Please see the attached image for reference. I'm looking for a way to kind of "indent" in my steps to make it clear that I'm working on a subset of a problem. For example in this case, I want to evaluate each integral separately in kind of a sub step to so that everything is not running down in one line. If possible, I'd like to be able to line up my equal signs in the subset with each other too.
Please let me know if you can't see the image well.
Thanks!
 

Attachments

  • Screen Shot 2019-01-27 at 3.09.13 PM.png
    Screen Shot 2019-01-27 at 3.09.13 PM.png
    11.3 KB · Views: 516
Physics news on Phys.org
Do you ask the question with respect to a LaTeX editor, or do you want to know how it works here?

In a LaTeX editor you can use structures as
\begin{align*}
A=& A_0 \\
& A_1\\
& A_2\\
\\
B=&B_0\\
& B_1\\
& B_2\\
&\\
etc. &
\end{align*}

which should also work here. Press "Reply" to see the code. Of course you can have more than one tab "&".
 
My eyes hurt from that spacing. :rolleyes: (It is an illness I have, my PhD student has been wondering for years how I can see such things.)

In the align environment, the ampersand needs to go before the relation for proper spacing. If you need to use a line without a relation you can always use phantoms.
\begin{align*}
A&=A_1\\
&=A_2\\
&\phantom{{}={}}A_3
\end{align*}
Note that the additional brackets are necessary in the = phantom to create the appropriate spacing for the created box.
 
Thanks all! Let me try this and see if I can make it look decent.
 
I use IEEEeqnarray and IEEEeqnarraybox for this sort of thing, e.g.:

intexample.png

Source (entire document):
Code:
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage[retainorgcmds]{IEEEtrantools}

\newcommand{\rd}{\mathrm{d}}
\newcommand{\lrbrackets}[1]{\biggl[#1\biggr]}

\begin{document}

\begin{IEEEeqnarray}{rCl}
  \int_{-\infty}^{\infty} \rd x \, f(x)
  &=& \int_{-\infty}^{0} \rd x \, f(x)
  + \int_{0}^{\infty} \rd x \, f(x) \nonumber \\
  &=& \int_{-\infty}^{0} \rd x \,
  \begin{IEEEeqnarraybox}[][t]{rl}
    \lrbrackets{ & \text{really long expansion} \\
      & +\> \text{that doesn't fit on one line} }
  \end{IEEEeqnarraybox} \nonumber \\
  &&+\> \int_{0}^{\infty} \rd x \,
  \begin{IEEEeqnarraybox}[][t]{rl}
    \lrbrackets{ & \text{another really long expansion} \\
      & +\> \text{with more terms on the next line} }
  \end{IEEEeqnarraybox} \nonumber \\
  &=& 3 \,.
\end{IEEEeqnarray}

\end{document}

There's a good explanation here: http://moser-isi.ethz.ch/docs/typeset_equations.pdf.
 

Attachments

  • intexample.png
    intexample.png
    3.4 KB · Views: 601
  • Like
Likes   Reactions: Phylosopher and opus
Awesome thanks!
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K