Hello list,
I have a few questions about space produced by the unit command. Consider this MWE
\starttext
\unit{3.00e8 kg m/s}
$\unit{3.00e8 kg m/s}$
\stoptext
The dot between “kg” and “m” has different spacing depending on whether the \unit command is in text or math mode. I think that the tighter spacing in the first one, in text, is correct.
I personally would also like less space around the \times. To me, the number 3.00e8 should be typeset more like a single number, rather than like a product of 3.00 and 10^8. I am probably in the minority here. If \unit and \digit had an option for tighter spacing around the \times, I’d use it, but the current output with more space is probably what most people expect and want. Perhaps something like [scispace=tight].
Finally, \unit does not play nicely with surrounding spaces. For example:
$2\pi\,\unit{3.00e8 kg m/s}$
causes a fatal error:
tex error > tex error on line 9 in file ./Untitled.tex: Incompatible glue units (case 1)
<macro> \phys_units_direct
#1->\begingroup \the \everyunits \ifdim \lastskip
>\zeropoint \settrue \c_phys_units_dospace \removelastskip \fi \c_phys_digits_method \unitparameter \c!method \relax \ifmmode \else \dontleavehmode \fi \edef \currentunit {#1}\always\edef \unitlanguag
On 9/25/2022 3:30 PM, Gavin via ntg-context wrote:
Hello list,
I have a few questions about space produced by the unit command. Consider this MWE
\starttext \unit{3.00e8 kg m/s}
$\unit{3.00e8 kg m/s}$ \stoptext
The dot between “kg” and “m” has different spacing depending on whether the \unit command is in text or math mode. I think that the tighter spacing in the first one, in text, is correct.
I personally would also like less space around the \times. To me, the number 3.00e8 should be typeset more like a single number, rather than like a product of 3.00 and 10^8. I am probably in the minority here. If \unit and \digit had an option for tighter spacing around the \times, I’d use it, but the current output with more space is probably what most people expect and want. Perhaps something like [scispace=tight].
Finally, \unit does not play nicely with surrounding spaces. For example:
$2\pi\,\unit{3.00e8 kg m/s}$
causes a fatal error:
tex error > tex error on line 9 in file ./Untitled.tex: Incompatible glue units (case 1)
that's for the math todo that's an interesting case for the engine (Mixing regular and mu skips and so) ... we mighth finaly have a valid case for a primitive zero test Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hi Hans, I also just noticed that the space between the number and the unit is missing when I typeset with ConTeXt ver: 2022.09.11 20:44 LMTX fmt: 2022.9.25. This space was present in with the ConTeXt version I was using earlier, from a couple months ago. Thanks for putting it on the math todo list! Gavin (I sent the above message to Hans, but failed to cc the mailing list. Sorry if some of you get this twice.)
On Sep 25, 2022, at 9:19 AM, Hans Hagen
wrote: On 9/25/2022 3:30 PM, Gavin via ntg-context wrote:
Hello list, I have a few questions about space produced by the unit command. Consider this MWE \starttext \unit{3.00e8 kg m/s} $\unit{3.00e8 kg m/s}$ \stoptext The dot between “kg” and “m” has different spacing depending on whether the \unit command is in text or math mode. I think that the tighter spacing in the first one, in text, is correct. I personally would also like less space around the \times. To me, the number 3.00e8 should be typeset more like a single number, rather than like a product of 3.00 and 10^8. I am probably in the minority here. If \unit and \digit had an option for tighter spacing around the \times, I’d use it, but the current output with more space is probably what most people expect and want. Perhaps something like [scispace=tight].
that's for the math todo
Finally, \unit does not play nicely with surrounding spaces. For example: $2\pi\,\unit{3.00e8 kg m/s}$ causes a fatal error: tex error > tex error on line 9 in file ./Untitled.tex: Incompatible glue units (case 1) that's an interesting case for the engine (Mixing regular and mu skips and so) ... we mighth finaly have a valid case for a primitive zero test
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 9/25/2022 5:29 PM, Gavin via ntg-context wrote:
Hi Hans,
I also just noticed that the space between the number and the unit is missing when I typeset with ConTeXt ver: 2022.09.11 20:44 LMTX fmt: 2022.9.25. This space was present in with the ConTeXt version I was using earlier, from a couple months ago. Thanks for putting it on the math todo list! i can probably clean up the code a bit in lmtx ... units are not that (rapidly) evolving and much is rather old code so best collect all issues and make a test file that mikael and i can use (as wer then do math and text at the same time)
maybe we also need to add units (are there new ones anyway?) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 25 Sep 2022, at 14:30, Gavin via ntg-context
wrote: Hello list,
I have a few questions about space produced by the unit command. Consider this MWE
\starttext \unit{3.00e8 kg m/s}
$\unit{3.00e8 kg m/s}$ \stoptext
The dot between “kg” and “m” has different spacing depending on whether the \unit command is in text or math mode. I think that the tighter spacing in the first one, in text, is correct.
I personally would also like less space around the \times. To me, the number 3.00e8 should be typeset more like a single number, rather than like a product of 3.00 and 10^8. I am probably in the minority here. If \unit and \digit had an option for tighter spacing around the \times, I’d use it, but the current output with more space is probably what most people expect and want. Perhaps something like [scispace=tight].
I too would prefer less space around the times e.g. \starttext 3.00×10\high{8} \stoptext is fine (except for the 8 which is nicer in \unit). — Bruce Horrocks Hampshire, UK
participants (3)
-
Bruce Horrocks
-
Gavin
-
Hans Hagen