How to format "sub step indentations" in LaTeX

  • Context: LaTeX 
  • Thread starter Thread starter opus
  • Start date Start date
  • Tags Tags
    Format Latex
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 2K views
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: 531
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: 615
  • Like
Likes   Reactions: Phylosopher and opus
Awesome thanks!