0

I'm now using MTPRO2 now. The fraction bar(rule) is too short for my taste(see the picture), thus I want to lengthen it everywhere in my document. How can I do it? Or it doesn't matter whether using MTPRO2 or not?

demo

Eric
  • 1,665
  • You can't. Only the thickness is adjustable via \fontdimen parameters. – Henri Menke Oct 08 '16 at 18:08
  • I see no difference with respect to the standard Computer Modern fonts, besides the glyphs in Times being a bit narrower. – egreg Oct 08 '16 at 18:11
  • I guess I'm out of date but what is MTPRO2? I tried texdoc MTPRO2 but nothing was found. – Peter Wilson Oct 08 '16 at 18:11
  • @PeterWilson MathTimePro2. But it doesn't matter I think. Just think as in original LaTeX. – Eric Oct 08 '16 at 18:37
  • @egreg. Do you know how to change back to the Computer Modern style of that bar (circle corner style)? I only want to use part of the MTPro2 function though.. – Eric Oct 08 '16 at 18:38
  • What do you mean by “circle corner style”? The ends of a fraction line are sharp as always in TeX. – egreg Oct 08 '16 at 19:59
  • @PeterWilson mtpro2 can be freely downloaded from the PCTeX site, together with part of the fonts so to fulfill the needs when \usepackage[lite]{mtpro2} is called. The full version is commercial. – egreg Oct 08 '16 at 20:01

1 Answers1

1

Longer fraction bar

\frac can be redefined to add additional space for the numerator and denominator to get a longer fraction line, for example:

\documentclass{article}

\let\OrgFrac\frac
\renewcommand*{\frac}[3][\,]{%
  \OrgFrac{#1\relax#2#1}{#1\relax#3#1}%
}

\begin{document}
\[
  \frac[]{1}{2},
  \frac{1}{2},
  \frac[\mkern4mu]{1}{2}
\]
\end{document}

Result

Rounded line ends of fraction bar

If circle corner style means round line ends of the bar, then the following example overprints the bar by a line with rounded line ends via TikZ:

\documentclass{article}
\usepackage{tikz}

\makeatletter
\let\OrgFrac\frac
\newcommand*{\roundfrac}[2]{%
  \mathpalette{\@roundfrac{#1}{#2}}{}%
}
\newcommand*{\@roundfrac}[4]{%
  % #1: numerator
  % #2: denominator
  % #3: math style
  % #4: unused/empty
  \begingroup
    %\sbox0{$#3#1\m@th$}%
    %\sbox2{$\cramped[#3]{#2}\m@th$}%
    \edef\BarLineWidth{%
      \the\fontdimen8%
      \ifx\displaystyle#3\textfont
      \else\ifx\textstyle#3\textfont
      \else\ifx\scriptstyle#3\scriptfont
      \else\scriptscriptfont
      \fi\fi\fi
      3 %
    }%
    \sbox0{%
      \kern-\nulldelimiterspace
      $#3\OrgFrac{#1}{#2}\m@th$%
      \kern-\nulldelimiterspace
    }%
    \sbox2{$#3\vcenter{}$}% math axis
    \kern\nulldelimiterspace
    \begin{tikzpicture}[
      inner sep=0pt,
      outer sep=0pt,
      baseline=(frac.base),
      line cap=round,
      line width=\BarLineWidth,
    ]
      \node[anchor=base] (frac) {\copy0};
      \draw (frac.west |- 0, \ht2) -- (frac.east |- 0, \ht2);
    \end{tikzpicture}%
    \kern\nulldelimiterspace
  \endgroup
}
\makeatother
\let\frac\roundfrac

\begin{document}
\[
  \OrgFrac{1}{2};
  \frac{1}{2},
  \textstyle\frac{1}{2},
  \scriptstyle\frac{1}{2},
  \scriptscriptstyle\frac{1}{2}
\]
\end{document}

Result with rounded line ends

Of course, both the longer fraction bar and the rounded line ends can be combined. It is left as an easy exercise for the reader.

Heiko Oberdiek
  • 271,626