Math & Scienceamsmath | Center split Equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
laailalalaa
Posts: 35
Joined: Thu Oct 27, 2011 5:31 pm

amsmath | Center split Equation

Post by laailalalaa »

Hello,

I have the following equation:

Code: Select all

\begin{definition}[\textbf{function jazzup}]
\begin{equation}
\begin{split}
jazzup : X \times Y \to [0,1],\\
long definition of the jazzup function
\end{split}
\end{equation}
\end{definition}
for which two lines of text are required.

If I don't use split, I get two equation numbers, one for each line of text, which I don't want.

Using split, the two lines of text are aligned to the right. Can I center them?

Thanks
Last edited by laailalalaa on Mon Feb 27, 2012 6:37 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

amsmath | Center split Equation

Post by kaiserkarl13 »

You might not be able to do precisely what you asked to do, but one of the following may be what you want to do (or close to it):
  • Use the multline environment intstead of equation; this will put the first line left-aligned and the second line right-aligned
  • Use the split environment with align symbols at the beginning of the line (actually, put them wherever you want the equations to line up)
  • Use the gather environment with a \notag command at the end of each line for which you do not want an equation number to be printed. You can then print the number only on the last line, for example.
Unfortunately, there is no "unaligned" version of the split environment included with AMSLaTeX.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

amsmath | Center split Equation

Post by Stefan Kottwitz »

Besides the mentioned alternatives, you could use the gathered environment of amsmath, which produces a centered multi-line block without number, embedding it into the equation environment for getting a single centered number:

Code: Select all

\begin{equation}
  \begin{gathered}
  jazzup : X \times Y \to [0,1],\\
  long definition of the jazzup function
  \end{gathered}
\end{equation}
Stefan
LaTeX.org admin
laailalalaa
Posts: 35
Joined: Thu Oct 27, 2011 5:31 pm

Re: amsmath | Center split Equation

Post by laailalalaa »

thanks, Stepan_K, correct and easy to use solution..
Post Reply