0

On the following example, long equation shows up on the top of the second page.

The equation example is taken from https://tex.stackexchange.com/a/321805/127048.

\documentclass[5p,times]{elsarticle}
\usepackage{lipsum}
\usepackage{amsmath}
\begin{document}
\section{Start}
Hello World
\twocolumn[
{
    \begin{equation}\begin{split}
f_{r:n}(x)&=\frac{n!}{(r-1)!\,(n-r+1)!}
   \Biggl[ \biggl( \frac{x-1}{k}  \biggr)^{\!r-1}
           \biggl( \frac{k-x+1}{k}\biggr)^{\!n-r+1} \\
  &\qquad -\biggl( \frac{x}{k}    \biggr)^{\!r-1}
           \biggl( \frac{k-x}{k}  \biggr)^{\!n-r+1} \,
   \Biggr]+ f_{r-1:n}(x)
\end{split}\end{equation}
       }\bigskip]
\end{document}

output:

enter image description here

Is it possible to force the long equation to show up at the bottom of the first page or right after the Hello World text? Please note that I want to show the long equation in both of the two columns rather than fitting it into single column of the double-column.

4
  • 2
    The \twocolumn command forces a page break. If you don't want to force a page break, don't execute \twocolumn. Do please tell us what you are trying to achieve.
    – Mico
    Commented Aug 12, 2022 at 23:00
  • @MadyYuvi - By loading the elsarticle document class with the option 5p, the document is already in two-column mode. That's why it's rather puzzling for the OP to use \twocolumn, and it's why I asked the OP to state what it is that they are trying to achieve.
    – Mico
    Commented Aug 13, 2022 at 4:30
  • @Mico Sorry, I am not aware that the option 5p meant that twocolumn mode, I gave just a general suggestion about multicols... Please excuse... I'll remove my comment...
    – MadyYuvi
    Commented Aug 13, 2022 at 5:14
  • @Mico In a doublecolumn paper, I want to show a long equation to take place in both two columns rather than fitting it into single column in a double-column paper. I tried to trick latex using \twocolumn[{ ... }] to show the equation in the full wide page but it only puts the equation top of the page rather than bottom
    – alper
    Commented Aug 13, 2022 at 10:46

2 Answers 2

3

