Text FormattingFormula too long to fit in a two column page

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Rahul
Posts: 29
Joined: Wed Jul 24, 2013 10:07 am

Formula too long to fit in a two column page

Post by Rahul »

My formula is too long that it is overriding the characters of other column in a two column environment.
What can I do to break it in two parts.??

Code is ::

Code: Select all

 \[
   R' =
    \frac
      {1}{n}
	\left[
	\displaystyle\sum_{i=1}^n b_i
	+s
	\left(
	s\displaystyle\sum_{i=1}^n a_i^2
	-2
	\displaystyle\sum_{i=1}^n a_i b_i
	-s\displaystyle\sum_{i=1}^n \cdot a_i\\
	

	%need a break here

	+2o
	\displaystyle\sum_{i=1}^n a_i
	\right)
	+
	o
	\left(
	no
	-2\displaystyle\sum_{i=1}^n b_i
	\right)
	\right]
\]
problem.jpg
problem.jpg (42.26 KiB) Viewed 8401 times
Last edited by cgnieder on Wed Jul 24, 2013 5:31 pm, edited 1 time in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Formula too long to fit in a two column page

Post by cgnieder »

Could you try to add code markup to your next posts, please. There's a Code button which inserts the [code][/code] tags. Everything in between will be formatted as code.

You should take a look at mathmode and search for the {split} environment.

Regards
site moderator & package author
Rahul
Posts: 29
Joined: Wed Jul 24, 2013 10:07 am

Formula too long to fit in a two column page

Post by Rahul »

Still split environment not working as expected

Code: Select all

 

\[
\begin{split}
   R' =
    \frac
      {1}{n}
	\left[
	\displaystyle\sum_{i=1}^n b_i
	+s
	\left(
	s\displaystyle\sum_{i=1}^n a_i^2
	-2
	\displaystyle\sum_{i=1}^n a_i b_i
	-s\displaystyle\sum_{i=1}^n \cdot a_i\\
	+2
	o
	\displaystyle\sum_{i=1}^n a_i
	\right)
	+
	o
	\left(
	no
	-2\displaystyle\sum_{i=1}^n b_i
	\right)
	\right]
\end{split}
\]


User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Formula too long to fit in a two column page

Post by cgnieder »

This error is not caused by split but by \left<delim> ... \right<delim>. They cannot be split over lines! I'd suggest using combinations of \bigl<delim> ... \bigr<delim> and similar commands. Although the don't scale automatically they can be used across line breaks. Alternatively you could use the invisible delimiter . going something like \left( <formula> \right. \\ \left. <formula>\right) but in this case in can happen that you end up with differently scaled brackets.

Just as an information: there is also the {multline} environment which probably is the better choice here:

Code: Select all

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{lipsum}% dummy text
\begin{document}
\lipsum[1]
\begin{equation}
  \begin{split}
   R' =
    \frac
      {1}{n}
        \Biggl[
        \sum_{i=1}^n b_i
        +s
        \biggl(
        s\sum_{i=1}^n a_i^2
        -2
        \sum_{i=1}^n a_i b_i
        -s\sum_{i=1}^n \cdot a_i \\
        +2
        o
        \sum_{i=1}^n a_i
        \biggr)
        +
        o
        \biggl(
        no
        -2\sum_{i=1}^n b_i
        \biggr)
        \Biggr]
  \end{split}
\end{equation}

\lipsum[1-2]
\begin{multline}
   R' =
    \frac
      {1}{n}
        \Biggl[
        \sum_{i=1}^n b_i
        +s
        \biggl(
        s\sum_{i=1}^n a_i^2
        -2
        \sum_{i=1}^n a_i b_i
        -s\sum_{i=1}^n \cdot a_i \\
        +2
        o
        \sum_{i=1}^n a_i
        \biggr)
        +
        o
        \biggl(
        no
        -2\sum_{i=1}^n b_i
        \biggr)
        \Biggr]
\end{multline}

\lipsum[3-4]
\end{document}
Regards
site moderator & package author
Post Reply