2

I know there are questions related to this one, but I cannot get all to work in this case.

Code:

\documentclass{llncs}

\begin{document}

\begin{multicols}{2}
    \noindent
        \begin{equation}
                  Precision = \frac{TP}{TP + FP} \label{evaluation1}
        \end{equation} \break
         \begin{equation}
      Recall = \frac{TP}{TP + FN}  \label{evaluation2}
        \end{equation} \break
        \begin{equation}
            F_1 =  2  \cdot \frac{precision \cdot recall}{ precision + recall}  \label{evaluation3}
        \end{equation}
    \end{multicols}

\end{document}

Output:

enter image description here

EDIT

I want to set eqaution 1 & 2 on first row. Then equation 3 on second row, like:

equation 1           equation 2  

equation 3
2
  • Please tell us what kind of layout you're trying to achieve. (So far, you've mostly shown us what you do not want to achieve.)
    – Mico
    Commented Mar 2, 2023 at 22:07
  • @Mico question editted to add detail about intended layout.
    – Amina Umar
    Commented Mar 2, 2023 at 23:09

2 Answers 2

1

You can use \columbreak to switch over to the right column, and separate your construction into two multicols:

enter image description here

\documentclass{llncs}
\usepackage{lipsum}

\begin{document}

\lipsum[1-3]

\begin{multicols}{2}
  \noindent
  \begin{equation}
    \mathrm{precision} = \frac{TP}{TP + FP}
  \end{equation} \columnbreak
  \begin{equation}
    \mathrm{recall} = \frac{TP}{TP + FN}
  \end{equation}
\end{multicols}

\vspace{\dimexpr-\abovedisplayskip-\belowdisplayskip}% Adjust as needed

\begin{multicols}{2}
  \begin{equation}
    F_1 = 2 \cdot \frac{\mathrm{precision} \cdot \mathrm{recall}}{ \mathrm{precision} + \mathrm{recall} }
  \end{equation}
\end{multicols}

\lipsum[4-6]

\end{document}

Depending on the equation contents, you may want to adjust the spacing between the multicols.

2
  • Thank you. How can the \vspace be adjusted in this case?
    – Amina Umar
    Commented Mar 3, 2023 at 10:04
  • 1
    @AminaUmar: I've reduced it by a combination of \belowdisplayskip (inserted after the equations in the first multicols) and \abovedisplayskip(inserted before the equation in the second multicols). You can add more negative space using \vspace{\dimexpr-\abovedisplayskip-\belowdisplayskip-2ex}, where you change 2ex to suit your needs.
    – Werner
    Commented Mar 3, 2023 at 17:18
1

Don't tell anybody I'm using $$. Well, there are cases where it comes handy.

\documentclass{llncs}

\newenvironment{doubleequations}{%
  $$
  \setlength{\tabcolsep}{0pt}%
  \setlength{\abovedisplayskip}{0pt}%
  \setlength{\belowdisplayskip}{0pt}%
  \setlength{\abovedisplayshortskip}{0pt}%
  \setlength{\belowdisplayshortskip}{0pt}%
  \begin{tabular}{p{0.5\textwidth}p{0.5\textwidth}}%
}{\end{tabular}$$}

\begin{document}

text before the equation
text before the equation
text before the equation
text before the equation
\begin{doubleequations}
  \begin{equation}\label{evaluation1}
  \mathrm{Precision} = \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FP}}
  \end{equation}
&
  \begin{equation}\label{evaluation2}
  \mathrm{Recall} = \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FN}}
  \end{equation}
\\[-2ex]
  \begin{equation}\label{evaluation3}
  F_1 = 2\cdot \frac{\mathrm{Precision} \cdot \mathrm{Recall}}
                    {\mathrm{Precision} + \mathrm{Recall}}
  \end{equation}
\end{doubleequations}
text after the equation
text after the equation
text after the equation
text after the equation

\end{document}

enter image description here

Don't write “words” in math mode without segregating them in \mathrm (or \mathit, if you so prefer).

Adjust the [-2ex] spacing to suit yourself.

Why $$ and not multicols? Because this will not allow page breaks before the display.

You must log in to answer this question.

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