1

Hi there if any one can help. i want to add equations in latex. My equations are in fraction like precision= T_P/ T-P +f_n and so on in next line i have precision= T_P/ T-P +f_n and son but when I compiled my code in pdf it gives me something which is so wrong if any one can help. I want my equations as define in this image enter image description here

Here is my code

    \documentclass{article}
\usepackage[utf8]{inputenc}

\title{equation}

\begin{document}

\maketitle

\section{Introduction}

\begin{align*}

Precision =\frac{T_p}{T_p + f_p} \ \% %%\end{align} %% Recall =\frac{T_p}{T_p + f_n} \
%% Accuracy = \frac{T_p + T_n}{T_p + f_n+ f_p +T_n} %% \end{align
}

\end{document}

David Carlisle
  • 757,742

1 Answers1

1

Just I add my proposal using align* or an array with the specific interline [.6em] (vertical space between the equation in the array). Peraphs it is better [.7em], but you are free to choose the correct vertical space.

PS: I accept totally the comment of @David Carlisle on the use of \mathrm in math-mode.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{newtxtext,newtxmath}

\title{equation}

\begin{document}

\maketitle

\section{Introduction}

\begin{align} \mathrm{Precision} & =\frac{T_p}{T_p + f_p} \ \mathrm{Recall} & =\frac{T_p}{T_p + f_n} \ \mathrm{Accuracy}& = \frac{T_p + T_n}{T_p + f_n+ f_p +T_n} \end{align}

[ \begin{array}{ll} \mathrm{Precision} & =\dfrac{T_p}{T_p + f_p}\[.6em] \mathrm{Recall} & =\dfrac{T_p}{T_p + f_n} \[.6em] \mathrm{Accuracy} & = \dfrac{T_p + T_n}{T_p + f_n+ f_p +T_n} \end{array} ]

\end{document}

enter image description here

Sebastiano
  • 54,118