ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Spacing issue with \digits in math mode
@ 2022-10-04 17:44 Gavin via ntg-context
  0 siblings, 0 replies; only message in thread
From: Gavin via ntg-context @ 2022-10-04 17:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

Hi list,

I have been trying to understand the workings of the \unit command, which is producing strange spacing in math mode. In an effort to be more systematic, I began by investigating the related \digit command. \digit works well in text, but in math mode the comma separators produce unwanted space.

\digits {12,345.67} vs.\ $\digits {12,345.67}$

Below is a one page test document, derived from the code in phys-dim.mkxl.

I think a simple fix would be to treat the comma as “ord” inside a number, but I don’t know if that is easy or not. I’d also like the space removed from around the “x" in scientific notation, which might be accomplished the same way.

Thanks for all the work on spacing in math!

Gavin


\setuppapersize[A4]

\showmakeup[mathglue] %\mathspacingmode=1

\starttext

Digits in math mode have problems with comma separators.

\startbuffer
10 \setdigitmode {1} \setdigitorder{0} $\digits {12,345.67e89}$
20 \setdigitmode {2} \setdigitorder{0} $\digits {12,345.67e89}$
30 \setdigitmode {3} \setdigitorder{0} $\digits {12,345.67e89}$
40 \setdigitmode {4} \setdigitorder{0} $\digits {12,345.67e89}$
50 \setdigitmode {5} \setdigitorder{0} $\digits {12,345.67e89}$
60 \setdigitmode {6} \setdigitorder{0} $\digits {12,345.67e89}$
11 \setdigitmode {1} \setdigitorder{1} $\digits {12,345.67e89}$
21 \setdigitmode {2} \setdigitorder{1} $\digits {12,345.67e89}$
31 \setdigitmode {3} \setdigitorder{1} $\digits {12,345.67e89}$
41 \setdigitmode {4} \setdigitorder{1} $\digits {12,345.67e89}$
51 \setdigitmode {5} \setdigitorder{1} $\digits {12,345.67e89}$
61 \setdigitmode {6} \setdigitorder{1} $\digits {12,345.67e89}$
\stopbuffer

\typebuffer

This is typeset as:

\startlines \getbuffer \stoplines

In text, the \type{\digits} command works fine:
\setdigitmode {2}\setdigitorder{0}\digits{12,345.67e89}.
\blank

Suggestion: Within \type{\digits} (and probably \type{\units}) the comma could be an \quotation{ord} rather than a \quotation{pun}. This appears to be how the period is handled.
\blank

I personally think the space around the \quotation{$\times$} is excessive, especially when the number is in a formula.
\startformula
 \digits {12,345.67e89} + \digits {12,345.67e89}
\stopformula
I would like the \quotation{$\times$} to also be an \quotation{ord} when used for scientific notation.

\stoptext
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-04 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 17:44 Spacing issue with \digits in math mode Gavin via ntg-context

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).