# numbers and units in InDesign: Is there an easy way to do this?

I am involved in the writing of a lot of scientific texts. A lot of them I (am forced to) do in LaTeX. However, I prefer InDesign, and use it more often than Latex.

Scientific/engineering texts often requires lots of numbers with units ("5 m", or "10 s", or whatever). The scientific styleguides I tend to write to usually want at least a space between number and unit, but even more preferable is an em-space. Latex has this nice package called siunitx, which handles a few things with regards to units. To my knowledge, it:

• Deals with the em-space between number and unit
• makes the number+unit pair non-breaking, IE, you never get '5' on the end of one line and 's' on the next
• Handles the fact that you might want to change the writing style of a certain unit based on industry standards (Common example: gigabit-per-second should, in true 'SI' style, be written as Gb/s, but many electrical engineering works prefer Gbps instead). This can all be tweaked later.

The third point is something I don't really care about too much, but it would be nice if I could get a similar functionality in InDesign that handles the other two points: Make the space between them be em-space length, and have the entire thing be non-breaking. I've experimented around with paragraph and character styles, but it always ended up still being a hassle. Is there a 'correct' way of implementing this?

Edit: As pointed out, I was incorrect about the em-space (I will not change it in the original body to preserve context for the answer below). After more research, it is a debated topic among certain engineering, scientific and mathematical communities how wide this space should be (some saying it should be the width of a multiplication-dot, others using regular 'space', etc).

• An em-space, really? Are you totally 100 % on that? It is the largest of all fixed width spaces. "A length of 3 m" looks positively weird. May 28, 2020 at 14:48
• You a re correct, it is not an em-space. I was told that once, and it sounded logical, but I wasn't aware how wide the em-space was and it was clearly wrong. The space used by siunitx is narrower than a standard space, but I'm not sure how narrow. It is also not a official ISO or SI standard, but to keep consistency with texts written with latex, I would like to also implement the narrower space. May 29, 2020 at 7:31

You can create a GREP style inside a paragraph style which uses a character style to apply a non-breaking attribute to a GREP string like `\d+\ss`✝. Which, in english, means any pair of 'number-space-s' will be forced to stick together on the same line. You can then duplicate this GREP style for other units like `\d+\sm`✝ and so on.