1

I've recently come up with some strange behaviors of simultaneous applications of \huge and \bm. In particular, the results are not consistent depending on the loaded packages.

MWE 1: (with the minimum loaded packages)

\documentclass{article}
\usepackage{mathtools}
\usepackage{bm}

\begin{document}
  $\Delta \qquad \bm{\Delta} \qquad {\Huge\bm{\Delta}}$

  $q \qquad \bm{q} \qquad {\Huge\bm{q}} $ 
\end{document}

Result 1:

enter image description here

In this case, \bm works, but \huge has no influence.

MWE 2: (with the loaded packages corresponding to a specific project of mine)

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{newtxtext,newtxmath} % for times font
\usepackage[noadjust]{cite}
\usepackage[overload]{empheq} % for subnumbering in cases
\usepackage[framemethod=tikz]{mdframed}
\usepackage{bm}
\usepackage{algorithm}
\usepackage[a4paper, left = 1.5cm, right = 1.5cm, bottom = 1.5cm, top = 1.5cm]{geometry}
\usepackage{braket}
\usepackage[T1]{fontenc}
\usepackage[ansinew,utf8]{inputenc}

\begin{document}
  $\Delta \qquad \bm{\Delta} \qquad {\Huge\bm{\Delta}}$

  $q \qquad \bm{q} \qquad {\Huge\bm{q}} $ 
\end{document}

Result 2:

enter image description here

This one seems even more strange, and the results are somewhat unexpected!

Are these behaviors justifiable?

Edit:

I have a matrix equation, and there is an \underbrace for each matrix. The names of the matrices, e.g., \Delta and q, are about to be put there. But the labels are so small, and I need to make them bigger. What is the best practice to do this?

  • scalebox,
  • mathlarger,
  • ...
\documentclass{article}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{newtxtext,newtxmath} % for times font
\usepackage[noadjust]{cite}
\usepackage[overload]{empheq} % for subnumbering in cases
\usepackage[framemethod=tikz]{mdframed}
\usepackage{bm}
\usepackage{algorithm}
\usepackage[a4paper, left = 1.5cm, right = 1.5cm, bottom = 1.5cm, top = 1.5cm]{geometry}
\usepackage{braket}
\usepackage[T1]{fontenc}
\usepackage[ansinew,utf8]{inputenc}

\begin{document}
  \begin{equation}
  \label{eq:vec1}
  \nabla \xi(\bm{q}) = 
  \begin{bmatrix}
  \nabla \xi(q^{0}) \\ \nabla \xi(q^{1}) \\ \nabla \xi(q^{2}) \\ \nabla \xi(q^{3}) \\   \nabla \xi(q^{4}) \\ \nabla \xi(q^{5}) \\ \nabla \xi(q^{6}) 
  \end{bmatrix} = 
  \underbrace{\begin{bmatrix}
    2\lambda_{1}&2\lambda_{3}&2\lambda_{3} &0&0&0&0\\
    2\lambda_{3}&2\lambda_{1}&2\lambda_{3} &0&0&0&0\\
    2\lambda_{3}&2\lambda_{3}&2\lambda_{1} &0&0&0&0\\
    0&0&0&2\lambda_{1}&2\lambda_{3}&0&0\\
    0&0&0&2\lambda_{3}&2\lambda_{1}&0&0\\
    0&0&0&0&0&2\lambda_{1}&2\lambda_{3}\\
    0&0&0&0&0&2\lambda_{3}&2\lambda_{1} 
    \end{bmatrix}}_{\huge\bm{\Lambda}}
  \underbrace{\begin{bmatrix}
    q^{0}\\q^{1}\\q^{2}\\q^{3}\\q^{4}\\q^{5}\\q^{6}
    \end{bmatrix}}_{\huge\bm{q}}
  +2\omega\lambda_{2}
  \underbrace{\begin{bmatrix}
    \mathcal{Q}(q^{0},q^{1}) + \mathcal{Q}(q^{0},q^{2})\\
    \mathcal{Q}(q^{1},q^{0}) + \mathcal{Q}(q^{1},q^{2})\\
    \mathcal{Q}(q^{2},q^{0}) + \mathcal{Q}(q^{2},q^{1})\\
    \mathcal{Q}(q^{3},q^{4})\\
    \mathcal{Q}(q^{4},q^{3})\\
    \mathcal{Q}(q^{5},q^{6})\\
    \mathcal{Q}(q^{6},q^{5})
    \end{bmatrix}}_{\huge\bm{\Omega}}       
  +
  \underbrace{\begin{bmatrix}
    2\bigl(\lambda_{1}q^{0}_{\mathcal{T}} + \lambda_{3}(q^{1}_{\mathcal{T}} + q^{2}_{\mathcal{T}})\bigr)\\
    2\bigl(\lambda_{1}q^{1}_{\mathcal{T}} + \lambda_{3}(q^{0}_{\mathcal{T}} + q^{2}_{\mathcal{T}})\bigr)\\
    2\bigl(\lambda_{1}q^{2}_{\mathcal{T}} + \lambda_{3}(q^{0}_{\mathcal{T}} + q^{1}_{\mathcal{T}})\bigr)\\
    2\bigl(\lambda_{1}q^{3}_{\mathcal{T}} + \lambda_{3}q^{4}_{\mathcal{T}}\bigr)\\
    2\bigl(\lambda_{1}q^{4}_{\mathcal{T}} + \lambda_{3}q^{3}_{\mathcal{T}}\bigr)\\
    2\bigl(\lambda_{1}q^{5}_{\mathcal{T}} + \lambda_{3}q^{6}_{\mathcal{T}}\bigr)\\
    2\bigl(\lambda_{1}q^{6}_{\mathcal{T}} + \lambda_{3}q^{5}_{\mathcal{T}}\bigr)
    \end{bmatrix}}_{\huge\bm{C}} 
  = 0,
  \end{equation}
