2

Please teach me why \bm doesn't play well with \dfrac in amsmath.

This code \hl{$=\bm{\frac{7\sqrt[3]{2}}{2}}$} produces:

enter image description here

But \hl{$=\bm{\dfrac{7\sqrt[3]{2}}{2}}$} crashes the compiler.

I'm using \dfrac because IMHO the resulting fractions are easier to read.

So why is \bm not compatible with \dfrac?

Thanks very much for your assistance!

mwe:

\documentclass[11pt]{exam}
\printanswers
% un-comment to print solutions.
\renewcommand{\solutiontitle}{}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{framed}
\usepackage{multicol}
\usepackage{tasks}
\usepackage[a4paper,margin=0.5in,include head]{geometry}
\usepackage{soul}
\usepackage{xcolor}
\thispagestyle{myheadings}
\markright{\normalfont\textbf{Algebra II: Unit 12 Radical Expressions Other Roots 12 AB 2}\hfill  04/17/23} 

\newcommand{\pagetop}{%
    \noindent 
    
    \bigskip
    \vspace{0.5mm}
}

%%\settasks{after-item-skip=1em,
%%  after-skip=2cm,
%%  label-width=1.5em, %<---------
%%  item-indent=2em,   %<---------
%%  label=(\arabic*),
%%  column-sep=1em     %<----------
%%}

%**************************************************** only this code was added/ modified
\newlength{\lwidth}% added <<<<<
\settowidth{\lwidth}{(99)\enspace} % added

\settasks{after-item-skip=1em,
    after-skip=2cm,
    label-width=\lwidth, % changed <<<<<<<<<
    item-indent=0pt,   % changed <<<<<<<<<<
    label-format = \bfseries, % numbers in bold added <<<<<<<<<<
    label=(\arabic*), % 
    label-offset = -\lwidth,% added <<<<<
    item-format = \hspace{\lwidth},% added <<<<<
    column-sep=2em,    % changed <<<<<<<<<  
}
%****************************************************

\begin{document}
    %definition for bigskip = 1 line to replace all \bigskip
    \def\bigskip{\vskip\bigskipamount}
    
    \textbf{Simplify.}
    \begin{tasks}
        [style=enumerate](3)
% Prob #1
\task 
$\sqrt[3]{8}$
\vspace{3mm}
\begin{solutionorbox}[3cm]
$8$ is a perfect cube.
    \bigskip
\hl{$\bm{\sqrt[3]{8}=2}$}
\end{solutionorbox}
\vspace{0.25cm}

% Prob #2
\task 
$\sqrt[3]{250}$
\vspace{3mm}
\begin{solutionorbox}[3cm]
Find perfect cube factor of $250$
\bigskip
$=(\sqrt[3]{125})(\sqrt[3]{2})$
\bigskip
    \hl{$=\bm{5\sqrt[3]{2}}$}
\end{solutionorbox}
\vspace{0.25cm}

% Prob #3
\task 
$\sqrt[4]{64}$
\vspace{3mm}
\begin{solutionorbox}[3cm]
Prime factorization of $64=2^6$
\bigskip
$\sqrt[4]{2^6}=(\sqrt[4]{2^4})(\sqrt[4]{2^4})$
\bigskip
$=2\sqrt[4]{2^2}$
\bigskip
$=2\bm{\cdot}2^{2\bm{\div}4}$
\bigskip
\hl{$=\bm {2{\sqrt{2}}}$}
\end{solutionorbox}
\vspace{0.25cm}


% Prob #12
\task 
$\dfrac{7}{\sqrt[3]{2}}$ 
\vspace{3mm}
\begin{solutionorbox}[3cm]
$=\dfrac{7}{\sqrt[3]{2}}\bm{\cdot}\dfrac{\sqrt[3]{2^2}}{\sqrt[3]{2^2}}$
\bigskip
$=\dfrac{7\sqrt[3]{2^2}}{(\sqrt[3]{2})(\sqrt[3]{2^2})}$
\bigskip
$=\dfrac{7\sqrt[3]{2^2}}{\sqrt[3]{2^3}}$
\bigskip
\hl{$=\bm{\frac{7\sqrt[3]{2}}{2}}$}
\end{solutionorbox}
\vspace{0.25cm}


\newpage

\end{tasks}
\end{document} 

1 Answer 1

6

Don't use \dfrac; instead, change

\hl{$=\bm{\frac{7\sqrt[3]{2}}{2}}$}

to

\hl{$\displaystyle=\bm{\frac{7\sqrt[3]{2}}{2}}$}

However, the highlighting band wouldn't cover the entire expression. Much better, by far, would be

\colorbox{yellow}{$\displaystyle=\bm{\frac{7\sqrt[3]{2}}{2}}$}

enter image description here

\documentclass[11pt]{exam}
\usepackage{amsmath,bm}
\usepackage{soul}   % for \hl macro
\usepackage{xcolor} % for \colorbox macro

\begin{document}
\hl{$=\bm{\frac{7\sqrt[3]{2}}{2}}$}
\qquad
\hl{$\displaystyle=\bm{\frac{7\sqrt[3]{2}}{2}}$}
\qquad
\colorbox{yellow}{$\displaystyle=\bm{\frac{7\sqrt[3]{2}}{2}}$}
\end{document}
1
  • 1
    Thanks very much for your solution. I especially appreciate that you not only suggested \displaystyle=\bm, but also that you noticed the necessity of \colorbox[yellow] instead of \hl . You are most generous in sharing your expertise! Never would have discovered these solutions on my own. I will use \colorbox in my future work sheets. Commented Apr 27, 2023 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .