# How can I align this equation in the center?

disclaimer: I'm very new with LaTeX.

I have an equation and by default it is align to right right side (not sure why, I thought the left is usually the default). I want it aligned on the left or center.

My code is:

$$\begin{split} Gest = \\69.73 s^{11} + 2.546e04 s^{10} + 4.948e06 s^9 + 6.943e08 s^8 + 7.08e10 s^7 + 4.952e12 s^6 + 2.304e14 s^5 \\+ 7.106e15 s^4 + 1.455e17 s^3 + 1.89e18 s^2 + 1.259e19 s + 3.154e19 \\-----------------------------------\\ 0.01592 s^{15} + 5.822 s^{14} + 1372 s^{13} + 2.441e05 s^{12} + 3.255e07 s^{11} + 3.408e09 s^{10}\\ + 2.819e11 s^9 + 1.744e13 s^8 + 7.626e14 s^7 + 2.296e16 s^6 + 4.712e17 s^5 + 6.318e18 s^4 \\+ 4.729e19 s^3 + 1.696e20 s^2 + 2.305e20 s + 8.076e19 \label{} \end{split}$$


• \begin{flushleft}...\end{flushleft} (does not work)
• \begin{align*}...\end{align*} (returns error)

but no success. Could not find anything else. Any advice?

• Try multline instead of equation. Commented Jun 7, 2018 at 13:39
• What is \\-----------------------------------\ supposed to signify?
– Mico
Commented Jun 7, 2018 at 13:50

A possible solution, but I think it would be better to give a name to numerator and denominator and the writing the fraction with those symbols.

\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{siunitx}

\begin{document}

\mathit{Gest} = \frac{ \begin{aligned} & \num{69.73} s^{11} + \num{2.546e04} s^{10} + \num{4.948e06} s^9 + \num{6.943e08} s^8 \\ &+ \num{7.08e10} s^7 + \num{4.952e12} s^6 + \num{2.304e14} s^5 + \num{7.106e15} s^4 \\ &+ \num{1.455e17} s^3 + \num{1.89e18} s^2 + \num{1.259e19} s + \num{3.154e19} \end{aligned} }{ \begin{aligned} & \num{0.01592} s^{15} + \num{5.822} s^{14} + \num{1372} s^{13} + \num{2.441e05} s^{12} \\ &+ \num{3.255e07} s^{11} + \num{3.408e09} s^{10} + \num{2.819e11} s^9 + \num{1.744e13} s^8 \\ &+ \num{7.626e14} s^7 + \num{2.296e16} s^6 + \num{4.712e17} s^5 + \num{6.318e18} s^4 \\ &+ \num{4.729e19} s^3 + \num{1.696e20} s^2 + \num{2.305e20} s + \num{8.076e19} \end{aligned} }

\end{document}


\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{siunitx}

\begin{document}

\begin{gathered} \mathit{Gest} = \frac{A}{B} \\ \begin{aligned} A &= \begin{aligned}[t] & \num{69.73} s^{11} + \num{2.546e04} s^{10} + \num{4.948e06} s^9 + \num{6.943e08} s^8 \\ &+ \num{7.08e10} s^7 + \num{4.952e12} s^6 + \num{2.304e14} s^5 + \num{7.106e15} s^4 \\ &+ \num{1.455e17} s^3 + \num{1.89e18} s^2 + \num{1.259e19} s + \num{3.154e19} \end{aligned} \\ B &= \begin{aligned}[t] & \num{0.01592} s^{15} + \num{5.822} s^{14} + \num{1372} s^{13} + \num{2.441e05} s^{12} \\ &+ \num{3.255e07} s^{11} + \num{3.408e09} s^{10} + \num{2.819e11} s^9 + \num{1.744e13} s^8 \\ &+ \num{7.626e14} s^7 + \num{2.296e16} s^6 + \num{4.712e17} s^5 + \num{6.318e18} s^4 \\ &+ \num{4.729e19} s^3 + \num{1.696e20} s^2 + \num{2.305e20} s + \num{8.076e19} \end{aligned} \end{aligned} \end{gathered}

\end{document}


• this is a very good suggestions (the second thing you did). Thank you for that :) Commented Jun 12, 2018 at 11:51

(edited to reflect the OP's comment that "the dash lines where to make it look like an fraction")

The following solution uses a \frac directive, with \parboxes in the numerator and denominator; that way, LaTeX is free to find suitable line breaks on its own.

\documentclass{article}
\usepackage{amsmath}
\newcommand\mybox[1]{\parbox{0.75\textwidth}{\centering $#1$}}
\begin{document}
$$\label{} Gest = \frac{\mybox{69.73 s^{11} + 2.546e04 s^{10} + 4.948e06 s^9 + 6.943e08 s^8 + 7.08e10 s^7 + 4.952e12 s^6 + 2.304e14 s^5 + 7.106e15 s^4 + 1.455e17 s^3 + 1.89e18 s^2 + 1.259e19 s + 3.154e19}}{\mybox{0.01592 s^{15} + 5.822 s^{14} + 1372 s^{13} + 2.441e05 s^{12} + 3.255e07 s^{11} + 3.408e09 s^{10} + 2.819e11 s^9 + 1.744e13 s^8 + 7.626e14 s^7 + 2.296e16 s^6 + 4.712e17 s^5 + 6.318e18 s^4 + 4.729e19 s^3 + 1.696e20 s^2 + 2.305e20 s + 8.076e19}}$$
\end{document}


Addendum: All those 2.546e04-like terms are not visually satisfying. I suggest you also load the siunitx package and encase the numbers in \num{...} wrappers. (Aside: the \mathstrut directives are there to generate more visual separation around the fraction line.)

\documentclass{article}
\usepackage{amsmath,siunitx}
\sisetup{exponent-product={{}\cdot{}},tight-spacing}

\newcommand\mybox[1]{\parbox{0.79\textwidth}{\centering $#1$}}
\begin{document}
$$\label{} Gest = \frac{\mybox{69.73 s^{11} + \num{2.546e04} s^{10} + \num{4.948e06} s^9 + \num{6.943e08} s^8 + \num{7.08e10} s^7 + \num{4.952e12} s^6 + \num{2.304e14} s^5 + \num{7.106e15} s^4 + \num{1.455e17} s^3 + \num{1.89e18} s^2 + \num{1.259e19} s + \num{3.154e19}_{\mathstrut}}}{% \mybox{0.01592 s^{15} + 5.822 s^{14^{\mathstrut}} + 1372 s^{13} + \num{2.441e05} s^{12} + \num{3.255e07} s^{11} + \num{3.408e09} s^{10} + \num{2.819e11} s^9 + \num{1.744e13} s^8 + \num{7.626e14} s^7 + \num{2.296e16} s^6 + \num{4.712e17} s^5 + \num{6.318e18} s^4 + \num{4.729e19} s^3 + \num{1.696e20} s^2 + \num{2.305e20} s + \num{8.076e19}}}$$
\end{document}


You need to use the alignment character & to specify where it should be aligned. I also included the space \quad to align after the =.

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\begin{document}
$$\begin{split} G_{\text{est}} &= 69.73 s^{11} + 2.546e04 s^{10} + 4.948e06 s^9 + 6.943e08 s^8 + 7.08e10 s^7 + 4.952e12 s^6 + 2.304e14 s^5 \\ &\quad + 7.106e15 s^4 + 1.455e17 s^3 + 1.89e18 s^2 + 1.259e19 s + 3.154e19 \\ &\quad -----------------------------------\\ &\quad +0.01592 s^{15} + 5.822 s^{14} + 1372 s^{13} + 2.441e05 s^{12} + 3.255e07 s^{11} + 3.408e09 s^{10}\\ &\quad + 2.819e11 s^9 + 1.744e13 s^8 + 7.626e14 s^7 + 2.296e16 s^6 + 4.712e17 s^5 + 6.318e18 s^4 \\ &\quad + 4.729e19 s^3 + 1.696e20 s^2 + 2.305e20 s + 8.076e19 \label{eq:longeq} \end{split}$$
\end{document}


Still, the lines are too long, at least with the default text width settings. Also, to get the numbering on the last row I would prefer align. (Since I did not understand the dashed line I removed it.)

\begin{align}
G_{\text{est}} &= 69.73 s^{11} + 2.546e04 s^{10} + 4.948e06 s^9 + 6.943e08 s^8 + 7.08e10 s^7 \nonumber\\
&\quad + 4.952e12 s^6 + 2.304e14 s^5 + 7.106e15 s^4 + 1.455e17 s^3 + 1.89e18 s^2 \nonumber\\
&\quad + 1.259e19 s + 3.154e19 + 0.01592 s^{15} + 5.822 s^{14} + 1372 s^{13} \nonumber\\
&\quad + 2.441e05 s^{12} + 3.255e07 s^{11} + 3.408e09 s^{10} + 2.819e11 s^9 + 1.744e13 s^8 \nonumber\\
&\quad + 7.626e14 s^7 + 2.296e16 s^6 + 4.712e17 s^5 + 6.318e18 s^4 + 4.729e19 s^3 \nonumber\\
&\quad + 1.696e20 s^2 + 2.305e20 s + 8.076e19
\label{eq:longeq}
\end{align}


EDIT

With the dashed line denoting a fraction I would do something like this.

$$\label{eq:1} G_{\text{est}}=\frac{G_1}{G_2}$$
where
\begin{align}
G_1 &= 69.73 s^{11} + 2.546e04 s^{10} + 4.948e06 s^9 + 6.943e08 s^8 + 7.08e10 s^7 \nonumber\\
&\quad + 4.952e12 s^6 + 2.304e14 s^5 + 7.106e15 s^4 + 1.455e17 s^3 + 1.89e18 s^2 \nonumber\\
&\quad + 1.259e19 s + 3.154e19 \\
G_2 &= 0.01592 s^{15} + 5.822 s^{14} + 1372 s^{13} + 2.441e05 s^{12} + 3.255e07 s^{11} \nonumber\\
&\quad + 3.408e09 s^{10} + 2.819e11 s^9 + 1.744e13 s^8 + 7.626e14 s^7 \nonumber\\
&\quad + 2.296e16 s^6 + 4.712e17 s^5 + 6.318e18 s^4 + 4.729e19 s^3 \nonumber\\
&\quad + 1.696e20 s^2 + 2.305e20 s + 8.076e19
\end{align}


• the dash lines where to make it look like an fraction, because I could not find anything that would work with \frac{}{}. Will try out your suggestion. Commented Jun 7, 2018 at 14:03
• See edit, both this and Mico's Commented Jun 7, 2018 at 14:15