Math & Science ⇒ Placing Text Between Equations
-
- Posts: 7
- Joined: Thu Apr 25, 2019 5:45 pm
Placing Text Between Equations
\begin{align}
eqn1 \\[10pt]
eqn2
\end{align}
\begin{center}
or
\end{center}
\begin{align}
eqn3
\end{align}
I'm guessing the spacing has something to do with the template I downloaded. Any help would be great! Thanks!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Placing Text Between Equations
Code: Select all
\documentclass{article}\usepackage{mathtools}\begin{document}\begin{align}eqn1 \\[10pt]eqn2\\\intertext{\centering text}eqn3\end{align}\end{document}
-
- Posts: 7
- Joined: Thu Apr 25, 2019 5:45 pm
Placing Text Between Equations
Yes, that works great, but is there a way to shorten the distance between the text and equations? It's still obnoxiously large. Thank you for the reply, by the way!user22741 wrote:Are you searching for `\intertext{}`?
Code: Select all
Code, edit and compile here:\documentclass{article}\usepackage{mathtools}\begin{document}\begin{align}eqn1 \\[10pt]eqn2\\\intertext{\centering text}eqn3\end{align}\end{document}
Placing Text Between Equations
-
- Posts: 7
- Joined: Thu Apr 25, 2019 5:45 pm
Placing Text Between Equations
user22741 wrote:can you show some example code that produces obnoxiously large spacing? I only get the usual above and below display skip in my example.
\documentclass[review]{elsarticle}
\usepackage{lineno,hyperref,upgreek,graphicx,chemformula,subfig}
\modulolinenumbers[5]
\begin{document}
\begin{frontmatter}
\begin{align}
\ch{Ce + H_2 -> CeH_2}, \qquad \qquad \Delta &G_{rxn}^\circ=-115 kJ/mol \\[10pt]
\ch{CeH_2 + 2.5Cl_2 -> CeCl_3 + 2HCl}, \qquad \qquad \Delta &G_{rxn}^\circ=-1007 kJ/mol
\intertext{\centering or}
\ch{CeH_2 + 1.5Cl_2 -> CeCl_3 + H_2}, \qquad \qquad \Delta &G_{rxn}^\circ=-812 kJ/mol
\end{align}
\vspace{0.1mm}
The attached picture is what it looks like. It might be the same spacing between each line, but it doesn't look right that the second and third equations are so far apart.
Sorry is that enough code? I'm not exactly sure how to use this forum either...

Placing Text Between Equations
Code: Select all
\documentclass[review]{elsarticle}\usepackage{lineno,hyperref,upgreek,graphicx,chemformula,subfig}\modulolinenumbers[5]\begin{document}\begin{align}\ch{Ce + H_2 -> CeH_2}, \qquad \qquad \Delta &G_{rxn}^\circ=-115 kJ/mol \\[10pt]\ch{CeH_2 + 2.5Cl_2 -> CeCl_3 + 2HCl}, \qquad \qquad \Delta &G_{rxn}^\circ=-1007 kJ/mol\\[-40pt]\intertext{\centering or \vskip-20pt}\ch{CeH_2 + 1.5Cl_2 -> CeCl_3 + H_2}, \qquad \qquad \Delta &G_{rxn}^\circ=-812 kJ/mol\end{align}\end{document}
-
- Posts: 7
- Joined: Thu Apr 25, 2019 5:45 pm
Placing Text Between Equations
Perfect! I didn't know you could put negative values in spacing. Thank you so much!user22741 wrote:Your output looks just as it should. If you really want to reduce the space:
Code: Select all
Code, edit and compile here:\documentclass[review]{elsarticle}\usepackage{lineno,hyperref,upgreek,graphicx,chemformula,subfig}\modulolinenumbers[5]\begin{document}\begin{align}\ch{Ce + H_2 -> CeH_2}, \qquad \qquad \Delta &G_{rxn}^\circ=-115 kJ/mol \\[10pt]\ch{CeH_2 + 2.5Cl_2 -> CeCl_3 + 2HCl}, \qquad \qquad \Delta &G_{rxn}^\circ=-1007 kJ/mol\\[-40pt]\intertext{\centering or \vskip-20pt}\ch{CeH_2 + 1.5Cl_2 -> CeCl_3 + H_2}, \qquad \qquad \Delta &G_{rxn}^\circ=-812 kJ/mol\end{align}\end{document}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm