3

I would like to know how to break a long equation into two lines and have both lines centered. Besides, I would like to have only one equation number in the middle of both lines.

Here's a MWE:

\documentclass{article}

\usepackage{amsfonts, amsthm, amsmath, amssymb}

\begin{document}



\noindent Text text text text text text text:
%
\begin{align}
123456789012345678901234567890123456789012345678901234567890=\\
123456789012345678901234567890123456789012345678901234567890\text{.}
\end{align}
%
Text text text text text text text.



\end{document}

I found something here: How to get only one vertically centered equation number in align environment with two equations.

In the link above the accepted answer explains how to have only one equation number in the middle of both lines. But I would like to have both lines centered, not aligned.

7
  • Can you make an example with TeX code?
    – egreg
    Commented Dec 25, 2014 at 23:11
  • Ok, I'll do it in a minute.
    – User X
    Commented Dec 25, 2014 at 23:11
  • @egreg I added a MWE.
    – User X
    Commented Dec 25, 2014 at 23:26
  • Sorry, for some reason when the equation is the last thing on the page, the equation number appears below the second line of the equation.
    – User X
    Commented Dec 25, 2014 at 23:46
  • 1
    If the object is too wide and there's no space for the equation number, it's shifted down; it doesn't depend on the position on the page.
    – egreg
    Commented Dec 25, 2014 at 23:47

2 Answers 2

3

amsmath has documentation explaining a number of different environments and is worth a look. For example:

\documentclass{article}

\usepackage{amsfonts, amsthm, amsmath, amssymb}

\begin{document}

  \noindent Text text text text text text text:
  \begin{equation}
    \begin{split}
      123456789012345678901234567890123456789012345678901234567890=\\
      123456789012345678901234567890123456789012345678901234567890\text{.}
    \end{split}
  \end{equation}
  Text text text text text text text.

\end{document}

split equation

2
  • 3
    Or gathered if right alignment of the two pieces is not wanted.
    – egreg
    Commented Dec 25, 2014 at 23:35
  • Or multline??
    – cfr
    Commented Dec 25, 2014 at 23:51
1

This uses the \Centerstack macro of stackengine. The distance between baselines is set with \setstackgap{L}{} to 14pt.

\documentclass{article}
\usepackage{amsmath}
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
\noindent Text text text text text text text:
%
\begin{equation}
\setstackgap{L}{14pt}
\Centerstack{123456789012345678901234567890123456789012345678901234567890=\\
123456789012345678901234567890123456789012345678901234567890\text{.}}
\end{equation}
%
Text text text text text text text.
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .