I want to have equations with units. For example, the Hooke's law in physics. There are 4 non-trivial ways as follows.
First Option
% first option
\documentclass[border=1cm,varwidth]{standalone}
\usepackage{siunitx,esvect}
\begin{document}
\SI[parse-numbers=false]{\vv F=-kx\hat{x}}{\newton}
\end{document}
Second Option (cannot be compiled)
% second option
\documentclass[border=1cm,varwidth]{standalone}
\usepackage{siunitx,esvect}
\begin{document}
\SI[parse-numbers=true]{$\vv F=-kx\hat{x}$}{\newton}
\end{document}
Third Option
% third option
\documentclass[border=1cm,varwidth]{standalone}
\usepackage{siunitx,esvect}
\begin{document}
$\vv F=-kx\hat{x}\,\si{\newton}$
\end{document}
Fourth Option
% fourth option
\documentclass[border=1cm,varwidth]{standalone}
\usepackage{siunitx,esvect}
\begin{document}
$\vv F=-kx\hat{x}$~\si{\newton}
\end{document}
Because the first one is not properly rendered in math font and the second one cannot be compiled, I have to choose between the last two. So which one is the recommended one?


