3

I have an equation in display mode and would like to make it bigger using \Large, but the equation runs off the right side of the page while there is much room on the left side of the page.

The equation would fit if I could just center it.

How can I do this?

\documentclass[12pt, landscape]{article}

\usepackage{amsmath}
\begin{document}

 {\Large$$\sum_{t_1=1}^{n}\binom{n}{t_1}+
 \sum_{t_1=1}^{n-1}\sum_{t_2=1}^{n-1}\binom{n}{t_1,t_2}+\cdots+
 \sum_{t_1=1}^{1}\sum_{t_2=1}^{1}\cdots\sum_{t_n=1}^{1}
  \binom{n}{t_1,t_2, \dots, t_n}$$}

\end{document}
  • Could we have a Minimal Working Example (MWE) please: meta.tex.stackexchange.com/questions/228/… – Au101 Dec 8 '15 at 22:51
  • MWE especially relevant as, generally, displayed equations are centred ... – Au101 Dec 8 '15 at 22:51
  • Please always make your examples complete (in particular \binom is not defined by default) Your example does not centre as it is too large TeX reports Overfull \hbox (63.78322pt too wide) detected at line 8 – David Carlisle Dec 8 '15 at 23:07
  • Displayed equations are not centered completely. If they are small then they appear centered but if I have a long equation, it always runs off the right side. – Al Jebr Dec 8 '15 at 23:07
  • 1
    It means that the equation is 63pt (so almost an inch or 2cm) too big to fit in the space which is why it overprints the right margin. TeX will centre equations that fit. Over-large content always sticks into the right margin. – David Carlisle Dec 8 '15 at 23:10
2

I advise against using \Large equations, particularly if this creates too wide an object.

However, here's a possible solution that doesn't mess up the vertical spacing:

\documentclass[12pt]{article}
\usepackage{amsmath}

\usepackage{lipsum}

\begin{document}

\lipsum*[2]
\[
\noindent\begin{minipage}{\textwidth}
\Large
\[
\hidewidth
\sum_{t_1=1}^{n}\binom{n}{t_1}+
 \sum_{t_1=1}^{n-1}\sum_{t_2=1}^{n-1}\binom{n}{t_1,t_2}+\dots+
 \sum_{t_1=1}^{1}\sum_{t_2=1}^{1}\cdots\sum_{t_n=1}^{1}
  \binom{n}{t_1,t_2, \dots, t_n}
\hidewidth
\]
\end{minipage}
\]
\lipsum[3]

\end{document}

enter image description here

1

A small suggestion to start with: Don't use \cdots; since you're using the amsmath package, just use \dots and let the software work out which type of typographic ellipses are best.

If you want to typeset the equation in portrait mode at 12pt and a \Large relative font size, and if you're working with an "A4" paper size, you'll need to set the margins to 2cm.

enter image description here

