ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gavin via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Gavin <gavinpublic@comcast.net>
Subject: Spacing in \unit
Date: Sun, 25 Sep 2022 07:30:30 -0600	[thread overview]
Message-ID: <01334D09-ECC1-4D29-B534-92928DB01D8E@comcast.net> (raw)

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
<line 3.9> 
    $2\pi\,\unit
    {3.00e8 kg m/s}$

Using \thinspace produces the same fatal error.

Putting the 2\pi after the \unit{…} can also cause surprises.

    $\unit{3.00e8 kg m/s}\times 2\pi$

produces a \times that is right up against the “s”.

I am very happy with all of the work done on spacing in math. I hope that my observations above are helpful in fine-tuning the excellent system.

Thanks!
Gavin

P.S. I am on as M1 Mac, using ConTeXt  ver: 2022.09.11 20:44 LMTX  fmt: 2022.9.25  int: english/english.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2022-09-25 13:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 13:30 Gavin via ntg-context [this message]
2022-09-25 15:19 ` Hans Hagen via ntg-context
2022-09-25 15:29   ` Gavin via ntg-context
2022-09-25 15:39     ` Hans Hagen via ntg-context
2022-09-25 16:31 ` Bruce Horrocks via ntg-context
2022-10-08 17:59 Gavin via ntg-context
2022-10-10  1:32 ` Alan Braslau via ntg-context
2022-10-10  6:15   ` Max Chernoff via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01334D09-ECC1-4D29-B534-92928DB01D8E@comcast.net \
    --to=ntg-context@ntg.nl \
    --cc=gavinpublic@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).