\end{document}

enter image description here

6
  • 2
    Command \Huge invalid in math mode
    – egreg
    Nov 28, 2018 at 15:12
  • @egreg: I see. Then, what is the best practice to change the size of stuffs in math mode? scalebox?
    – user78499
    Nov 28, 2018 at 15:13
  • There is \mathlarger from the relsize package, if you really need to do it. What precisely is your aim?
    – egreg
    Nov 28, 2018 at 15:14
  • @egreg: I have a matrix equation, and there is an \underbrace for each matrix. The names of the matrices, e.g., \Delta and q are about to be put there. But the labels are so small, and I need to make them bigger.
    – user78499
    Nov 28, 2018 at 15:17
  • {\underbrace{whatever}_{\textstyle\bm{\Delta}}}
    – egreg
    Nov 28, 2018 at 15:19

1 Answer 1

0

You get a warning Command \Huge invalid in math mode and the result is thus unpredictable.

Use \textstyle:

\documentclass{article}
\usepackage{newtxtext,newtxmath} % for times font
\usepackage{amsmath}
\usepackage{bm}

\begin{document}

\begin{equation} \label{eq:vec1}
\begin{split}
\nabla \xi(\bm{q}) &=
  \begin{bmatrix}
    \nabla \xi(q^{0}) \\
    \nabla \xi(q^{1}) \\
    \nabla \xi(q^{2}) \\
    \nabla \xi(q^{3}) \\
    \nabla \xi(q^{4}) \\
    \nabla \xi(q^{5}) \\
    \nabla \xi(q^{6}) 
  \end{bmatrix} = 
  {\underbrace{\begin{bmatrix}
    2\lambda_{1}&2\lambda_{3}&2\lambda_{3} &0&0&0&0\\
    2\lambda_{3}&2\lambda_{1}&2\lambda_{3} &0&0&0&0\\
    2\lambda_{3}&2\lambda_{3}&2\lambda_{1} &0&0&0&0\\
    0&0&0&2\lambda_{1}&2\lambda_{3}&0&0\\
    0&0&0&2\lambda_{3}&2\lambda_{1}&0&0\\
    0&0&0&0&0&2\lambda_{1}&2\lambda_{3}\\
    0&0&0&0&0&2\lambda_{3}&2\lambda_{1} 
    \end{bmatrix}}_{\textstyle\bm{\Lambda}}}
  {\underbrace{\begin{bmatrix}
    q^{0}\\q^{1}\\q^{2}\\q^{3}\\q^{4}\\q^{5}\\q^{6}
    \end{bmatrix}}_{\textstyle\bm{q}}}
  \\[2ex]
  &\quad+2\omega\lambda_{2}
  {\underbrace{\begin{bmatrix}
    \mathcal{Q}(q^{0},q^{1}) + \mathcal{Q}(q^{0},q^{2})\\
    \mathcal{Q}(q^{1},q^{0}) + \mathcal{Q}(q^{1},q^{2})\\
    \mathcal{Q}(q^{2},q^{0}) + \mathcal{Q}(q^{2},q^{1})\\
    \mathcal{Q}(q^{3},q^{4})\\
    \mathcal{Q}(q^{4},q^{3})\\
    \mathcal{Q}(q^{5},q^{6})\\
    \mathcal{Q}(q^{6},q^{5})
    \end{bmatrix}}_{\textstyle\bm{\Omega}}}
  +
  {\underbrace{\begin{bmatrix}
    2\bigl(\lambda_{1}q^{0}_{\mathcal{T}} + \lambda_{3}(q^{1}_{\mathcal{T}} + q^{2}_{\mathcal{T}})\bigr)\\
    2\bigl(\lambda_{1}q^{1}_{\mathcal{T}} + \lambda_{3}(q^{0}_{\mathcal{T}} + q^{2}_{\mathcal{T}})\bigr)\\
    2\bigl(\lambda_{1}q^{2}_{\mathcal{T}} + \lambda_{3}(q^{0}_{\mathcal{T}} + q^{1}_{\mathcal{T}})\bigr)\\
    2\bigl(\lambda_{1}q^{3}_{\mathcal{T}} + \lambda_{3}q^{4}_{\mathcal{T}}\bigr)\\
    2\bigl(\lambda_{1}q^{4}_{\mathcal{T}} + \lambda_{3}q^{3}_{\mathcal{T}}\bigr)\\
    2\bigl(\lambda_{1}q^{5}_{\mathcal{T}} + \lambda_{3}q^{6}_{\mathcal{T}}\bigr)\\
    2\bigl(\lambda_{1}q^{6}_{\mathcal{T}} + \lambda_{3}q^{5}_{\mathcal{T}}\bigr)
    \end{bmatrix}}_{\textstyle\bm{C}}} 
  \\
  &= 0,
\end{split}
\end{equation}

\end{document}

enter image description here

You could use \textstyle\mathlarger{\bm{\Lambda}}, but I don't see a real reason for it (requires \usepackage{relsize}).

You must log in to answer this question.