\documentclass[12pt]{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{amsmath}
\begin{document}
{\Large
\[
\sum_{t_1=1}^{n}\binom{n}{t_1}+
\sum_{t_1=1}^{n-1}\sum_{t_2=1}^{n-1}
  \binom{n}{t_1,t_2}+\dots+
\sum_{t_1=1}^{1}\sum_{t_2=1}^{1}\dots\sum_{t_n=1}^{1}
  \binom{n}{t_1,t_2, \dots, t_n}
\]
}
\end{document}
  • I found \hspace*{-(value here)mm} works. – Al Jebr Dec 8 '15 at 23:27
  • @AlJebr - There are quite a few postings on this site on how to widen the text block temporarily, say, in order to accommodate an extra-wide equation. The \hspace*{...} approach "works", but it suffers from the drawback that the equation won't necessarily be centered correctly -- at least not without engaging in a lot of trial and error work. – Mico Dec 8 '15 at 23:31
  • That is true. I found myself adjusting and just eyeing it. Are there simple methods similar to \hspace* that will work precisely? – Al Jebr Dec 8 '15 at 23:32
0

Equations centre by default:

enter image description here

\documentclass{article}  


\begin{document}

\noindent X\dotfill X

aaaaa
%
{\large
\[
a+b+c+d=
a+b+c+d=
a+b+c+d=
a+b+c+d=
a+b+c+d
\]}


\end{document}
  • It doesn't center. It runs off to the right more than the left. – Al Jebr Dec 8 '15 at 23:02
  • the above example is centred, I see you have added an example, let me run that and see... – David Carlisle Dec 8 '15 at 23:04
0

You have more possibilities:

  • if equation is not numbered, than try:

\begin{center}\Large $\displaystyle a^2 + b^2 = c^2 \end{center}

  • if equation is numbered, than try:

\begin{equation}\Large \hspace*{-< x em>} a^2 + b^2 = c^2 \end{equation}

where < x em> you select so, that equation will be centered. Both suggestion are not tested, since you doesn't provide minimal working example, which would show your problem.

  • I tried this. It runs off to the right. – Al Jebr Dec 8 '15 at 23:02
  • I don't belive you. Please, provide MWE, which will show this. If something is centered, than can not protrude out just in one side. Maybe you have something hidden there. For second case you not adjust properly. Tested. – Zarko Dec 8 '15 at 23:22
0

Alright.

Displayed equations are always centred. The exact middle of the equation shall be exactly half way between the margins if the equation is smaller than the margins. So, you can imagine, a centred equation will expand outwards until it comes up against the margins (I doubt this is precisely how TeX places its centred material, but obviously when you centre something, the centre of that thing should be mid-way between the two margins and the longer the equation, the closer the left- and rightmost ends of the equation shall be to the margins.) This is what TeX does. Thus:

\documentclass[12pt, landscape]{article}
\usepackage[showframe,margin=2in]{geometry}
\geometry{a4paper}
\usepackage{amsmath}

\begin{document}

\[
  x
\]
\[
  x + y
\]
\[
  \frac{1}{c^{2}} \frac{\partial^{2}}{\partial t^{2}} \psi -
  \nabla^{2} \psi + \frac{m^{2}c^{2}}{\hbar^{2}} \psi = 0
\]
\[
  \overbrace{\int_{y_{1}}^{y_{2}} x(y) \, dy}^{A_{1}} +
  \overbrace{\int_{x_{1}}^{x_{2}} y(x) \, dx}^{A_{2}} = x.y(x)
  \biggr|_{x_{1}}^{x_{2}} = y.x(y) \biggr|_{y_{1}}^{y_{2}}
\]

\end{document}

enter image description here

If your equation is as wide as the space between the margins, obviously, it will fill up the entire space. If your equation is wider than the margins, then the leftmost end of the equation will be forced up against the margin and TeX will have no choice but to print the rightmost end of the equation in the right hand margin and eventually off the page.

Adding:

\[
  \int \frac{dx}{x^{2^{n}} + 1} = \sum_{k = 1}^{2^{n - 1}}
  \left\{\frac{1}{2^{n - 1}} \left[\sin\left(\frac{(2k -
          1)\pi}{2^{n}}\right) \arctan \left[\left(x -
          \cos\left(\frac{(2k - 1)\pi}{2^{n}}\right)\right) \csc
        \left( \frac{(2k - 1)\pi}{2^{n}}\right)\right]\right] -
    \frac{1}{2^{n}} \left[\cos \left(\frac{(2k - 1)\pi}{2^{n}}\right)
      \ln \left| x^{2} - 2x \cos \left(\frac{(2k -
            1)\pi}{2^{n}}\right) + 1\right| \right]\right\}
\]

enter image description here

TeX doesn't centre content on the page, it centres it between the margins, between the margins is where the text goes. So, if your equation is longer than the space between the margins, you have to either modify the margins, or the equation.

It's not that the final equation isn't centred. The left-margin is the limit. Because the equation is too long, TeX has been forced to print the excess in the margin and off the page. If I have a 5 metre long garage and a 4.2 metre long car, I can park my car in the centre of my garage. The back of the car will be 40 cm from the back of the garage and the front of the car will be 40 cm from the front of the garage. If I have a 5 metre long car, the back of the car will be up against the back wall and the front of the car will be up against the door. If I have a 6 metre long car, the front of the car is going to stick out of the front of the garage. That's what's happened to you.

So:


Consider

\usepackage[margin=2in]{geometry}
\geometry{a4paper}

With \usepackage{amsmath} and \begin{document} & \end{document} added to your MWE:

\documentclass[12pt, landscape]{article}
\usepackage[margin=2in]{geometry}
\geometry{a4paper}
\usepackage{amsmath}

\begin{document}

{\Large
  $$\sum_{t_{1} = 1}^{n} \binom{n}{t_{1}} + \sum_{t_{1} = 1}^{n-1}
  \sum_{t_{2} = 1}^{n-1} \binom{n}{t_{1},t_{2}} + \cdots + \sum_{t_{1} =
    1}^{1} \sum_{t_{2} = 1}^{1} \cdots \sum_{t_{n} = 1}^{1}
  \binom{n}{t_{1},t_{2}, \dots, t_{n}}$$
}

\end{document}

Also try \[ ... \] instead of $$ ... $$, see: Why is \[ ... \] preferable to $$ ... $$?

enter image description here

  • I currently have margins at 2 inches. – Al Jebr Dec 8 '15 at 23:05
  • Well change it to 2 inches then :) – Au101 Dec 8 '15 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.