# How to use units in this equation?

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.

• Just want to notice that siunitx is just an option ... You don't really "should" use it. Yuo can just use the symbols instead with some distance between the numbers and the units... Jan 26 '18 at 7:28
• I don't really understand your question. You don't need anything in the sisetup, but you should read the siunitx manual as to how to write the units, it has special syntax for sugared etc. Plus it is not a good idea to write a formula like this in text style math, do it using displayed math, otherwise it becomes hard to read. Jan 26 '18 at 7:35

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}