How to format "sub step indentations" in LaTeX

In summary: I'll check out that resource.In summary, the conversation discusses different ways to format equations and align them properly in a LaTeX editor. The suggested methods include using structures such as align or IEEEeqnarray, using ampersands before relations for proper spacing, and using phantoms for lines without relations. A helpful resource for formatting equations is also mentioned.
  • #1
opus
Gold Member
717
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: 440
Physics news on Phys.org
  • #2
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 "&".
 
  • #3
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.
 
  • #4
Thanks all! Let me try this and see if I can make it look decent.
 
  • #5
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: 488
  • Like
Likes Phylosopher and opus
  • #6
Awesome thanks!
 

1. How do I create sub step indentations in LaTeX?

To create sub step indentations in LaTeX, you can use the \subsubsection command. This will create a subheading with a smaller font size and an indent. You can also use the \indent command before a paragraph to manually indent it.

2. Can I change the indentation size of sub steps in LaTeX?

Yes, you can change the indentation size of sub steps in LaTeX by using the \setlength{\subsubsecindent}{value} command. This will set the indentation size for all sub steps in your document. You can also use the \hspace{value} command to manually adjust the indentation for a specific sub step.

3. How do I change the numbering style for sub steps in LaTeX?

To change the numbering style for sub steps in LaTeX, you can use the \renewcommand{\thesubsubsection}{\alph{subsubsection}} command. This will change the numbering from numerical (1, 2, 3) to alphabetical (a, b, c). You can also use other options such as \roman for roman numerals or \greek for Greek letters.

4. Can I create sub steps within sub steps in LaTeX?

Yes, you can create sub steps within sub steps in LaTeX by using the \paragraph{sub step title} command. This will create a sub sub step with an even smaller font size and a further indent. You can also use the \subparagraph{sub sub step title} command for an even deeper level of sub steps.

5. How do I remove the indentation for a specific sub step in LaTeX?

To remove the indentation for a specific sub step in LaTeX, you can use the \noindent command before the sub step. This will prevent the sub step from being indented. You can also use the \hspace{-value} command to manually adjust the indentation back to the left margin.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
2
Replies
36
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
20
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Astronomy and Astrophysics
Replies
26
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
274
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Precalculus Mathematics Homework Help
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top