Math & Science\bm and \nicefrac don't work together

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

\bm and \nicefrac don't work together

Post by Singularity »

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:

Code: Select all

\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}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

\bm and \nicefrac don't work together

Post by cgnieder »

I don't know why they're not working with \bm but both work with \mathbf:

Code: Select all

\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?
site moderator & package author
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

\bm and \nicefrac don't work together

Post by Singularity »

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
(55.15 KiB) Downloaded 542 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

\bm and \nicefrac don't work together

Post by cgnieder »

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
site moderator & package author
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Re: \bm and \nicefrac don't work together

Post by Singularity »

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: 156
Joined: Sat Jan 22, 2011 9:55 pm

\bm and \nicefrac don't work together

Post by Singularity »

The only reasonable solutions seems to be

Code: Select all

\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

Code: Select all

\nicefrac{\bm{numerator}}{\bm{denominator}}
But then, usually you use regular \frac when you have long top or bottom.
Post Reply