ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* units module has bug with markIV?
@ 2008-09-03  1:36 Chen Shen
  2008-09-20  5:19 ` Chen Shen
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Shen @ 2008-09-03  1:36 UTC (permalink / raw)
  To: ntg-context

Hi all,
"\Micro" in the "units" module failed, while "\Nano" and "\Milli" works fine.
"$\mu$" works, so it doesn't look like a font problem.
The following code works with pdftex/MarkII, but fails under Luatex
0.29beta/MarkIV.

\usemodule[units]
\starttext Hello world! $1\Micro\Meter$ $1\Micro\Second$
\stoptext

Any hints? Thanks a lot!

regards,
shenchen
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: units module has bug with markIV?
  2008-09-03  1:36 units module has bug with markIV? Chen Shen
@ 2008-09-20  5:19 ` Chen Shen
  2008-09-20  8:09   ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Shen @ 2008-09-20  5:19 UTC (permalink / raw)
  To: ntg-context

Hi all,

I wonder if anyone could help with this problem with Units in mkiv.
Thanks a lot.

regards,
shenchen

On Wed, Sep 3, 2008 at 9:36 AM, Chen Shen <hashhsah@gmail.com> wrote:
> Hi all,
> "\Micro" in the "units" module failed, while "\Nano" and "\Milli" works fine.
> "$\mu$" works, so it doesn't look like a font problem.
> The following code works with pdftex/MarkII, but fails under Luatex
> 0.29beta/MarkIV.
>
> \usemodule[units]
> \starttext Hello world! $1\Micro\Meter$ $1\Micro\Second$
> \stoptext
>
> Any hints? Thanks a lot!
>
> regards,
> shenchen
>
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: units module has bug with markIV?
  2008-09-20  5:19 ` Chen Shen
@ 2008-09-20  8:09   ` Aditya Mahajan
  2008-09-20 10:28     ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2008-09-20  8:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 862 bytes --]

On Sat, 20 Sep 2008, Chen Shen wrote:

> Hi all,
>
> I wonder if anyone could help with this problem with Units in mkiv.
> Thanks a lot.
>
> regards,
> shenchen
>
> On Wed, Sep 3, 2008 at 9:36 AM, Chen Shen <hashhsah@gmail.com> wrote:
>> Hi all,
>> "\Micro" in the "units" module failed, while "\Nano" and "\Milli" works fine.
>> "$\mu$" works, so it doesn't look like a font problem.
>> The following code works with pdftex/MarkII, but fails under Luatex
>> 0.29beta/MarkIV.
>>
>> \usemodule[units]
>> \starttext Hello world! $1\Micro\Meter$ $1\Micro\Second$
>> \stoptext
>>
>> Any hints? Thanks a lot!
>>

I am just writing to say that I looked at your original message, but could 
not figure out what is going wrong. \Micro is expanded to μ, but then something
goes wrong.

Hans, Taco, can you see what is happening here?

Aditya

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: units module has bug with markIV?
  2008-09-20  8:09   ` Aditya Mahajan
@ 2008-09-20 10:28     ` Taco Hoekwater
  2008-09-21  4:23       ` Chen Shen
  0 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 2008-09-20 10:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> 
> I am just writing to say that I looked at your original message, but 
> could not figure out what is going wrong. \Micro is expanded to μ, but 
> then something
> goes wrong.
> 
> Hans, Taco, can you see what is happening here?

That took some thinking. The error is caused by the \mathcode of µ,
it is "7116, but it should be "0116. The '7' in the current
definition makes it switch along with \fam. \dimensiontypeface
expands to \tf, so \fam is set to 11, and that is \rm.

So you end up with this minimal file:

    \starttext
    $\rm µ$ % that's U+03BC
    \stoptext

The latin modern text (\rm) font does not have a greek alphabet.
If it did, all would have worked ok. Since that cannot easily be
fixed and I suspect most text fonts do not have greek, so changing
the mathcode of the greek characters is probably the best solution
(it affects normal math mode as well, as you can see)

And as an aside, it would be nicer to use U+00B5 (mu latin) in the
units module instead of U+03BC (mu greek).

   \def\Micro {\dimensionprefix{\iftextdimensions u\else\hbox{µ}\fi}}

The \hbox is needed because \fam11 is using ec encoding, I think.
(and that is problematic in its own way, but let's not go there)


Best wishes,
Taco
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: units module has bug with markIV?
  2008-09-20 10:28     ` Taco Hoekwater
@ 2008-09-21  4:23       ` Chen Shen
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Shen @ 2008-09-21  4:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Sep 20, 2008 at 6:28 PM, Taco Hoekwater <taco@elvenkind.com> wrote:
>
> And as an aside, it would be nicer to use U+00B5 (mu latin) in the
> units module instead of U+03BC (mu greek).
>
>   \def\Micro {\dimensionprefix{\iftextdimensions u\else\hbox{µ}\fi}}
>
> The \hbox is needed because \fam11 is using ec encoding, I think.
> (and that is problematic in its own way, but let's not go there)
>
>
Yes. This change to (mu latin) worked. Thank you so much for the
detailed explanations.
I think it is preferable to use upright greek letters in units.
The shape of (mu latin) in the latin modern font isn't the prettiest
design, but is still better than mixing italic mu with other upright
letters in units.
Besides, I guess, (mu latin) instead of u can be used in text-mode units?

regards,
shenchen
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-21  4:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-03  1:36 units module has bug with markIV? Chen Shen
2008-09-20  5:19 ` Chen Shen
2008-09-20  8:09   ` Aditya Mahajan
2008-09-20 10:28     ` Taco Hoekwater
2008-09-21  4:23       ` Chen Shen

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