2

I am using a two-column layout in my latex source file, and I have a series of (inequality) equations to show, which I wanted to keep them inside the left column. However, with \begin{align*} environment, it makes the equations overflow the column, and takes up some extra space in the right column. You can refer to the pictures I attached here to see what happens. Howe can I constrain the equations to be just within the first column?

enter image description here

Here's my latex source code. and here's a MWE you can try on..

% \documentclass[conference]{IEEEtran}
\documentclass[10pt,conference,letterpaper]{IEEEtran}

\usepackage{amsmath}
\begin{document}

as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
    \begin{align*}
        & \sum\nolimits_{e \in E^*} COST(g(e))\\
    &= \sum\nolimits_{e \in S_1} COST(g(e))
                                            + \sum\nolimits_{e \in S_2} COST(g(e))
                                            + \sum\nolimits_{e \in S_3} COST(g(e))\\
                        &\le 
                            2(1+\epsilon) COST(T^* \setminus T) 
                            +  COST(T^* \cap T)
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                            &\le 2(1+\epsilon)(COST(T^* \setminus T) + COST(T^* \cap T))
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                        &\le 2(1+\epsilon)COST(T^*)
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                        &\le 4(1+\epsilon)OPT_n
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                        &\le 4+10\epsilon OPT_n
    \end{align*}
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj

as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj




\end{document}
  • It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that reproduces up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Sep 24 '14 at 3:15
  • please see my update – Daniel Sep 24 '14 at 3:35
  • 1
    just to point out a misconception ... align actually assumes that the available horizontal space is only one column wide. however, since the material on the long lines can't be broken, it will extend past the defined boundary, and there will be an overfull hbox message in the log file. also, if the file were processed in [draft] mode, there would be a very visible black line extending down to the right of the aligned material in the middle of the second column to show where the problem is. latex, in its wisdom, suppresses that by default. – barbara beeton Sep 24 '14 at 14:14
0

This is one possible solution. use of resizebox from graphicx package and parbox combo as shown below.

 \resizebox{0.48\textwidth}{!}{\parbox{\linewidth}{ math envrionment}}

or

 {\tiny \begin{align*} ... \end{align*} environment} 

enter image description here

Code

\documentclass[10pt,conference,letterpaper]{IEEEtran}

\usepackage{amsmath,graphicx}
\begin{document}

as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
\resizebox{0.48\textwidth}{!}{\parbox{\linewidth}{
    \begin{align*}
        & \sum\nolimits_{e \in E^*} COST(g(e))\\
    &= \sum\nolimits_{e \in S_1} COST(g(e))
                                            + \sum\nolimits_{e \in S_2} COST(g(e))
                                            + \sum\nolimits_{e \in S_3} COST(g(e))\\
                        &\le 
                            2(1+\epsilon) COST(T^* \setminus T) 
                            +  COST(T^* \cap T)
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                            &\le 2(1+\epsilon)(COST(T^* \setminus T) + COST(T^* \cap T))
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                        &\le 2(1+\epsilon)COST(T^*)
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                        &\le 4(1+\epsilon)OPT_n
                            + 4\epsilon OPT_n
                            + 2\epsilon OPT_n\\
                        &\le 4+10\epsilon OPT_n
    \end{align*}
}}
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs fsfjslfjslfklsfj
as abcd dsfe fsafs fkasfkds fasf skfsfj safa; ffk sdfksfjsfsjfsdkfsdfkjsf  sfsdfkdf sdfks fksfksdfks fkf sdf sf  sf sf sfa fs fsdf asf sfs fsf sf sf sf sf sfsd fs 
\end{document}
|improve this answer|||||
  • Sorry to get back to you late. I kindof checked the site late. Thanks for your suggestion. It works like a charm. I will accept this as the answer – Daniel Sep 24 '14 at 23:59
1

I suggest you not take any steps that end up reducing the font size used in the math expression relative to that used for the surrounding text. Instead, you might want to pursue the following approach:

  • Don't use the \nolimits modifier after each \sum macro. Instead, encase the \sum{...} expressions in \smashoperator directives; this reduces the amount of whitespace before and after the summation signs. (The \smashoperator macro is provided by the mathtools package, which is an extension of (and loads) the amsmath package.)

  • Insert extra line breaks in lines 3 and 4.

  • Optional: Render "COST" and "OPT" in roman (upright) type. Currently, TeX interprets COST and OPT as groups of four- and three-letter variables, i.e., as C O S T and as O P T, leading to loose and suboptimal inter-letter spacing. (If you wish to render the variable names in italic rather than upright type, use \textit instead of \textup in the macros that define \COST and \OPT.)

enter image description here

\begin{align*}
& \smashoperator{\sum_{e \in E^*}} \COST(g(e))\\
&= \smashoperator{\sum_{e \in S_1}} \COST(g(e)) + 
   \smashoperator{\sum_{e \in S_2}} \COST(g(e)) + 
   \smashoperator{\sum_{e \in S_3}} \COST(g(e))\\
&\le 2(1+\epsilon) \COST(T^* \setminus T) + \COST(T^* \cap T)\\
&\qquad + 4\epsilon \OPT_n + 2\epsilon \OPT_n\\
&\le 2(1+\epsilon)(\COST(T^* \setminus T) + \COST(T^* \cap T))\\
&\qquad + 4\epsilon \OPT_n + 2\epsilon \OPT_n\\
&\le 2(1+\epsilon)\COST(T^*) + 4\epsilon \OPT_n + 2\epsilon \OPT_n\\
&\le 4(1+\epsilon)\OPT_n + 4\epsilon \OPT_n + 2\epsilon \OPT_n\\
&\le 4+10\eps

ilon \OPT_n \end{align*}

|improve this answer|||||
  • Thanks for your input, it's also helpful, but since jesse was the first to answer, I gave him the solution tick. Thanks so much – Daniel Sep 25 '14 at 0:01

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.