1

how to bold all fraction lines like in the picture below? I used

\newcommand{\thickfrac}[2]{\genfrac{}{}{3pt}{}{#1}{#2}}

but nothing happened.

enter image description here

1

Based on the answer of user David Carlisle from this question.

\documentclass{article}

\usepackage{mathtools} % also loads the amsmath package


% Command with 2 obligatory arguments (num and denom)
\newcommand{\myThickFrac}[2]{\genfrac{}{}{5pt}{}{#1}{#2}}

% Command with 2 obligatory arguments (num and denom) and one optional argument (line width)
\newcommand{\myVariableThickFrac}[3][0.4pt]{\genfrac{}{}{#1}{}{#2}{#3}}

\begin{document}

%\genfrac{left-delim}{right-delim}{thickness}{mathstyle}{numerator}{denominator}

\begin{equation}
\genfrac{}{}{5pt}{}{\text{num}}{\text{demom}}
\end{equation}

\begin{equation}
\myThickFrac{\text{num}}{\text{demom}}
\end{equation}

\begin{equation}
\myVariableThickFrac{\text{num}}{\text{demom}} = \myVariableThickFrac[3pt]{\text{num}}{\text{demom}} = \myVariableThickFrac[5pt]{\text{num}}{\text{demom}}
\end{equation}

\end{document}

enter image description here

Question to the experts here. I don't know why the line width also influences the spacing so much. And I do not know that to do with the remaining arguments {left-delim}, {right-delim} and {mathstyle} (but that is not important here as it seems).

  • \genfrac is from the very famous amsmath package.
  • The package mathtools that I use here is an extension package to amsmath
  • mathtools loads amsmath automatically.
  • See mathtools vs amsmath for more details.

From the amsmath manual

enter image description here

  • The other statement (about mathtools) is not quite right. mathtools loads amsmath and provides additions to it. Nothing in this example needs mathtools, amsmath is enough – daleif Apr 6 '17 at 11:14
  • 1
    I was simplifying on purpose. And I wanted to encourage to use mathtools :). I'll update the answer -- feel free to correct me again. – Dr. Manuel Kuehner Apr 6 '17 at 11:15
  • @daleif I updated the answer and added another question :(. Maybe you can jump in. – Dr. Manuel Kuehner Apr 6 '17 at 11:24
  • Me again, I just figure it that all lines are bold lines of box, all fraction lines, equal signs are also little bit bold, not bold with /textbf but bolder than mine. Does anyone has solution for that? :) – Ana Leko Apr 6 '17 at 12:24
  • 1
    the width of the fraction lines is a parameter in the font dimensions (in .tfm files). it is a misfeature in tex that the space above and below the fraction line uses the same dimension parameter. this is a side effect of the very limited memory available when tex was created, and it's too late to change now.if .tfm files are being used for fonts. i don't know whether the limitation has been addressed in xetex or luatex. – barbara beeton Apr 6 '17 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.