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?
Asked
Active
Viewed 84 times
1 Answers
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}
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}
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



\fontdimenparameters. – Henri Menke Oct 08 '16 at 18:08texdoc MTPRO2but nothing was found. – Peter Wilson Oct 08 '16 at 18:11mtpro2can 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