I need to highlight some parts of code containing both text and numbers using the siunitx
package but I get an invalid-token-in-number
, the token being a number!
Here's my mwe:
\documentclass{article}
\usepackage{soul} % Enables highlighting
\usepackage{siunitx}
\begin{document}
%% Error:
%% siunitx error: "invalid-token-in-number" and "Invalid token '6' in numerical input."
\hl{
Dummy text to avoid SI as very first argument of hl
\SI{666}{\nm}
Dummy text just in case}
\end{document}
Thanks for your help.
{\SI{666}{\nm}}
\SI
in my text when it needs to be (temporarily) highlighted. I love LaTeX but <Troll_mode> what is the use of it if one needs to deeply understand its way of doing things, just to do a simple thing as highlighting physics text.</Troll_mode>\hl{{\textcolor{white}{Fail}}}
is in fact a\newcommand
withFail
being an argument that is passed along... which cannot be done in this question.\hl
is doing can't remotely be described as simple:-) But you don't have to use it if you don't want you could use\colorbox
to add the highlights or tikz or use Word.\colorbox{red}{\parbox{\textwidth}{......}}
is all you need.