I want to use
\num (from the package
siunitx) for all the numbers in my document, tables included. (I have a lot and it would take a lot of time to do it manually.)
Is there a way to do that?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.Sign up to join this community
Applying a macro to all numbers in a document globally is so far I know not possible.
What you can do is using an advanced feature of many text editors called regular expressions to search and replace all numbers in your document files to add the
\num this way.
Just get an text editor which has this feature, like the free Notpad++, and try the following text as regular expression:
and as replacement text:
This regular expression searches for all numbers with or without + or -, maybe followed by spaces, and with or without a fractional part. It then adds the found number into
Make sure that you make a backup of your files first!