ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sietse Brouwer <sbbrouwer@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: \unit and french
Date: Wed, 10 Oct 2012 22:59:10 +0200	[thread overview]
Message-ID: <CAF=dkzzT4A-_-LjVPeArgOwmSCMp2SNKfJQyJT_Dy_bzONwbdg@mail.gmail.com> (raw)
In-Reply-To: <E6A84897-B585-4484-A166-5C7D1C7F2266@gmail.com>

Sietse wrote:
>> % doesn't work correctly: comma is accepted as decimal mark at parse time,
>> % but then printed as thin space anyway. ?!?
>> \setupunit[method=3, order=reverse]
>> \units{12.345,00} %--> 12,345 00

Wolfgang wrote:
> I going to send then a mail to Hans with
> a description of this bug and also the one in Marcos link, both are in the Lua part
> of the code and it’s no so easy for me to fix them.

Actually, this bug is in the ConTeXt part of the code, in phys-dim.lua:

-\unexpanded\def\digitsfinalcomma          {\digitscommasymbol } %
more for tracing
\unexpanded\def\digitsfinalperiod         {\digitsperiodsymbol} % more
for tracing
\unexpanded\def\digitsintermediatecomma   {\digitscommasymbol } % more
for tracing
-\unexpanded\def\digitsintermediateperiod  {\digitsperiodsymbol} %
more for tracing

+\unexpanded\def\digitsfinalcomma          {\digitsperiodsymbol } %
more for tracing
\unexpanded\def\digitsfinalperiod         {\digitsperiodsymbol} % more
for tracing
\unexpanded\def\digitsintermediatecomma   {\digitscommasymbol } % more
for tracing
+\unexpanded\def\digitsintermediateperiod  {\digitscommasymbol} % more
for tracing

The mistake probably arose because \digitscommasymbol always
corresponds to the intermediate mark (the digits separator), not
always to the comma. I know the name wrong-footed me when I was
reading the code.

Romain: you can make this change in phys-dim.lua (around line 220),
then remake the formats with
context --make cont-en

Then this should work correctly:

    % 3: decimal comma, digits space
    % 4: decimal point, digits space

    % English input (order=normal)
    \setupunits[method=3]
    \unit{11,122.13 micro mol per second} \par
    \setupunits[method=4]
    \unit{21,222.23 micro mol per second} \par

    % French input (order=reverse)
    \setupunits[method=3, order=reverse]
    \unit{31.322,33 micro mol per second} \par
    \setupunits[method=4, order=reverse]
    \unit{41.422,43 micro mol per second} \par

Cheers,
Sietse
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2012-10-10 20:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 19:04 Romain Diss
2012-10-09 20:01 ` Wolfgang Schuster
2012-10-09 20:06   ` Wolfgang Schuster
2012-10-09 20:11   ` Marco Patzer
2012-10-09 20:29     ` Wolfgang Schuster
2012-10-09 20:40       ` Marco Patzer
2012-10-09 21:08       ` Romain Diss
2012-10-10 15:41         ` Sietse Brouwer
2012-10-10 19:25           ` Romain Diss
2012-10-10 19:51             ` Wolfgang Schuster
2012-10-10 20:59               ` Sietse Brouwer [this message]

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='CAF=dkzzT4A-_-LjVPeArgOwmSCMp2SNKfJQyJT_Dy_bzONwbdg@mail.gmail.com' \
    --to=sbbrouwer@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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).