# unicode-math and physics's \vb command

I can't get bold math with packages unicode-math and physics, here is mwe

\documentclass{article}
\usepackage{physics}
\usepackage{unicode-math}
\usepackage{amsmath}
\begin{document}
$a, \vb*{a}, \symbfit{a}$
\end{document}


I got

the second a didn't turn bold. How to fix it?

I found that in physics package, it defines \vb as

% Vector notation
\DeclareDocumentCommand\vectorbold{ s m }{\IfBooleanTF{#1}{\boldsymbol{#2}}{\mathbf{#2}}} % Vector bold [star for Greek and italic Roman]
\DeclareDocumentCommand\vb{}{\vectorbold} % Shorthand for \vectorbold


so I can redefine the \vectorbold command like this

\documentclass{article}
\usepackage{physics}
\usepackage{unicode-math}
\usepackage{amsmath}
\DeclareDocumentCommand\vectorbold{ s m }{\IfBooleanTF{#1}{\symbfit{#2}}{\symbf{#2}}} % Vector bold [star for Greek and italic Roman]
\begin{document}
$a, \vb*{a}, \vb{a}, \symbfit{a}$
\end{document}


Or I can use \symbfit instead of \boldsymbol and \symbf instead of \mathbf to reach the demand

\documentclass{article}
\usepackage{physics}
\usepackage{unicode-math}
\usepackage{amsmath}
\let\boldsymbol\symbfit
\let\mathbf\symbf
\begin{document}
$a, \vb*{a}, \vb{a}, \symbfit{a}$
\end{document}


I want to know is there some bad influence in these two methods?

I found some bad influence for redefining \mathbf and \boldsymbol, When I use \grad=\boldsymbol\nabla in physics package. which should give an upright, bold, nabla symbol. However \symbfit makes it italic,

\documentclass{article}
\usepackage{physics}
\usepackage{unicode-math}
\usepackage{amsmath}
\let\boldsymbol\symbfit
\let\mathbf\symbf
\begin{document}
$\nabla, \grad, \symbf{\nabla}$
\end{document}


I got

• Just beat me to it. I would recommend using the more semantic markup. It will also simplify re-using your source in PDFTeX if you ever need to. Aug 8 '21 at 4:47
• @Davislor sorry, I'm not an english native speaker. I don't understand what you mean. Could you please explain it a little bit? :( Aug 8 '21 at 5:27
• Pardon. I mean, I personally prefer a command such as \vectorsym for two reasons. First, it makes it easier to change the style of your vectors if, for example, you want to use an arrow instead of a bold letter. Second, it makes it easier to change from unicode-math and physics to other packages, such as if you have to copy your equation into a document compiled with PDFTeX. Aug 8 '21 at 6:12
• @Davislor Thanks for your explaination, I understand what you mean now Aug 8 '21 at 6:34