Math & Scienceflalign and intertext

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

flalign and intertext

Post by yiorgosb »

I am trying to place some text between two subequations. The intertext command works as long as the text consists of a single paragraph. When I add a new paragraph I get an error in alignment. Specifically, I want no indentation for the first paragraph and a normal indentation for the second one. I tried every possible way I could think of without any result. Here's my last try (doesn't work either-2nd paragraph doesn't indent):

Code: Select all

\begin{subequations}
\begin{flalign}
	&&	\x_1y_1\ & = \x_2y_2. & \\
	\intertext{\noindent \flushleft First paragraph.... \linebreak
	\indent Second paragraph....}
	& \rlap{\ } &  x_1  &=x_2. & \llap{\ [$y=const. $]} 
\end{flalign}
\end{subequations}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

flalign and intertext

Post by coachbennett1981 »

I could not get your code to work. Could you put up an MWE for me to look at. I use interext often. Could you use this code and work your problem out?

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amssymb,amsfonts}
\begin{document}

\begin{align*}
y&=mx+b \\
x&=\dfrac{y-b}{m} \\
\intertext{To find the slope use this:}
m&=\dfrac{y_2-y_1}{x_2-x_1} \\
\intertext{\indent Math is really fun and I enjoy it but I hate this equation}
x&=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a} \\
\end{align*}

\end{document}
I hope this helps...
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

flalign and intertext

Post by gmedina »

Hi,

you can use a \parbox and emulate a new paragraph by using a line-changing command \\ together with a \hspace* with proper value (this value, of couse, will be given by \parindent as defined in your document class; to find out this value, you can use \the\parindent). Take a look at the following example:

Code: Select all

\documentclass{book}
\usepackage{amsmath,amssymb,amsfonts}

\begin{document}

\the\parindent% to get the value of indentation of the first line of a paragraph

\begin{align*}
  y &= mx+b \\
 x &= \dfrac{y-b}{m} \\
  \intertext{\parbox{\linewidth}{First paragraph\\
    \hspace*{15pt}Second paragraph}}
  m &= \dfrac{y_2-y_1}{x_2-x_1} 
\end{align*}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply