7

I made a new command for this unit:

\SI{#1(#3)e#2}{\KBE\per\gram\of{FM}}

But it is so bulky and it seems that latex can t handle the "normal" linebreak. So, my new UNIT is sometimes over the normal text width on the right margin

Is there an siunitx option to handle this, or any other solution?

1

1 Answer 1

7

Simple answer: no, you cannot break inside units, only at the join between the value and unit (option allow-number-unit-breaks). Thus to allow a break within the unit here you would need to write it (or at least part of it) out by hand

\SI{#1(#3)e#2}{\KBE}\break\si{\per\gram\of{FM}}

Longer answer: When I wrote siunitx version two I looked very hard at this. The 'rules' say that breaking units is bad, but sometimes it is necessary. However, it was not possible to come up with a way of allowing breaks here while maintaining the other things that siunitx does, and in particular not breaking stuff that already worked in version one. Internally, the entire unit is inside a (non-breakable) \hbox to let me deal with bold math, and the spacing problem cannot be solved while doing this.

2
  • 1
    For the interested: If/when I redo the ideas in siunitx for LaTeX3 'proper', this is one thing I'd do differently. That would mean some change in other parts of the 'spec'.
    – Joseph Wright
    Sep 5, 2012 at 20:54
  • Thank you, the option "allow-number-unit-breaks" made it. By the way, I made a short example and it worked, but I can t say why. You saved me a lot of time :o)
    – user87665
    Sep 5, 2012 at 21:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .