O que estou faltando no alinhamento de equações com multicols?

O que estou faltando no alinhamento de equações com multicols?

Eu sei que há questões relacionadas a esta, mas não consigo fazer tudo funcionar neste caso.

Código:

\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}

Saída:

insira a descrição da imagem aqui

EDITAR

Quero definir as equações 1 e 2 na primeira linha. Então a equação 3 na segunda linha, como:

equation 1           equation 2  

equation 3

Responder1

Você pode usar \columbreakpara mudar para a coluna da direita e separar sua construção em duas multicols:

insira a descrição da imagem aqui

\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}

Dependendo do conteúdo da equação, você pode querer ajustar o espaçamento entre os arquivos multicols.

Responder2

Não conte a ninguém que estou usando $$. Bem lásãocasos em que é útil.

\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}

insira a descrição da imagem aqui

Não escreva “palavras” no modo matemático sem segregá-las em \mathrm(ou \mathit, se preferir).

Ajuste o [-2ex]espaçamento de acordo com você.

Por que $$e não multicols? Porque isso não permitirá quebras de página antes da exibição.

informação relacionada