Adding the package cuted to Micos`s answer, the wide equation can be put after "Hello world".

c

\documentclass[5p,%times % don't specify the 'times' option
]{elsarticle}
\usepackage{amsmath} % for 'aligned' environment
\usepackage{newtxtext,newtxmath} % for a more up to date Times Roman math font

\usepackage{cuted}% strip environment

\usepackage{lipsum}
\begin{document}
    
    \section{Start}
    
    \noindent
    Hello world.
    
    \begin{strip}
    \begin{equation} % see https://tex.stackexchange.com/a/321805/5001
        \begin{aligned}[b]
            f_{r:n}(x)
            &=\binom{n}{r-1} %\frac{n!}{(r-1)!\,(n-r+1)!}
            \biggl[ \biggl( \frac{x-1}{k}  \biggr)^{\!r-1}
            \biggl( \frac{k-x+1}{k}\biggr)^{\!n-r+1} \\
            &\quad  -\biggl( \frac{x}{k}    \biggr)^{\!r-1}
            \biggl( \frac{k-x}{k}  \biggr)^{\!n-r+1} \,
            \biggr ] + f_{r-1:n}(x)
        \end{aligned}
    \end{equation}
    \bigskip
    
    \begin{equation}
        f_{r:n}(x)  =\binom{n}{r-1} %\frac{n!}{(r-1)!\,(n-r+1)!}
        \biggl[ \biggl( \frac{x-1}{k}  \biggr)^{\!r-1}
        \biggl( \frac{k-x+1}{k}\biggr)^{\!n-r+1} -\biggl( \frac{x}{k}    \biggr)^{\!r-1}
        \biggl( \frac{k-x}{k}  \biggr)^{\!n-r+1} \,
        \biggr ] + f_{r-1:n}(x)
    \end{equation}

    \end{strip}
    
    \noindent
    Hello other world.
    \begin{multline} % see https://tex.stackexchange.com/a/321863/5001
        f_{r:n}(x)
        =\binom{n}{r-1} %\frac{n!}{(r-1)!\,(n-r+1)!}
        \biggl[ \biggl( \frac{x-1}{k}  \biggr)^{\!r-1}
        \biggl( \frac{k-x+1}{k}\biggr)^{\!n-r+1} \\
        -\biggl( \frac{x}{k}    \biggr)^{\!r-1}
        \biggl( \frac{k-x}{k}  \biggr)^{\!n-r+1} \,
        \biggr ] + f_{r-1:n}(x)
    \end{multline}

    \lipsum[1-7]
    
\end{document}
2

You asked,

Is it possible to force the long equation to show up ... right after the Hello World text?

Short answer: Yes.

Longer answer: Simply omit the \twocolumn[{...}\bigskip] "wrapper". Since you employ the elsarticle document class with the option 5p, the document is already in two-column mode. It's not clear to me what you're trying to achieve by issuing the \twocolumn directive to begin with -- except, probably involuntarily, force an unnecessary and unwanted page break while also, likely quite unexpectedly, switching to single-column mode.

While on the subject of the elsarticle document class: If at all possible, don't use the times document class option, as it loads the borderline obsolete txfonts package. Instead, do yourself a favor and load the newtxtext and newtxmath packages explicitly, as is done in the code shown below.

The following screenshot shows two approaches -- one with the help of an equation/aligned combination, the other with a multline environment -- to making the long equation fit inside the fairly narrow column. The results of both approaches are fine; which one you may prefer is mainly a matter of tast (about which there is no arguing, right?).

enter image description here

\documentclass[5p,%times % don't specify the 'times' option
              ]{elsarticle}
\usepackage{amsmath} % for 'aligned' environment
\usepackage{newtxtext,newtxmath} % for a more up to date Times Roman math font

\begin{document}

\section{Start}

\noindent
Hello world.
\begin{equation} % see https://tex.stackexchange.com/a/321805/5001
\begin{aligned}[b]
f_{r:n}(x)
  &=\binom{n}{r-1} %\frac{n!}{(r-1)!\,(n-r+1)!}
   \biggl[ \biggl( \frac{x-1}{k}  \biggr)^{\!r-1}
           \biggl( \frac{k-x+1}{k}\biggr)^{\!n-r+1} \\
  &\quad  -\biggl( \frac{x}{k}    \biggr)^{\!r-1}
           \biggl( \frac{k-x}{k}  \biggr)^{\!n-r+1} \,
   \biggr ] + f_{r-1:n}(x)
\end{aligned}
\end{equation}

\noindent
Hello world.
\begin{multline} % see https://tex.stackexchange.com/a/321863/5001
f_{r:n}(x)
  =\binom{n}{r-1} %\frac{n!}{(r-1)!\,(n-r+1)!}
   \biggl[ \biggl( \frac{x-1}{k}  \biggr)^{\!r-1}
           \biggl( \frac{k-x+1}{k}\biggr)^{\!n-r+1} \\
          -\biggl( \frac{x}{k}    \biggr)^{\!r-1}
           \biggl( \frac{k-x}{k}  \biggr)^{\!n-r+1} \,
   \biggr ] + f_{r-1:n}(x)
\end{multline}

\end{document}
3
  • This does not work as I wanted. I want long equation to show up in bot of the two columns rather than fitting into single column
    – alper
    Commented Aug 13, 2022 at 10:45
  • @alper - My apologies for not understanding your phrase "force the long equation to show up ... right after the Hello World text".
    – Mico
    Commented Aug 13, 2022 at 10:49
  • my apologies I was not able to explain my question clearly :-(
    – alper
    Commented Aug 13, 2022 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .