[Tex/LaTex] Math equations non italic

equations

I am using \begin{equation} to write equation but it is in italic. How do i disable it ? The other threads all not for \begin{equation}. everything inside it is green

\begin{equation} \label{eq:oa}
Overlap Area = \frac{Area (Detection \cap Ground Truth)}{Area (Detection \cup Ground Truth )}
\end{equation}

My main code below

\documentclass[pdftex,12pt,a4paper]{report}

\usepackage[top=3cm, bottom=3cm, left=3.5cm, right=3cm]{geometry}

% graphics images
\usepackage[pdftex]{graphicx}
\usepackage[toc,page]{appendix}
\usepackage{slashbox}

% 1.5 line spacing
\usepackage{setspace}
\usepackage{tabu}
\usepackage{tabularx}
\onehalfspacing

% maths symbols
%\usepackage{amsmath}
\usepackage[math-style = upright]{unicode-math}

% table package
\usepackage{multirow}

% citation style
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}%
\makeatletter
\let\Hy@linktoc\Hy@linktoc@none
\makeatother

\usepackage[square,sort,comma,numbers]{natbib}
\usepackage{amsfonts}

%\renewcommand{\chaptername}{}

\usepackage{tikz,colortbl}
\usetikzlibrary{calc}
\usepackage{zref-savepos}

\usepackage[bf,small,tableposition=top]{caption}
\usepackage{subfig}
\usepackage{float}
\usepackage{url}

\begin{document}

% cover
\input{cover_report.tex}

% title page
%\input{title_report.tex}

% abstract
\setcounter{page}{1}
\pagenumbering{roman}
\input{abstract.tex}

% acknowledgement
\input{acknowledgements.tex}

% table of content
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}

% list of tables
%\listoftables
%\addcontentsline{toc}{chapter}{List of Tables}

% list of figures
%\listoffigures
%\addcontentsline{toc}{chapter}{List of Figures}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{intro.tex}
\input{literature.tex}
%\input{propose.tex}
\input{module_design.tex}
\input{training.tex}
\input{results.tex}
\input{conclusion.tex}
% references
\bibliographystyle{plainnat}
\bibliographystyle{unsrt}
\bibliography{fyp}

% appendix
%\input{appendix.tex}
\end{document}

Best Answer

Inside a math environment, LaTeX assumes that every letter is a variable, and will typeset it in a math font with italics, and ignore all spaces.

To tell LaTeX that you are typing in text, you could use the text{} command from the amsmath-package. Here I load the mathtools-package, which in turn loads amsmath.

You could also use \textrm{} without loading any packages, but I recommend using \text{}. Have a look at What is the "correct" way of embedding text into math mode?

Here, you mix text with math symbols, like the \cap. These symbols need to be typeset in math mode. You can do this by surrounding the symbol with \( and \) , like this: \( \cap \). You might have seen a TeX-equivalent of this, where $-signs were used, but this is against recommendations and the old way of doing it. For more information about this, see: Are \( and \) preferable to $?

Output

enter image description here

Code

\documentclass[11pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation} \label{eq:oa}
\text{Overlap Area} = \frac{ \text{Area (Detection \(\cap\) Ground Truth)} }{ \text{Area (Detection \(\cup\) Ground Truth)} }
\end{equation}
\end{document}
Related Question