Math & Sciencenicefrac in siunitx

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

nicefrac in siunitx

Post by Singularity »

Is it possible to use standard units as in package siunitx and have the units display as if in a \nicefrac?

Also, how do you get the number portion of sinunitx (e.g., \num{\nicefrac{a}{b}}, or \Si{\nicefrac{a}{b}}{\units}) to work with \nicefrac?


I've looked over all of the options (and the cryptic documentation), but do not see how to make that work.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

nicefrac in siunitx

Post by Stefan Kottwitz »

You can use the original nicefrac, just turn of the siunitx internal parsing in such a case:

Code: Select all

\usepackage{siunitx}
\usepackage{nicefrac}
...
\SI[parse-numbers = false]{2\nicefrac{1}{4}}{\hour}
Stefan
LaTeX.org admin
Post Reply