[Tex/LaTex] How to use units in this equation

math-modesiunitx

I want to show some units in a fraction in math mode. It includes the following units: gram, squared meter, second, and molar mass. After searching the web, I understood that I should use load \usepackage{siunitx} with appropriate option in \siset{...}. The framework of the desired code should be something like this:

\usepackage{siunitx}
\sisetup{...}
$\frac{\SI{1}{\gram\meter^{2}\sec^{-1}}}{\SI{10}{\gram\mol^{-1}}}$

But, to add these units, I don't know what I should put in {...} for \siset. Thanks in advance.

Best Answer

it is not clear, what is your problem. to show your math expression with units you not need any presetting of siunitx. however, your expression i would rather write on the following way:

\documentclass{article}
\usepackage{siunitx}

\usepackage[textmath, active, tightpage]{preview}% for see only equation
                                                 % (don't use in real document)
\setlength\PreviewBorder{1em}

\begin{document}
\[
X=\frac{\SI{1}{\gram\square\metre\per\second}}{\SI{10}{\gram\per\mol}}
\]
\end{document}

enter image description here