LaTeX forum ⇒ Text Formattingaligning text seperatly within aligned maths Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
stephenteacher
Posts: 3
Joined: Fri May 22, 2015 12:16 pm

aligning text seperatly within aligned maths

Postby stephenteacher » Fri May 22, 2015 12:41 pm

I want to show the working out of an equation with explanatory text interspersed. Is there any way of left aligning the comments while in the align* or other environment? What I have so far:

  1. \documentclass[a4paper,12pt]{report}
  2. \usepackage{amsmath}
  3. \usepackage{graphicx}
  4. \usepackage{gensymb}
  5. \usepackage{array}
  6. \begin{align*}
  7. a long equation&=a long equation \\
  8. more equation&=more equation \\
  9. \text{things I want to say to make life easier to understand equation} \\
  10. a long equation&=a long equation \\
  11. more equation&=more equation \\
  12. \text{other stuff I want to say} \\
  13. more equation&=more equation \\
  14. \end{align*}

stephenteacher
Posts: 3
Joined: Fri May 22, 2015 12:16 pm

Postby stephenteacher » Fri May 22, 2015 12:51 pm

Never mind.

Solved with

  1. \noalign{\text{My text here:}} \\


Unless there is a better way..?

User avatar
Johannes_B
Site Moderator
Posts: 3853
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri May 22, 2015 1:19 pm

Hi and welcome,

i suggest an alternative solution using shortintertext from package mathtools, providing some extensions and fixes for package amsmath.

  1. \documentclass[a4paper,12pt]{report}
  2. \usepackage{mathtools}
  3. \begin{document}
  4. \begin{align*}
  5. a long equation&=a long equation \\
  6. more equation&=more equation \\
  7. \shortintertext{things I want to say to make life easier to understand equation}
  8. a long equation&=a long equation \\
  9. more equation&=more equation \\
  10. \shortintertext{other stuff I want to say}
  11. more equation&=more equation \\
  12. \end{align*}
  13. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

stephenteacher
Posts: 3
Joined: Fri May 22, 2015 12:16 pm

Postby stephenteacher » Fri May 22, 2015 3:58 pm

Less \'s and {}. I like. Thank you.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 7 guests