# How to eliminate the gaps before and after \frac{}{}?

The macro \frac add a gap (approx 1.2pt) before and after the whole fraction. You could compare

$\frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1}$


and

\newcommand{\mycmd}{\hskip1.2pt1\hskip1.2pt}
$\mycmd\mycmd\mycmd\mycmd\mycmd\mycmd\mycmd\mycmd$


Even, the \genfrac command (setting the third arguement to "0pt") has still keep the gaps back:

\newcommand{\myfrac}{\genfrac{}{}{0pt}{0}{1}{1}}
$\myfrac\myfrac\myfrac\myfrac\myfrac\myfrac\myfrac\myfrac$


though the horizontal rule is invisible.

The gaps takes some problems:

1. If we use a huge font (e.g. set \fontsize to 20pt), the numerator/denominator does not match the fractional line in the projecting.
2. If we write a binomial coefficient, the gaps are not necessity.

So, a customized command \newfrac without the gaps is beneficial.

-

TeX has a concept of a generalized fraction with delimiters. In case of \frac, there is a rule but no delimiters. Then TeX surrounds the fraction by a space of \nulldelimiterspace. Default is 1.2 pt.

\documentclass{article}
\begin{document}
$\setlength{\nulldelimiterspace}{0pt} \frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1} \frac{1}{1}\frac{1}{1}\frac{1}{1}\frac{1}{1}$
\end{document}


-
You answered quickly. Thank you. – name abc Jun 26 '14 at 16:39
Why \setlength{\nulldelimiterspace}{20pt}\binom{m}{n}\binom{m}{n} or \setlength{\nulldelimiterspace}{20pt}\genfrac{(}{)}{0pt}{0}{m}{n}\genfrac{(}{)}‌​{0pt}{0}{m}{n}are invalid? – name abc Jun 26 '14 at 16:57
@nameabc: It is not invalid; \nulldelimiterspace is not used, because there are delimiters that are used instead. – Heiko Oberdiek Jun 26 '14 at 17:01
I see. Thank you. – name abc Jun 26 '14 at 17:06
One can change it in the middle of the formula but the last value is used for all fractions. – wipet Jun 26 '14 at 19:12