7

How to include \sqrt{8} inside \qty{...}{\metre}?

My Code:

\documentclass{article}

\usepackage{siunitx}

\begin{document}
    
    % works
    $\sqrt{8}$
    
    % works
    $\qty{8}{\meter}$
    
    % does not work!
    $\qty{\sqrt{8}}{\meter}$
        
\end{document}

My Result:

enter image description here

1 Answer 1

9

You could disable the parsing of numbers:

\documentclass{article}

\usepackage{siunitx}

\begin{document}
    
    % works
    $\sqrt{8}$
    
    % works
    $\qty{8}{\meter}$
    
    % does work!
    $\qty[parse-numbers=false]{\sqrt{8}}{\meter}$
        
\end{document}

enter image description here

You must log in to answer this question.

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