8

I am trying to use one equation in my thesis but that equation is long enough to fit in LaTeX format, I found one image but don't know how to convert that into LaTeX format, it uses some different symbols.

enter image description here

How to write this in LaTeX and make it small.

What I have tried:

\begin{equation}
\frac{\sum_{i j}\left(\begin{array}{l}{n_{i j}} \\ {2}\end{array}\right)-\left[\sum_{i}\left(\begin{array}{l}{a_{i}} \\ {2}\end{array}\right) \sum_{j}\left(\begin{array}{l}{b_{j}} \\ {2}\end{array}\right)\right] /\left(\begin{array}{l}{n} \\ {2}\end{array}\right)}{\frac{1}{2}\left[\sum_{i}\left(\begin{array}{l}{a_{i}} \\ {2}\end{array}\right)+\sum_{j}\left(\begin{array}{l}{b_{j}} \\ {2}\end{array}\right)-\left[\sum_{i}\left(\begin{array}{l}{a_{i}} \\ {2}\end{array}\right) \sum_{j}\left(\begin{array}{l}{a_{j}} \\ {2}\end{array}\right)\right] /\left(\begin{array}{l}{n} \\ {2}\end{array}\right)\right.}
\end{equation}

But it's appearing like this:

enter image description here

Edit:

%File: formatting-instruction.tex
\documentclass[letterpaper]{article}
\usepackage{aaai}
\usepackage{times}
\usepackage{helvet}
\usepackage{amsmath}

\usepackage{courier}
\frenchspacing
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}
\pdfinfo{
/Title (Insert Your Title Here)
/Author (Put All Your Authors Here, Separated by Commas)}
\setcounter{secnumdepth}{0}  
 \begin{document}
% The file aaai.sty is the style file for AAAI Press 
% proceedings, working notes, and technical reports.
%
\title{Thesis}
\author{Anonymous Author 
}
\maketitle
\begin{abstract}
\begin{quote}
AAAI creates proceedings, working notes, and technical reports directly from electronic source furnished by the authors. To ensure that all papers in the publication have a uniform appearance, authors must adhere to the following instructions. 
\end{quote}
\end{abstract}

\section{Model}

In this section we describe the architecture of our model.

\begin{equation}
\frac{\sum_{i j}\left(\begin{array}{l}{n_{i j}} \\ {2}\end{array}\right)-\left[\sum_{i}\left(\begin{array}{l}{a_{i}} \\ {2}\end{array}\right) \sum_{j}\left(\begin{array}{l}{b_{j}} \\ {2}\end{array}\right)\right] /\left(\begin{array}{l}{n} \\ {2}\end{array}\right)}{\frac{1}{2}\left[\sum_{i}\left(\begin{array}{l}{a_{i}} \\ {2}\end{array}\right)+\sum_{j}\left(\begin{array}{l}{b_{j}} \\ {2}\end{array}\right)-\left[\sum_{i}\left(\begin{array}{l}{a_{i}} \\ {2}\end{array}\right) \sum_{j}\left(\begin{array}{l}{a_{j}} \\ {2}\end{array}\right)\right] /\left(\begin{array}{l}{n} \\ {2}\end{array}\right)\right.}
\end{equation}



\end{document}

1 Answers1

13

If I change \usepackage{times} into \usepackage{mathptmx} in your code and also the equation into

\begin{equation}
\frac{
  \sum_{ij}\binom{n_{ij}}{2}-\bigl[\sum_{i}\binom{a_{i}}{2} \sum_{j}\binom{b_{j}}{2}\bigr]\big/\binom{n}{2}
}{
  \frac{1}{2}\bigl[\sum_{i}\binom{a_{i}}{2}+\sum_{j}\binom{b_{j}}{2}\bigr]-
  \bigl[\sum_{i}\binom{a_{i}}{2} \sum_{j}\binom{a_{j}}{2}\bigr]
  \big/\binom{n}{2}     
}
\end{equation}

I get (dummy text added for context)

enter image description here

The output is even better if I change \usepackage{mathptmx} into

\usepackage{newtxtext,newtxmath}

enter image description here

If you want the description texts,

\begin{equation}
\overbrace{\mathit{ARI}}^{\hidewidth\substack{\text{Adjusted}\\\text{Index}}\hidewidth}=
\frac{
  \overbrace{\textstyle\sum_{ij}\binom{\vphantom{b}n_{ij}}{2}}^{\text{Index}}
  -
  \overbrace{\textstyle\bigl[\sum_{i}\binom{a_{i}}{2} \sum_{j}\binom{b_{j}}{2}\bigr]\big/\binom{n}{2}}%
    ^{\text{Expected Index}}
}{
  \underbrace{\textstyle\frac{1}{2}\bigl[\sum_{i}\binom{a_{i}}{2}+\sum_{j}\binom{b_{j}}{2}\bigr]}%
    _{\text{Max Index}}
  -
  \underbrace{\textstyle\bigl[\sum_{i}\binom{a_{i}}{2} \sum_{j}\binom{a_{j}}{2}\bigr]\big/\binom{n}{2}}%
    _{\text{Expected Index}}
}
\end{equation}

enter image description here

  1. With \hidewidth, the description above “ARI” takes no space; it is also split into two lines not to intrude the right-hand side.

  2. \textstyle is necessary, because \overbrace and \underbrace force \displaystyle

  3. The \vphantom{b} has been added to set “Index” at the same height as the other description.

egreg
  • 1,121,712
  • 1
    I can't give more than one upvote :P – Aaditya Ura Oct 22 '19 at 09:27
  • @AadityaUra I've just added a small change to the solution with the braces. – egreg Oct 22 '19 at 09:28
  • 1
    @AadityaUra There is also the mine :-) – Sebastiano Oct 22 '19 at 09:28
  • @AadityaUra Well, for advice like “use mathptmx or NewTX we're here. For learning how to type mathematics, experience and desire to learn. I'd usually avoid those over/underbraces and explain the parts separately before stating the equation. – egreg Oct 23 '19 at 19:57