Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
Welcome to TeX.sx! While the problem is clear enough, at least to me, it's always a good idea to give a minimal working example (MWE) that illustrates your problem. For example, here other people might not work out what is going on with your units. –  Joseph Wright Sep 5 '12 at 20:43
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
    
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 '12 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 '12 at 21:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.