ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* mkiv math delimiters and <|>
@ 2009-11-13  9:03 Mojca Miklavec
  2009-11-14 22:21 ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Mojca Miklavec @ 2009-11-13  9:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

I have tried to compile an old document (written in mkii times). Among
other problems that I yet need to isolate, the following minimal
example doesn't want to compile: $\bigl| x \bigr>$ since <|> aren't
recognized as candidates for delimiters. There is a workaround of
course (using \langle, \rangle, ... instead of <>), but the three
characters are just way too handy to use.

I suppose that the behaviour in mkii comes from these lines:

\definemathcharacter [<]   [nothing] [sy] ["68] [ex] ["0A]
\definemathcharacter [>]   [nothing] [sy] ["69] [ex] ["0B]

But I'm not sure where mkiv could be changed.

I have tried to use
  adobename="greater",
  ...
  mathspec={
   { class="binary", name="gt" },
   { class="close", name="rbrace" },
  },
but without any success.

Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: mkiv math delimiters and <|>
  2009-11-13  9:03 mkiv math delimiters and <|> Mojca Miklavec
@ 2009-11-14 22:21 ` Aditya Mahajan
  2009-11-15  6:06   ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2009-11-14 22:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]

On Fri, Nov 13, 2009 at 4:03 AM, Mojca Miklavec <
mojca.miklavec.lists@gmail.com> wrote:

> Hello,
>
> I have tried to compile an old document (written in mkii times). Among
> other problems that I yet need to isolate, the following minimal
> example doesn't want to compile: $\bigl| x \bigr>$ since <|> aren't
> recognized as candidates for delimiters. There is a workaround of
> course (using \langle, \rangle, ... instead of <>), but the three
> characters are just way too handy to use.
>

| works fine here. < and > don't. I did not know that \left< is equivalent
to \left\langle even in plain tex.

I suppose that the behaviour in mkii comes from these lines:
>
> \definemathcharacter [<]   [nothing] [sy] ["68] [ex] ["0A]
> \definemathcharacter [>]   [nothing] [sy] ["69] [ex] ["0B]
>

I guess mkii is imitating plain tex here. (Though, I could not find how this
is happening in plain tex)


> But I'm not sure where mkiv could be changed.
>

I don't know how to do this. < should behave like a rel without a \left, and
like a delimited with \left.


> I have tried to use
>  adobename="greater",
>  ...
>  mathspec={
>   { class="binary", name="gt" },
>   { class="close", name="rbrace" },
>  },
> but without any success.
>

rbrace!!. Probabably you want rangle. You can change the order of the two,
and then > will map to rangle, but you will have to use \gt to get the
relation symbol.

Aditya

[-- Attachment #1.2: Type: text/html, Size: 2337 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: mkiv math delimiters and <|>
  2009-11-14 22:21 ` Aditya Mahajan
@ 2009-11-15  6:06   ` Taco Hoekwater
  2009-11-15  6:51     ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2009-11-15  6:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> On Fri, Nov 13, 2009 at 4:03 AM, Mojca Miklavec <
> mojca.miklavec.lists@gmail.com> wrote:
> 
>> Hello,
>>
>> I have tried to compile an old document (written in mkii times). Among
>> other problems that I yet need to isolate, the following minimal
>> example doesn't want to compile: $\bigl| x \bigr>$ since <|> aren't
>> recognized as candidates for delimiters. There is a workaround of
>> course (using \langle, \rangle, ... instead of <>), but the three
>> characters are just way too handy to use.
>>
> 
> | works fine here. < and > don't. I did not know that \left< is equivalent
> to \left\langle even in plain tex.
> 
> I suppose that the behaviour in mkii comes from these lines:
>> \definemathcharacter [<]   [nothing] [sy] ["68] [ex] ["0A]
>> \definemathcharacter [>]   [nothing] [sy] ["69] [ex] ["0B]
>>
> 
> I guess mkii is imitating plain tex here. (Though, I could not find how this
> is happening in plain tex)

 From plain.tex:

   \mathcode`\<="313C
   \delcode`\<="26830A

The first (\mathcode) controls standalone use, the second (\delcode)
use as a delimiter. Both can be set at the same time, and that second
one got lost in the conversion, probably because it has a dedicated
slot in Unicode (U+0x27E8, MATHEMATICAL LEFT ANGLE BRACKET).

Perhaps this can be done with the mathspec field in char-def.lua, but
I do not know how?

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


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

* Re: mkiv math delimiters and <|>
  2009-11-15  6:06   ` Taco Hoekwater
@ 2009-11-15  6:51     ` Aditya Mahajan
  2009-11-15  7:11       ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2009-11-15  6:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Sun, 15 Nov 2009, Taco Hoekwater wrote:

> Aditya Mahajan wrote:
>> On Fri, Nov 13, 2009 at 4:03 AM, Mojca Miklavec <
>> mojca.miklavec.lists@gmail.com> wrote:
>> 
>>> Hello,
>>> 
>>> I have tried to compile an old document (written in mkii times). Among
>>> other problems that I yet need to isolate, the following minimal
>>> example doesn't want to compile: $\bigl| x \bigr>$ since <|> aren't
>>> recognized as candidates for delimiters. There is a workaround of
>>> course (using \langle, \rangle, ... instead of <>), but the three
>>> characters are just way too handy to use.
>>> 
>> 
>> | works fine here. < and > don't. I did not know that \left< is equivalent
>> to \left\langle even in plain tex.
>> 
>> I suppose that the behaviour in mkii comes from these lines:
>>> \definemathcharacter [<]   [nothing] [sy] ["68] [ex] ["0A]
>>> \definemathcharacter [>]   [nothing] [sy] ["69] [ex] ["0B]
>>> 
>> 
>> I guess mkii is imitating plain tex here. (Though, I could not find how 
>> this
>> is happening in plain tex)
>
> From plain.tex:
>
>  \mathcode`\<="313C
>  \delcode`\<="26830A
>
> The first (\mathcode) controls standalone use, the second (\delcode)
> use as a delimiter. Both can be set at the same time, and that second
> one got lost in the conversion, probably because it has a dedicated
> slot in Unicode (U+0x27E8, MATHEMATICAL LEFT ANGLE BRACKET).
>
> Perhaps this can be done with the mathspec field in char-def.lua, but
> I do not know how?

The attached patch gives a working solution for lmmath but does not work 
with cambria. I don't know if the latter is a fault of context mkiv or 
luatex.

In any case,  this is a kludge as we have to define a dummy name. It will 
be better if we could just say name=false. Currently, if I use name=false, 
\left< gives an error.

Aditya

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1145 bytes --]

diff --git a/char-def.lua b/char-def.lua
index 3aec401..990bfd2 100644
--- a/char-def.lua
+++ b/char-def.lua
@@ -544,8 +544,10 @@ characters.data={
   description="LESS-THAN SIGN",
   direction="on",
   linebreak="al",
-  mathclass="binary",
-  mathname="lt",
+  mathspec={
+    { name="lt", class="binary" } ,
+    { name="ltdelim", class="delimiter" },
+  },
   mirror=0x003E,
   unicodeslot=0x003C,
  },
@@ -568,8 +570,10 @@ characters.data={
   description="GREATER-THAN SIGN",
   direction="on",
   linebreak="al",
-  mathclass="binary",
-  mathname="gt",
+  mathspec={
+    { name="gt", class="binary" } ,
+    { name="gtdelim", class="delimiter" },
+  },
   mirror=0x003C,
   unicodeslot=0x003E,
  },
diff --git a/math-vfu.lua b/math-vfu.lua
index 0300bb0..1543833 100644
--- a/math-vfu.lua
+++ b/math-vfu.lua
@@ -566,6 +566,8 @@ fonts.enc.math["large-to-small"] = {
     [0x02309] = 0x07, -- rceil
     [0x0007B] = 0x08, -- {
     [0x0007D] = 0x09, -- }
+    [0x0003C] = 0x0A, -- <
+    [0x0003E] = 0x0B, -- >
     [0x027E8] = 0x0A, -- <
     [0x027E9] = 0x0B, -- >
     [0x0007C] = 0x0C, -- |

[-- Attachment #3: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: mkiv math delimiters and <|>
  2009-11-15  6:51     ` Aditya Mahajan
@ 2009-11-15  7:11       ` Taco Hoekwater
  2009-11-15  7:37         ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2009-11-15  7:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> 
> The attached patch gives a working solution for lmmath but does not work 
> with cambria. I don't know if the latter is a fault of context mkiv or 
> luatex.

"Does not work" as in: no error, but no delimiter either? That would
be a side-effect of Cambria not having defined successors for LESS THAN.

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


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

* Re: mkiv math delimiters and <|>
  2009-11-15  7:11       ` Taco Hoekwater
@ 2009-11-15  7:37         ` Aditya Mahajan
  2009-11-15  7:40           ` Taco Hoekwater
  2009-11-15 17:25           ` Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: Aditya Mahajan @ 2009-11-15  7:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 15 Nov 2009, Taco Hoekwater wrote:

> Aditya Mahajan wrote:
>> 
>> The attached patch gives a working solution for lmmath but does not work 
>> with cambria. I don't know if the latter is a fault of context mkiv or 
>> luatex.
>
> "Does not work" as in: no error, but no delimiter either?

No scaled delimiter. There is no difference between \left< and <.

> That would
> be a side-effect of Cambria not having defined successors for LESS THAN.

I personally do not like this behavior of plain tex, with \left< being 
same as \left\langle. In the long run, all such delimiters should be 
defined similar to mathml fences,

\definemathfence[average][left=\langle, right=\rangle, scale=auto|none]

etc. Should we be really supporting this in MKIV?

Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: mkiv math delimiters and <|>
  2009-11-15  7:37         ` Aditya Mahajan
@ 2009-11-15  7:40           ` Taco Hoekwater
  2009-11-15 17:26             ` Hans Hagen
  2009-11-15 17:25           ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2009-11-15  7:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> I personally do not like this behavior of plain tex, with \left< being 
> same as \left\langle. In the long run, all such delimiters should be 
> defined similar to mathml fences,
> 
> \definemathfence[average][left=\langle, right=\rangle, scale=auto|none]
> 
> etc. Should we be really supporting this in MKIV?

That is a question for Mojca and Hans, I think. FWIW, I do not like it
that much either, as there *is* a proper character for this nowadays.

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


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

* Re: mkiv math delimiters and <|>
  2009-11-15  7:37         ` Aditya Mahajan
  2009-11-15  7:40           ` Taco Hoekwater
@ 2009-11-15 17:25           ` Hans Hagen
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2009-11-15 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> On Sun, 15 Nov 2009, Taco Hoekwater wrote:
> 
>> Aditya Mahajan wrote:
>>>
>>> The attached patch gives a working solution for lmmath but does not 
>>> work with cambria. I don't know if the latter is a fault of context 
>>> mkiv or luatex.
>>
>> "Does not work" as in: no error, but no delimiter either?
> 
> No scaled delimiter. There is no difference between \left< and <.
> 
>> That would
>> be a side-effect of Cambria not having defined successors for LESS THAN.
> 
> I personally do not like this behavior of plain tex, with \left< being 
> same as \left\langle. In the long run, all such delimiters should be 
> defined similar to mathml fences,
> 
> \definemathfence[average][left=\langle, right=\rangle, scale=auto|none]
> 
> etc. Should we be really supporting this in MKIV?

i don't know.

what i observe is that when we use \left\langle always (which is what we 
do in mathml in order to play safe) the first level symbol is always a 
bit bigger than just an <

maybe it's just a matter of thresholds or prepending a smaller < to the 
list

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: mkiv math delimiters and <|>
  2009-11-15  7:40           ` Taco Hoekwater
@ 2009-11-15 17:26             ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2009-11-15 17:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco Hoekwater wrote:
> Aditya Mahajan wrote:
>> I personally do not like this behavior of plain tex, with \left< being 
>> same as \left\langle. In the long run, all such delimiters should be 
>> defined similar to mathml fences,
>>
>> \definemathfence[average][left=\langle, right=\rangle, scale=auto|none]
>>
>> etc. Should we be really supporting this in MKIV?
> 
> That is a question for Mojca and Hans, I think. FWIW, I do not like it
> that much either, as there *is* a proper character for this nowadays.

indeed we should stick to what unicode provides; if some symbols is 
missing in lm or tx/pr ... we could fake it as i don't like returning to 
the times where each exception became a command with per font a 
different one

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2009-11-15 17:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-13  9:03 mkiv math delimiters and <|> Mojca Miklavec
2009-11-14 22:21 ` Aditya Mahajan
2009-11-15  6:06   ` Taco Hoekwater
2009-11-15  6:51     ` Aditya Mahajan
2009-11-15  7:11       ` Taco Hoekwater
2009-11-15  7:37         ` Aditya Mahajan
2009-11-15  7:40           ` Taco Hoekwater
2009-11-15 17:26             ` Hans Hagen
2009-11-15 17:25           ` Hans Hagen

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