## LaTeX forum ⇒ Math & Science ⇒ \bm and \nicefrac don't work together

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Singularity
Posts: 152
Joined: Sat Jan 22, 2011 9:55 pm

### \bm and \nicefrac don't work together

I can't use \bm and \nicefrac together. Why not? How do I make bold, nice fractions (in math mode, but also out of math mode).

I could not get xfrac to work at all.

MWE:
\documentclass[14pt,fleqn,reqno]{extarticle}\usepackage{amsfonts,amsmath,amssymb,amsthm}\usepackage{mathtools}			% Better choice for bmatrix*, pmatrix*, etc. environments (I'm told)\usepackage{bm,nicefrac,xfrac}  \begin{document}\begin{align*}   \bm{\nicefrac{1}{4}}.\end{align*}\end{document}

Tags:

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
I don't know why they're not working with \bm but both work with \mathbf:

\documentclass{article}\usepackage{mathtools}\usepackage{bm,nicefrac,xfrac}\begin{document}\begin{align*}   \mathbf{\nicefrac{1}{4}}\end{align*}\begin{align*}   \mathbf{\sfrac{1}{4}}\end{align*}\end{document}

Singularity wrote:I could not get xfrac to work at all.

What does that mean? Did you get errors?
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Singularity
Posts: 152
Joined: Sat Jan 22, 2011 9:55 pm
Ah, yes, that would be helpful information, huh?

I got 97 errors. The first one was "l3kernel too old", and l3keys2e.sty file is opened. I'm attaching the log file.

MWE.log

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Singularity wrote:I got 97 errors. The first one was "l3kernel too old"

Looks like your version of xfrac is newer than your TeX distribution. Did you install/update it manually?

You should update your TeX distribution. Packages often have dependencies and very often rely on certain versions of other packages which is why manual installations/updates always are dangerous.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Singularity
Posts: 152
Joined: Sat Jan 22, 2011 9:55 pm
I recently ran MikTex's "Update (Admin)" process to solve another problem. But I didn't do anything manually. And I might have made the wrong choices in that program. But that's all I did.

Singularity
Posts: 152
Joined: Sat Jan 22, 2011 9:55 pm
The only reasonable solutions seems to be
\nicefrac{\bm 1}{\bm 4}

If the top or bottom (numerator/denominator in mathspeak) has more than one character, I assume you will need yet another set of braces
\nicefrac{\bm{numerator}}{\bm{denominator}}

But then, usually you use regular \frac when you have long top or bottom.