Text Formattingaligning text seperatly within aligned maths

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

aligning text seperatly within aligned maths

Post by stephenteacher »

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:

Code: Select all

\documentclass[a4paper,12pt]{report}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{array}
\begin{align*}
a long equation&=a long equation \\
more equation&=more equation \\
\text{things I want to say to make life easier to understand equation} \\
a long equation&=a long equation \\
more equation&=more equation \\
\text{other stuff I want to say} \\
more equation&=more equation \\
\end{align*}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

aligning text seperatly within aligned maths

Post by stephenteacher »

Never mind.

Solved with

Code: Select all

\noalign{\text{My text here:}} \\
Unless there is a better way..?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

aligning text seperatly within aligned maths

Post by Johannes_B »

Hi and welcome,

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

Code: Select all

\documentclass[a4paper,12pt]{report}
\usepackage{mathtools}
\begin{document}
\begin{align*}
	a long equation&=a long equation \\
	more equation&=more equation \\
	\shortintertext{things I want to say to make life easier to understand equation}
	a long equation&=a long equation \\
	more equation&=more equation \\
	\shortintertext{other stuff I want to say}
	more equation&=more equation \\
\end{align*}
\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

Re: aligning text seperatly within aligned maths

Post by stephenteacher »

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