How to make a long equation small to fit in LaTeX?

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.

How to write this in LaTeX and make it small.

What I have tried:

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


But it's appearing like this:

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{
/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.

$$\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{document}

• Please provide an MWE which reproduce your problem. Code fragment is not very helpful for helping you .... – Zarko Oct 22 at 7:25
• I already provided the code. – Aaditya Ura Oct 22 at 8:13
• @AadityaUra no providing a fragment just makes it hard for people to help you, please provide a test document. In particular you are asking how to make the equation fit without giving any information about how wide your column is. – David Carlisle Oct 22 at 8:17

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

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


I get (dummy text added for context)

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

\usepackage{newtxtext,newtxmath}


If you want the description texts,

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


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.

• I can't give more than one upvote :P – Aaditya Ura Oct 22 at 9:27
• @AadityaUra I've just added a small change to the solution with the braces. – egreg Oct 22 at 9:28
• @AadityaUra There is also the mine :-) – Sebastiano Oct 22 at 9: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 at 19:57