2

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

Torbjørn T.
  • 206,688

1 Answers1

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 06 '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 06 '17 at 11:15
  • @daleif I updated the answer and added another question :(. Maybe you can jump in. – Dr. Manuel Kuehner Apr 06 '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 06 '17 at 12:24
  • @Ana Leko. I don't understand what you mean. Please keep the focus at one question at the time. Is your question from above is answered, which I think it is, then accept the answer. Open a new question with a clear description and a complete but minimal code example (not just some lines of code, fragments) if you have another question. – Dr. Manuel Kuehner Apr 06 '17 at 13:44
  • 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 06 '17 at 13:45
  • @barbara Thanks for the detailed explanation. – Dr. Manuel Kuehner Apr 06 '17 at 13:46
  • So what would be the remedy for this problem? If I want the 2 lines to be normally spaced? – Yan King Yin Aug 09 '18 at 16:33