8

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.

1 Answer 1

11

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}

Result

4
  • 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
    Commented Jun 26, 2014 at 16:57
  • 1
    @nameabc: It is not invalid; \nulldelimiterspace is not used, because there are delimiters that are used instead. Commented Jun 26, 2014 at 17:01
  • It should be noted that TeX uses one value of \nulldelimiterspace per formula, so one cannot change it in the middle of a formula.
    – egreg
    Commented Jun 26, 2014 at 17:13
  • 2
    One can change it in the middle of the formula but the last value is used for all fractions.
    – wipet
    Commented Jun 26, 2014 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .