Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 21:58, Hans Hagen  wrote:
> 
> On 7/24/2015 6:57 PM, Hans Aberg wrote:

 The Unicode monospace characters were added by mistake, because in 
 computer science, style does not affect semantics, as it does math. 
 Looking into old computer science books, they do not have monospace, and a 
 I recall a Pascal compiler on Mac OS 9 that used styled, non-monospace 
 fonts. So a monospace font may not be strictly necessary, though current 
 UTF-8 plain text does not look good. In Xcode, part of the reason is that 
 one cannot choose font per Unicode code point segments.
>>> 
>>> we're not talking of the monospace math alphabet (those are already covered 
>>> but the fonts) but about a monospaced font for editing and verbatim (handy 
>>> for manuals explaining math typesetting)
>> 
>> Right. But it was added because it is popular in computer science to use a 
>> monospace font, though not strictly necessary from the semantic point of 
>> view.
> 
> one extra alphabet is not putting that much of a burden on tex;

It is more a curiosity, the reason they were added. It might be useful some 
day, say using bold monospace for keywords in programming languages.

It reminds me, in math one can use the idea that upright for constants, italic 
for variables. But I think in LaTeX packages mathtools and/or unicode-math, it 
is difficult to do that in UTF-8, because the somehow translates them to italic.

And the Unicode sans-serif mathematical styles aren’t really semantic either 
from the mathematical point of view, but there is a technical standard to set 
tensors in sans-serif, and perhaps were added because of that. Physics books 
seem to be bit chaotic here. In pure math, it is all serif.

> let's hope math coders don't start using the many emoticons and alike that 
> unicode provides

From the Unicode list discussion, I think there was a fairly large number of 
additional symbols the poster wanted to be added. But it took a long time, via 
STIX, the get the current ones usable.

But as you note, any character could be in principle be used. That is how many 
started off.

>> So it makes me think that, instead of a monospace font for all the math 
>> characters, one  might switch to a variable-width font in the input code, as 
>> actuallye been the case in the past.
> 
> which is actually rather inconvenient for entering tables (and i'd also never 
> use it for programming)

Indeed, but that is the only use. The obsession in computer code to align 
vertically.

>> All that monospace tabbing will break, that is for sure.
> 
> right and proportial makes debugging hard (and how about blockwise copying)

So possibly, there should be some replacement when using a variable width font.

For the ASCII tabbing, the tab character was originally typically interpreted 
as being 8 spaces wide, but that is too much for computer code with higher 
indentation levels. So people switched using spaces instead, successively 
shrinking down to 2 spaces instead of tab, which is what I use.

Unicode has a number of tab characters, but haven’t seen them in use.


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 6:57 PM, Hans Aberg wrote:



On 24 Jul 2015, at 18:34, Hans Hagen  wrote:

On 7/24/2015 6:18 PM, Hans Aberg wrote:



On 24 Jul 2015, at 16:28, Hans Hagen  wrote:

On 7/24/2015 4:13 PM, Hans Aberg wrote:


You can add it if you think it is no problem. Proper Unicode characters in the 
input help the readability, so putting them at high priority seems good.


fyi, on the agenda for the gyre font project is to have a monospaced font that 
has most of unicode math so that we can have decent editing (once we have the 
funding covered)


The Unicode monospace characters were added by mistake, because in computer 
science, style does not affect semantics, as it does math. Looking into old 
computer science books, they do not have monospace, and a I recall a Pascal 
compiler on Mac OS 9 that used styled, non-monospace fonts. So a monospace font 
may not be strictly necessary, though current UTF-8 plain text does not look 
good. In Xcode, part of the reason is that one cannot choose font per Unicode 
code point segments.


we're not talking of the monospace math alphabet (those are already covered but 
the fonts) but about a monospaced font for editing and verbatim (handy for 
manuals explaining math typesetting)


Right. But it was added because it is popular in computer science to use a 
monospace font, though not strictly necessary from the semantic point of view.


one extra alphabet is not putting that much of a burden on tex; let's 
hope math coders don't start using the many emoticons and alike that 
unicode provides



So it makes me think that, instead of a monospace font for all the math 
characters, one  might switch to a variable-width font in the input code, as 
actuallye been the case in the past.


which is actually rather inconvenient for entering tables (and i'd also 
never use it for programming)



All that monospace tabbing will break, that is for sure.


right and proportial makes debugging hard (and how about blockwise copying)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] chapter only in bookmarks (not in text or in TOC)

2015-07-24 Thread Pablo Rodriguez
On 07/24/2015 02:14 PM, Hans Hagen wrote:
> On 7/6/2015 9:10 PM, Pablo Rodriguez wrote:
>> On 07/06/2015 05:56 PM, Hans Hagen wrote:
>> [...]
>> I need that there is no \hiddentile in the text itself, so I removed all
>> space after and before. But I cannot make vertical spaces in makeups work:
>> [...]
>>  \setuphead
>>  [hiddentitle]
>>  [placehead=empty,
>>   incrementnumber=list,
>>   number=no,
>>   before=,
>>   after=]
>> [...]
>> Is there any way to remove all spaces in \hiddentitle, so that makeups
>> work fine?
> 
> add page=

It works fine, Hans.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___

Re: [NTG-context] issue with font and lua code

2015-07-24 Thread Pablo Rodriguez
On 07/24/2015 10:26 AM, Hans Hagen wrote:
> On 7/20/2015 6:49 PM, Pablo Rodriguez wrote:
>> [...]
>> For some reason, the font gives the following error with the Lua code
>> (font can be downloaded from http://dl.dafont.com/dl/?f=sv_basic_manual):
>>
>> lua error   > lua error on line 33 in file svb.tex:
>> .../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1194: bad
>> argument #9 to 'define' (number expected, got nil)
>> stack traceback:
>>  [C]: in function 'define'
>>  .../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1194: in
>> function <.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1049>
>> 33 >>  \setupbodyfont[svb]
>>
>> The weird thing here is that the Lua code isn’t applied to the
>> problematic font.
>>
>> Is there a way to fix this strange interaction?
> 
> in that font the underscore has no depth, so:
> 
>  commands = {
>  { "right", -char.width },
>  { "down", char.depth or 0 },
>  { "slot", 1, underscore },
>  }

Many thanks for your reply and for the fix, Hans.

It works like charm.


Pablo
-- 
http://www.ousia.tk
___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 18:34, Hans Hagen  wrote:
> 
> On 7/24/2015 6:18 PM, Hans Aberg wrote:
>> 
>>> On 24 Jul 2015, at 16:28, Hans Hagen  wrote:
>>> 
>>> On 7/24/2015 4:13 PM, Hans Aberg wrote:
 
 You can add it if you think it is no problem. Proper Unicode characters in 
 the input help the readability, so putting them at high priority seems 
 good.
>>> 
>>> fyi, on the agenda for the gyre font project is to have a monospaced font 
>>> that has most of unicode math so that we can have decent editing (once we 
>>> have the funding covered)
>> 
>> The Unicode monospace characters were added by mistake, because in computer 
>> science, style does not affect semantics, as it does math. Looking into old 
>> computer science books, they do not have monospace, and a I recall a Pascal 
>> compiler on Mac OS 9 that used styled, non-monospace fonts. So a monospace 
>> font may not be strictly necessary, though current UTF-8 plain text does not 
>> look good. In Xcode, part of the reason is that one cannot choose font per 
>> Unicode code point segments.
> 
> we're not talking of the monospace math alphabet (those are already covered 
> but the fonts) but about a monospaced font for editing and verbatim (handy 
> for manuals explaining math typesetting)

Right. But it was added because it is popular in computer science to use a 
monospace font, though not strictly necessary from the semantic point of view.

So it makes me think that, instead of a monospace font for all the math 
characters, one  might switch to a variable-width font in the input code, as 
actuallye been the case in the past.

All that monospace tabbing will break, that is for sure.


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 6:18 PM, Hans Aberg wrote:



On 24 Jul 2015, at 16:28, Hans Hagen  wrote:

On 7/24/2015 4:13 PM, Hans Aberg wrote:


You can add it if you think it is no problem. Proper Unicode characters in the 
input help the readability, so putting them at high priority seems good.


fyi, on the agenda for the gyre font project is to have a monospaced font that 
has most of unicode math so that we can have decent editing (once we have the 
funding covered)


The Unicode monospace characters were added by mistake, because in computer 
science, style does not affect semantics, as it does math. Looking into old 
computer science books, they do not have monospace, and a I recall a Pascal 
compiler on Mac OS 9 that used styled, non-monospace fonts. So a monospace font 
may not be strictly necessary, though current UTF-8 plain text does not look 
good. In Xcode, part of the reason is that one cannot choose font per Unicode 
code point segments.


we're not talking of the monospace math alphabet (those are already 
covered but the fonts) but about a monospaced font for editing and 
verbatim (handy for manuals explaining math typesetting)


in a similar fashion a bold math font is not about math bold alphabets 
but about a whole bold font with a couple of heavy bold alphabets (handy 
for typesetting section heads in bold that have math)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 16:29, Hans Hagen  wrote:
> 
> On 7/24/2015 4:19 PM, Hans Aberg wrote:
>> 
 The function $f: A → B$, $g\colon A → B$.
>>> 
>>> we could add a mathsymbol entry but I leave that to Aditya to decide
>>> 
>>> {
>>>  adobename="colon",
>>>  category="po",
>>>  cjkwd="na",
>>>  description="COLON",
>>>  direction="cs",
>>>  linebreak="is",
>>>  mathclass="relation",
>>> --mathsymbol=0x2236,
>>>  unicodeslot=0x3A,
>>> },
>> 
>> 
>> Should it be 'mathclass=“relation”’? Mathematically, relations have extra 
>> space at both sides, whereas in the function $f: A → B$, there should not be 
>> much space before the “:”.
> 
> that's where the domain would kick in .. it can control that kind of spacing 
> issues

OK. The word “relation” makes me think of math relations. :-)


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 16:28, Hans Hagen  wrote:
> 
> On 7/24/2015 4:13 PM, Hans Aberg wrote:
>> 
>> You can add it if you think it is no problem. Proper Unicode characters in 
>> the input help the readability, so putting them at high priority seems good.
> 
> fyi, on the agenda for the gyre font project is to have a monospaced font 
> that has most of unicode math so that we can have decent editing (once we 
> have the funding covered)

The Unicode monospace characters were added by mistake, because in computer 
science, style does not affect semantics, as it does math. Looking into old 
computer science books, they do not have monospace, and a I recall a Pascal 
compiler on Mac OS 9 that used styled, non-monospace fonts. So a monospace font 
may not be strictly necessary, though current UTF-8 plain text does not look 
good. In Xcode, part of the reason is that one cannot choose font per Unicode 
code point segments.


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 16:26, Hans Hagen  wrote:
> 
> On 7/24/2015 4:08 PM, Hans Aberg wrote:
> 
>> I was thinking of just having the two, \colon and \ratio. Looking into some 
>> books before electronic typesetting, the spacing of the latter can vary 
>> widely: some do not use spaces at all. So a set might look
>>   {x:x < a}
>> instead of
>>   {x : x < a}
>> But that would be a typographical issue, rather than semantic.
> 
> but we do need to deal with the typographic issue

Yes, that is what I meant, typographic adjustments on top.

> and unicode is not covering every symantic (otherwise we would have more)

It covers all standard symbols at the end of 1990s. Since then a number of 
symbols have come into use. There was a discussion about that on the Unicode 
list. Those using them might add them as well. But new characters are created, 
so there is a need for accessing them as well.


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 4:19 PM, Hans Aberg wrote:



On 24 Jul 2015, at 15:48, Hans Hagen  wrote:



In the examples I mentioned (below), running ‘context’ on the first produces 
large colons, whereas ‘luatex’ on the second does not. The latter looks right 
to me.


define 'luatex' ... it's all about choices that macro packages make (or made in 
the past)


I use Tex Live 2015 that came last month.

$ luatex --version
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)




There is a similar issue with integral symbols, where somehow ConTeXt add 
additional spacing after it.
   http://www.ntg.nl/pipermail/ntg-context/2015/082541.html


— context —
\setupbodyfont[xits,10pt]

\setupformulas[location=left]

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %

\starttext

The function $f: A → B$, $g\colon A → B$.


we could add a mathsymbol entry but I leave that to Aditya to decide

{
  adobename="colon",
  category="po",
  cjkwd="na",
  description="COLON",
  direction="cs",
  linebreak="is",
  mathclass="relation",
--mathsymbol=0x2236,
  unicodeslot=0x3A,
},



Should it be 'mathclass=“relation”’? Mathematically, relations have extra space 
at both sides, whereas in the function $f: A → B$, there should not be much 
space before the “:”.


that's where the domain would kick in .. it can control that kind of 
spacing issues


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 4:13 PM, Hans Aberg wrote:



On 24 Jul 2015, at 15:34, Hans Hagen  wrote:



I have experimented with a theorem proof assistant that admitted parallel ASCII 
and Unicode symbol names, but it turns out to be complicated. Think of C/C++ 
trigraphs, a chore to implement, only to be removed in the latest standards.

So I think one should only focus on UTF-8, and add TeX ASCII “\” commands as a 
complement.

One problem with this approach is the lack of Unicode input methods. But that 
may coming.

For example, instead having “:=“ in the input file and let Lua translate it, 
one can merely type it and let the text editor translate it ≔ COLON EQUALS 
U+2254.


that is ok for some input sequences (this kind of input translation happens for 
accented characters and some math like negated symbols) but replacing <= in the 
input is bad as it is only meaningful in math and not all input is math (and 
unicode lacks script/language tagging); keep in mind that 'verbatim' in tex really 
means verbatim and input translation contradicts that


I have only the part that is used to produce math character output here, and it 
would be better to have it in the key map. But somehow, it would be possible to 
produce those Unicode characters. Right, there is a lot copy and paste, but it 
is slow.


It will save a lot of programming time, at least on the ConTEXt project. :-)


not really as that code is already in place for years; in this case it mainly 
boils down to adding some extra entries in the character database

(and this code is simple compared to other code so not much to save here)


You can add it if you think it is no problem. Proper Unicode characters in the 
input help the readability, so putting them at high priority seems good.


fyi, on the agenda for the gyre font project is to have a monospaced 
font that has most of unicode math so that we can have decent editing 
(once we have the funding covered)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 4:08 PM, Hans Aberg wrote:


I was thinking of just having the two, \colon and \ratio. Looking into some 
books before electronic typesetting, the spacing of the latter can vary widely: 
some do not use spaces at all. So a set might look
   {x:x < a}
instead of
   {x : x < a}
But that would be a typographical issue, rather than semantic.


but we do need to deal with the typographic issue and unicode is not 
covering every symantic (otherwise we would have more)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 15:48, Hans Hagen  wrote:

>> In the examples I mentioned (below), running ‘context’ on the first produces 
>> large colons, whereas ‘luatex’ on the second does not. The latter looks 
>> right to me.
> 
> define 'luatex' ... it's all about choices that macro packages make (or made 
> in the past)

I use Tex Live 2015 that came last month.

$ luatex --version
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)

> 
>> There is a similar issue with integral symbols, where somehow ConTeXt add 
>> additional spacing after it.
>>   http://www.ntg.nl/pipermail/ntg-context/2015/082541.html
>> 
>> 
>> — context —
>> \setupbodyfont[xits,10pt]
>> 
>> \setupformulas[location=left]
>> 
>> \begingroup\lccode`\~=`\:\lowercase{\endgroup
>>  \let~}\colon
>>\mathcode`\:="8000 %
>> 
>> \starttext
>> 
>> The function $f: A → B$, $g\colon A → B$.
> 
> we could add a mathsymbol entry but I leave that to Aditya to decide
> 
> {
>  adobename="colon",
>  category="po",
>  cjkwd="na",
>  description="COLON",
>  direction="cs",
>  linebreak="is",
>  mathclass="relation",
> --mathsymbol=0x2236,
>  unicodeslot=0x3A,
> },


Should it be 'mathclass=“relation”’? Mathematically, relations have extra space 
at both sides, whereas in the function $f: A → B$, there should not be much 
space before the “:”.


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 15:34, Hans Hagen  wrote:

>> I have experimented with a theorem proof assistant that admitted parallel 
>> ASCII and Unicode symbol names, but it turns out to be complicated. Think of 
>> C/C++ trigraphs, a chore to implement, only to be removed in the latest 
>> standards.
>> 
>> So I think one should only focus on UTF-8, and add TeX ASCII “\” commands as 
>> a complement.
>> 
>> One problem with this approach is the lack of Unicode input methods. But 
>> that may coming.
>> 
>> For example, instead having “:=“ in the input file and let Lua translate it, 
>> one can merely type it and let the text editor translate it ≔ COLON EQUALS 
>> U+2254.
> 
> that is ok for some input sequences (this kind of input translation happens 
> for accented characters and some math like negated symbols) but replacing <= 
> in the input is bad as it is only meaningful in math and not all input is 
> math (and unicode lacks script/language tagging); keep in mind that 
> 'verbatim' in tex really means verbatim and input translation contradicts that

I have only the part that is used to produce math character output here, and it 
would be better to have it in the key map. But somehow, it would be possible to 
produce those Unicode characters. Right, there is a lot copy and paste, but it 
is slow.

>> It will save a lot of programming time, at least on the ConTEXt project. :-)
> 
> not really as that code is already in place for years; in this case it mainly 
> boils down to adding some extra entries in the character database
> 
> (and this code is simple compared to other code so not much to save here)

You can add it if you think it is no problem. Proper Unicode characters in the 
input help the readability, so putting them at high priority seems good.


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 15:29, Hans Hagen  wrote:
> 
> On 7/24/2015 2:32 PM, Hans Aberg wrote:
>> [Note: I use the cc to know that I have received a reply.]
>> 
>>> On 24 Jul 2015, at 10:30, Hans Hagen  wrote:
>>> 
>>> On 7/20/2015 6:06 PM, Hans Aberg wrote:
>> 
> On 20 Jul 2015, at 16:40, Aditya Mahajan  wrote:
> 
> On Mon, 20 Jul 2015, Hans Aberg wrote:
> 
>> The LaTeX package unicode-math has an option colon=literal, which makes 
>> it behave as in math functions (as in example below). Has ConTeXt a 
>> similar option?
> 
> No. You have to use \colon.
 
 It would be nice with such an option, as it helps the readability of the 
 input files.
>>> 
>>> already for some years i'm thinking of something similar to openmath 
>>> dictionaries i.e. in many cases when one writes math it is in some field 
>>> that is consistent within a document, say logic or engineering
>>> 
>>> it is rather trivial to support something
>>> 
>>> \setupmathematics[domain=logic]
>>> 
>>> or so, where we automatically relate the math class with the symbols used, 
>>> something that becomes more important once we start coding in unicode 
>>> instead of using names
>>> 
>>> but ... in order to provide this, i need information about useful categories
>> 
>> Unicode provides one such category. The reason is all math characters are 
>> added and in that process analyzed. I worked with Taco on that in the late 
>> 1990s.
>> 
>> So one main option, which might be the simplest, to assume that the input is 
>> UTF-8. Oen can the added ASCII command names, based on the Unicode names. In 
>> addition some options for special needs and legacy.
> 
> i don't understand what you mean as the issue is not unicode or ascii but 
> categorizing symbols in classes

Right, but that has in part already been done by Unicode. It is not really 
possible to classify math symbols from the the mathematical point of view, as 
every author in principle use their own notation.

> when we have a symbol in the input (can be a : but also something else) in 
> some cases it is a binary but in other cases a relation or whatever

Right. When TeX was written, there was only ASCII, so Knuth set “:” to the 
ratio binary operator, and the function “:” to \colon.

Now, when Unicode is available, it sets the ratio binary operator to  ≔ COLON 
EQUALS U+2254, leaving : COLON U+003A open for other uses. So set the latter to 
\colon, and add a command \ratio for the former.

> this influences the spacing and the 'domain' (or dictionaries) group symbols 
> so that we can assign the right properties
> 
> entering a utf sequence representing 0x2236 still doesn't always prescribe 
> what mathclass it is, 0x22A5 0x22C5 0x25B3 are examples of such dual face 
> characters
> 
> (this is actually more important in for instance xml input)

I was thinking of just having the two, \colon and \ratio. Looking into some 
books before electronic typesetting, the spacing of the latter can vary widely: 
some do not use spaces at all. So a set might look
  {x:x < a}
instead of
  {x : x < a}
But that would be a typographical issue, rather than semantic.

___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 3:00 PM, Hans Aberg wrote:



On 24 Jul 2015, at 11:43, Hans Hagen  wrote:

On 7/20/2015 6:22 PM, Hans Aberg wrote:



On 20 Jul 2015, at 17:43, Manuel Blanco  wrote:

Well, you can make the colon active in math mode and then let it output \colon.

This is a TeX way, I don't know if there's a ConTeXt way for this:

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %


For some reason, the colon in ConTeXt is larger relative LuaTeX.


you probably mean latex (macro package) here as luatex (engine) itself doesn't 
do anything

keep in mind that context implements much of math in a complete different way, 
so solutions for problems or wishes are done differently too; in this case we 
try to use unicode and some lua magic instead of character juggling at the tex 
end

we also need to keep in mind that characters have to behave well in tagged pdf 
and exports and so



In the examples I mentioned (below), running ‘context’ on the first produces 
large colons, whereas ‘luatex’ on the second does not. The latter looks right 
to me.


define 'luatex' ... it's all about choices that macro packages make (or 
made in the past)



There is a similar issue with integral symbols, where somehow ConTeXt add 
additional spacing after it.
   http://www.ntg.nl/pipermail/ntg-context/2015/082541.html


— context —
\setupbodyfont[xits,10pt]

\setupformulas[location=left]

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %

\starttext

The function $f: A → B$, $g\colon A → B$.


we could add a mathsymbol entry but I leave that to Aditya to decide

 {
  adobename="colon",
  category="po",
  cjkwd="na",
  description="COLON",
  direction="cs",
  linebreak="is",
  mathclass="relation",
--mathsymbol=0x2236,
  unicodeslot=0x3A,
 },


\stoptext
—

— luatex —
\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %

The function $f: A \to B$.

\end
—


___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 2:40 PM, Hans Aberg wrote:



On 24 Jul 2015, at 11:40, Hans Hagen  wrote:

On 7/20/2015 6:09 PM, Hans Aberg wrote:



On 20 Jul 2015, at 17:50, Manuel Blanco  wrote:

A little bit more of intelligence can be given with

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \unexpanded\def~}{\futurelet\tmptoken\docolon}

\unexpanded\def\docolon{\ifx=\tmptoken\mathrel{\mathop{\mathchar`\:}}\else\colon\fi}
\mathcode`\:="8000 %

That lets you do $f: A \to B$ and $f(x) := x^2$


For the second, one can use ≔ COLON EQUALS U+2254. But it is a good point, 
though.


there is actually a more modern trick:

\starttext

\startluacode
characters.mathpairs[0x3A] = { [0x3D] = 0x2254 }
characters.mathpairs[0x3E] = { [0x3D] = 0x2265 }
characters.mathpairs[0x3C] = { [0x3D] = 0x2264 }
characters.mathpairs[0x3D] = { [0x3A] = 0x2255 }
\stopluacode

\startTEXpage
$a := b <= =< c =: d >= e$
\stopTEXpage

\stoptext


I have experimented with a theorem proof assistant that admitted parallel ASCII 
and Unicode symbol names, but it turns out to be complicated. Think of C/C++ 
trigraphs, a chore to implement, only to be removed in the latest standards.

So I think one should only focus on UTF-8, and add TeX ASCII “\” commands as a 
complement.

One problem with this approach is the lack of Unicode input methods. But that 
may coming.

For example, instead having “:=“ in the input file and let Lua translate it, 
one can merely type it and let the text editor translate it ≔ COLON EQUALS 
U+2254.


that is ok for some input sequences (this kind of input translation 
happens for accented characters and some math like negated symbols) but 
replacing <= in the input is bad as it is only meaningful in math and 
not all input is math (and unicode lacks script/language tagging); keep 
in mind that 'verbatim' in tex really means verbatim and input 
translation contradicts that



It will save a lot of programming time, at least on the ConTEXt project. :-)


not really as that code is already in place for years; in this case it 
mainly boils down to adding some extra entries in the character database


(and this code is simple compared to other code so not much to save here)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/24/2015 2:32 PM, Hans Aberg wrote:

[Note: I use the cc to know that I have received a reply.]


On 24 Jul 2015, at 10:30, Hans Hagen  wrote:

On 7/20/2015 6:06 PM, Hans Aberg wrote:



On 20 Jul 2015, at 16:40, Aditya Mahajan  wrote:

On Mon, 20 Jul 2015, Hans Aberg wrote:


The LaTeX package unicode-math has an option colon=literal, which makes it 
behave as in math functions (as in example below). Has ConTeXt a similar option?


No. You have to use \colon.


It would be nice with such an option, as it helps the readability of the input 
files.


already for some years i'm thinking of something similar to openmath 
dictionaries i.e. in many cases when one writes math it is in some field that 
is consistent within a document, say logic or engineering

it is rather trivial to support something

\setupmathematics[domain=logic]

or so, where we automatically relate the math class with the symbols used, 
something that becomes more important once we start coding in unicode instead 
of using names

but ... in order to provide this, i need information about useful categories


Unicode provides one such category. The reason is all math characters are added 
and in that process analyzed. I worked with Taco on that in the late 1990s.

So one main option, which might be the simplest, to assume that the input is 
UTF-8. Oen can the added ASCII command names, based on the Unicode names. In 
addition some options for special needs and legacy.


i don't understand what you mean as the issue is not unicode or ascii 
but categorizing symbols in classes


when we have a symbol in the input (can be a : but also something else) 
in some cases it is a binary but in other cases a relation or whatever


this influences the spacing and the 'domain' (or dictionaries) group 
symbols so that we can assign the right properties


entering a utf sequence representing 0x2236 still doesn't always 
prescribe what mathclass it is, 0x22A5 0x22C5 0x25B3 are examples of 
such dual face characters


(this is actually more important in for instance xml input)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 11:43, Hans Hagen  wrote:
> 
> On 7/20/2015 6:22 PM, Hans Aberg wrote:
>> 
>>> On 20 Jul 2015, at 17:43, Manuel Blanco  wrote:
>>> 
>>> Well, you can make the colon active in math mode and then let it output 
>>> \colon.
>>> 
>>> This is a TeX way, I don't know if there's a ConTeXt way for this:
>>> 
>>>\begingroup\lccode`\~=`\:\lowercase{\endgroup
>>>  \let~}\colon
>>>\mathcode`\:="8000 %
>> 
>> For some reason, the colon in ConTeXt is larger relative LuaTeX.
> 
> you probably mean latex (macro package) here as luatex (engine) itself 
> doesn't do anything
> 
> keep in mind that context implements much of math in a complete different 
> way, so solutions for problems or wishes are done differently too; in this 
> case we try to use unicode and some lua magic instead of character juggling 
> at the tex end
> 
> we also need to keep in mind that characters have to behave well in tagged 
> pdf and exports and so


In the examples I mentioned (below), running ‘context’ on the first produces 
large colons, whereas ‘luatex’ on the second does not. The latter looks right 
to me.

There is a similar issue with integral symbols, where somehow ConTeXt add 
additional spacing after it.
  http://www.ntg.nl/pipermail/ntg-context/2015/082541.html


— context —
\setupbodyfont[xits,10pt]

\setupformulas[location=left]

\begingroup\lccode`\~=`\:\lowercase{\endgroup
 \let~}\colon
   \mathcode`\:="8000 %

\starttext

The function $f: A → B$, $g\colon A → B$.

\stoptext
—

— luatex —
\begingroup\lccode`\~=`\:\lowercase{\endgroup
 \let~}\colon
   \mathcode`\:="8000 %

The function $f: A \to B$.

\end
—


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg

> On 24 Jul 2015, at 11:40, Hans Hagen  wrote:
> 
> On 7/20/2015 6:09 PM, Hans Aberg wrote:
>> 
>>> On 20 Jul 2015, at 17:50, Manuel Blanco  wrote:
>>> 
>>> A little bit more of intelligence can be given with
>>> 
>>>\begingroup\lccode`\~=`\:\lowercase{\endgroup
>>>  \unexpanded\def~}{\futurelet\tmptoken\docolon}
>>>
>>> \unexpanded\def\docolon{\ifx=\tmptoken\mathrel{\mathop{\mathchar`\:}}\else\colon\fi}
>>>\mathcode`\:="8000 %
>>> 
>>> That lets you do $f: A \to B$ and $f(x) := x^2$
>> 
>> For the second, one can use ≔ COLON EQUALS U+2254. But it is a good point, 
>> though.
> 
> there is actually a more modern trick:
> 
> \starttext
> 
> \startluacode
> characters.mathpairs[0x3A] = { [0x3D] = 0x2254 }
> characters.mathpairs[0x3E] = { [0x3D] = 0x2265 }
> characters.mathpairs[0x3C] = { [0x3D] = 0x2264 }
> characters.mathpairs[0x3D] = { [0x3A] = 0x2255 }
> \stopluacode
> 
> \startTEXpage
> $a := b <= =< c =: d >= e$
> \stopTEXpage
> 
> \stoptext

I have experimented with a theorem proof assistant that admitted parallel ASCII 
and Unicode symbol names, but it turns out to be complicated. Think of C/C++ 
trigraphs, a chore to implement, only to be removed in the latest standards.

So I think one should only focus on UTF-8, and add TeX ASCII “\” commands as a 
complement.

One problem with this approach is the lack of Unicode input methods. But that 
may coming.

For example, instead having “:=“ in the input file and let Lua translate it, 
one can merely type it and let the text editor translate it ≔ COLON EQUALS 
U+2254.

It will save a lot of programming time, at least on the ConTEXt project. :-)


___
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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Aberg
[Note: I use the cc to know that I have received a reply.]

> On 24 Jul 2015, at 10:30, Hans Hagen  wrote:
> 
> On 7/20/2015 6:06 PM, Hans Aberg wrote:

>>> On 20 Jul 2015, at 16:40, Aditya Mahajan  wrote:
>>> 
>>> On Mon, 20 Jul 2015, Hans Aberg wrote:
>>> 
 The LaTeX package unicode-math has an option colon=literal, which makes it 
 behave as in math functions (as in example below). Has ConTeXt a similar 
 option?
>>> 
>>> No. You have to use \colon.
>> 
>> It would be nice with such an option, as it helps the readability of the 
>> input files.
> 
> already for some years i'm thinking of something similar to openmath 
> dictionaries i.e. in many cases when one writes math it is in some field that 
> is consistent within a document, say logic or engineering
> 
> it is rather trivial to support something
> 
> \setupmathematics[domain=logic]
> 
> or so, where we automatically relate the math class with the symbols used, 
> something that becomes more important once we start coding in unicode instead 
> of using names
> 
> but ... in order to provide this, i need information about useful categories

Unicode provides one such category. The reason is all math characters are added 
and in that process analyzed. I worked with Taco on that in the late 1990s.

So one main option, which might be the simplest, to assume that the input is 
UTF-8. Oen can the added ASCII command names, based on the Unicode names. In 
addition some options for special needs and legacy.


___
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
___

Re: [NTG-context] Line wrapping inconsistency with tolerance, alignment and framed

2015-07-24 Thread Hans Hagen

On 6/18/2015 4:25 PM, Christoph Reller wrote:

Hi,

I have an (admittedly carefully crafted) example, see below. My question:
Why is the line wrapping different for this case within a framed and
outside of a framed?
How can I control the amount of space left on a line before breaking the
line within and without a framed consistently?

Any insight is welcome.


alignment settings are local in a framed (and similar cases)

\defineframed[myframe][align={flushleft,horizontal,stretch,verytolerant},frame=off,offset=overlay]



Christoph

MWE:

\setuptolerance[horizontal,stretch,verytolerant]
\defineframed[myframe][align=flushleft,frame=off,offset=0pt]

\starttext

\def\super{supercalifragilisticexpialidoc}
\startalignment[flushleft]
   \unhyphenated{\super\ + \super\ + \super\ + \super}
\stopalignment

\myframe{\unhyphenated{\super\ + \super\ + \super\ + \super}}

\stoptext


___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] chapter only in bookmarks (not in text or in TOC)

2015-07-24 Thread Hans Hagen

On 7/6/2015 9:10 PM, Pablo Rodriguez wrote:

On 07/06/2015 05:56 PM, Hans Hagen wrote:

[...]
\setupinteraction[state=start]
\placebookmarks[chapter,hiddentitle]
\definehead[hiddentitle][chapter]
\setuphead[hiddentitle][incrementnumber=list]
\starttext
  \completecontent
  \hiddentitle{Prologue}
  aa\page aa
  \chapter{Foreword}
  aa
  \chapter{Introduction}
\stoptext


[Sorry if this message is duplicated, but I’m afraid my email client is
misbehaving.]

Many thanks for your reply, Hans.

Only the second solution worked fine (the first solution had a problem
similar to a one I reported before [I don’t remember which one :-(]).

I need that there is no \hiddentile in the text itself, so I removed all
space after and before. But I cannot make vertical spaces in makeups work:

 \setupinteraction[state=start]
 \placebookmarks[chapter,hiddentitle]
 \definehead[hiddentitle][chapter]
 \setuphead
 [hiddentitle]
 [placehead=empty,
  incrementnumber=list,
  number=no,
  before=,
  after=]
 \starttext
  \completecontent
  \startmakeup[copyright][top=]
  \hiddentitle{[Copyright]}
  This document is released to the public...
  \stopmakeup
  \chapter{Foreword}
  aa
  \chapter{Introduction}
 \stoptext

Is there any way to remove all spaces in \hiddentitle, so that makeups
work fine?


add page=


\setuphead
[hiddentitle]
[placehead=empty,
 incrementnumber=list,
 number=no,
 page=,
 before=,
 after=]


Many thanks for your help,


Pablo




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] bug in blank pagebreak?

2015-07-24 Thread Hans Hagen

On 7/19/2015 7:56 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

 \definepagebreak
 [right:pagebreak]
 [yes, blank, right]
 %~ [yes, header, footer, right]

 \setuppagenumbering
 [location=inmargin]

 \setupheadertexts
 [Header text]

 \setuphead
 [chapter]
 [page=right:pagebreak,
  header=empty]

 \starttext
 \chapter{First Chapter}
 \dorecurse{12}{\input zapf\par}
 \stoptext

With beta from 2015.07.16 13:30, footer from page 1 and header from page
2 are gone.

But if I redefine the pagebreak with "header, footer" instead of
"blank", both missing header and footer are placed in their right places.

Isn’t it a bug? Or am I missing something?


I leave that to Wolfgang to look at because he suggested the patch.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Multiline equations break grid in columnsets

2015-07-24 Thread Hans Hagen

On 7/21/2015 9:32 AM, Sebastian Ørsted wrote:

I reported this some days ago, but it was a rather short report, which
might explain why nobody has reacted upon it yet. So this time I'll go
into greater detail:


there are two issues there, one was horizontal alignment (some day i'll 
do that part otherwise in order to get rid of some hard coded 
assumptions in the engine that are difficult to deal with); i fixed that 
a week ago but didn't want push a beta just before leaving for the tug 
2015 meeting


i just uploaded a beta with a possible fix for the vertical spacing 
(grid) but i'm not sure about side effects (but as there are no side 
effects outside grid mode we can experiment)


btw, columnsets are a bit special and mostly meant for magazine like 
cases and i need to redo that one in a mkiv-ish way



The grid system in columnsets works very well until the moment you
include a multiline equation somewhere. This causes the entire rest of
the page to be out of alignment with the grid. Try running this code
with MkIV:

 \setuplayout
 [grid=yes]
 \setupindenting[yes,medium]
 \definecolumnset[example][n=2]
 \setupformulas[indentnext=auto]
 \starttext
 \showgrid
 \startcolumnset[example]
 \input knuth
 \input knuth
 \input knuth
 \startformula
 \startmathalignment
 \NC x^2 + y^2 \NC = z^2\NR[+]
 \NC u^2 + v^2 \NC = w^2\NR[+]
 \stopmathalignment
 \stopformula
 \input knuth
 \input knuth
 \input knuth
 \stopcolumnset
 \stoptext

A picture of the result can be found in this question on TeX.SE
.


___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] reverse page order and reverse page numbering in one part of a book

2015-07-24 Thread Hans Hagen

On 7/22/2015 3:47 PM, Alan BRASLAU wrote:

On Wed, 22 Jul 2015 14:54:17 +0200
"Thomas A. Schmitz"  wrote:


On 07/22/2015 02:45 PM, Alan BRASLAU wrote:

The
project/product/component mechanism can help somewhat. I also know
that Thomas had written a streams module to handle the
synchronization of texts. However, I am not so sure how to go about
this in a real, full-fledged case with a complicated text.


Correction: "Thomas had a streams module written (by Hans)." I used
it for a bilingual document for my course material, but in the end,
it turned out that using it for a "real" book would have been
extremely complex. In my field, there are numerous books with a
bilingual layout, but I guess they are all still handcrafted, i.e.
manual page breaks etc. I just shudder to think what would happen if
someone has to add three words on page 3 of such a book - they would
have to redo every single darn pagebreak?


There are several different issues. Synchronization can be
line-by-line, paragraph-by-paragraph, sectionblock-by-sectionblock...
or, as is the case with the posting of this thread, part-by-part (i.e.
halves). The different "products" in multiple languages might only be
"synchronized" by structure, not by rendering at all.

Maybe Mari (and others) have regular experience in managing
multilingual documents and maintaining them under modification. And I
bring up this issue under the present thread as managing left-to-right
mixed with right-to-left text is a further complication that Idris (and
others) address regularly.


To some extend we can typeset in parallel but only with properly 
structured input (and xml is then probably the best candidate). Anyway I 
think that the editing is the bottleneck: how does one most conveniently 
edit in parallel? We might need to think about that first: the 
typeseting component should adapt, convenient editing is core issue.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] reverse page order and reverse page numbering in one part of a book

2015-07-24 Thread Hans Hagen

On 7/22/2015 4:28 PM, Thomas A. Schmitz wrote:

On 07/22/2015 03:47 PM, Alan BRASLAU wrote:

There are several different issues. Synchronization can be
line-by-line, paragraph-by-paragraph, sectionblock-by-sectionblock...
or, as is the case with the posting of this thread, part-by-part (i.e.
halves). The different "products" in multiple languages might only be
"synchronized" by structure, not by rendering at all.


Yes, and for good measure, add a couple of footnotes, floats, margin
inserts, and let the fun begin. I think we'd need a couple of duplicates
of Hans to take care of all this...


if i get good specs and the demands accept constraints and someone else 
write the documentation ... we also need to keep in mind that todays 
needs can be different from tomorrows (and your use of tex / xml is 
already a proof of this, paper solutions replaced by combinations of 
typesetting and interaction and ...)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Critical editions with ConTeXt

2015-07-24 Thread Hans Hagen

On 7/22/2015 11:33 PM, tala...@fastmail.fm wrote:

Dear Pablo,

Thank you very much for what you proposed — it did work indeed. I tried to 
achieve the same at some length this afternoon. I think I understand what is 
going on in the first macro, but wouldn’t have been able to arrive at the  the 
second one for \variant, or the counter (and still don’t fully understand it). 
Thanks again.

Hans, Idris, Thomas, and others interested in critical editions: I wonder 
whether this code — with the user-facing command \variant{#1}{#2} — might be 
something that could become part of an eventual CritTeXt package.


This is rather specific code and one then ends up with options for 
either or not the ] and so which then makes it more complex. Better is 
to collect such things into a module. If there is enough we can always 
see if some mechanisms are needed.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/20/2015 6:22 PM, Hans Aberg wrote:



On 20 Jul 2015, at 17:43, Manuel Blanco  wrote:

Well, you can make the colon active in math mode and then let it output \colon.

This is a TeX way, I don't know if there's a ConTeXt way for this:

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %


For some reason, the colon in ConTeXt is larger relative LuaTeX.


you probably mean latex (macro package) here as luatex (engine) itself 
doesn't do anything


keep in mind that context implements much of math in a complete 
different way, so solutions for problems or wishes are done differently 
too; in this case we try to use unicode and some lua magic instead of 
character juggling at the tex end


we also need to keep in mind that characters have to behave well in 
tagged pdf and exports and so



Also, it seems that “\:” is not used for anything - error in luatex, and empty 
in context. So it might be used for the infix operator.

— context —
\setupbodyfont[xits,10pt]

\setupformulas[location=left]

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %

\starttext

The function $f: A → B$, $g\colon A → B$.

\stoptext
—

— luatex —
\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \let~}\colon
\mathcode`\:="8000 %

The function $f: A → B$.
—

___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/20/2015 6:09 PM, Hans Aberg wrote:



On 20 Jul 2015, at 17:50, Manuel Blanco  wrote:

A little bit more of intelligence can be given with

\begingroup\lccode`\~=`\:\lowercase{\endgroup
  \unexpanded\def~}{\futurelet\tmptoken\docolon}

\unexpanded\def\docolon{\ifx=\tmptoken\mathrel{\mathop{\mathchar`\:}}\else\colon\fi}
\mathcode`\:="8000 %

That lets you do $f: A \to B$ and $f(x) := x^2$


For the second, one can use ≔ COLON EQUALS U+2254. But it is a good point, 
though.


there is actually a more modern trick:

\starttext

\startluacode
characters.mathpairs[0x3A] = { [0x3D] = 0x2254 }
characters.mathpairs[0x3E] = { [0x3D] = 0x2265 }
characters.mathpairs[0x3C] = { [0x3D] = 0x2264 }
characters.mathpairs[0x3D] = { [0x3A] = 0x2255 }
\stopluacode

\startTEXpage
$a := b <= =< c =: d >= e$
\stopTEXpage

\stoptext

i uploaded a beta with these predefined (in char-def.lua) but we can add 
more (if someone provides me the list)


negations and a few more already were present

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] Math literal colon

2015-07-24 Thread Hans Hagen

On 7/20/2015 6:06 PM, Hans Aberg wrote:



On 20 Jul 2015, at 16:40, Aditya Mahajan  wrote:

On Mon, 20 Jul 2015, Hans Aberg wrote:


The LaTeX package unicode-math has an option colon=literal, which makes it 
behave as in math functions (as in example below). Has ConTeXt a similar option?


No. You have to use \colon.


It would be nice with such an option, as it helps the readability of the input 
files.


already for some years i'm thinking of something similar to openmath 
dictionaries i.e. in many cases when one writes math it is in some field 
that is consistent within a document, say logic or engineering


it is rather trivial to support something

\setupmathematics[domain=logic]

or so, where we automatically relate the math class with the symbols 
used, something that becomes more important once we start coding in 
unicode instead of using names


but ... in order to provide this, i need information about useful 
categories


i had planned this for later this year but anyway uploaded a beta that 
has an experimental feature (this is something to discuss at the 
upcoming context meeting)


\startluacode
mathematics.registerdomain {
name   = "foo",
parents= { "bar" },
characters = {
[0x3A] = {
char  = 0x2236,
class = "inner"
}
}
}
\stopluacode

\startTEXpage
$a: b$\par
\setupmathematics[domain=foo]$a: b$\par
\mathematics[domain=foo]{a: b}\par
\definemathematics[foo][domain=foo]\mathematics[foo]{a: b}\par
\stopTEXpage

eventually we can consider a set of domains and a macro for defining a 
set of them etc but it all depends on use ...


i'll upload a beta

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___

Re: [NTG-context] issue with font and lua code

2015-07-24 Thread Hans Hagen

On 7/20/2015 6:49 PM, Pablo Rodriguez wrote:

Hans,

I have the following sample (it includes Lua code for underscore
hyphenation):

 \startluacode
 function document.addfunnyhyphen(tfmdata)
 local underscore = utf.byte("_")
 local char   = tfmdata.characters[underscore]
 if not char then return end
 tfmdata.characters[0xFE000]   = {
 width= 0,
 height   = 0,
 depth= 0,
 commands = {
 { "right", -char.width },
 { "down", char.depth },
 { "slot", 1, underscore },
 }
 }
 end
 utilities.sequencers.appendaction("aftercopyingcharacters",
 "after","document.addfunnyhyphen")
 \stopluacode

 \definehyphenationfeatures
 [underscore]
 [righthyphenchar="FE000]

 \setuphyphenation
 [method=traditional]

 \sethyphenationfeatures
 [strict]

 \definefontfamily[svb][rm][SV Basic Manual]

 \setupbodyfont[svb]

 \starttext
 \hyphenatedword{legibility}
 \stoptext

For some reason, the font gives the following error with the Lua code
(font can be downloaded from http://dl.dafont.com/dl/?f=sv_basic_manual):

lua error   > lua error on line 33 in file svb.tex:
.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1194: bad
argument #9 to 'define' (number expected, got nil)
stack traceback:
[C]: in function 'define'
.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1194: in
function <.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1049>
33 >>  \setupbodyfont[svb]

The weird thing here is that the Lua code isn’t applied to the
problematic font.

Is there a way to fix this strange interaction?


in that font the underscore has no depth, so:

commands = {
{ "right", -char.width },
{ "down", char.depth or 0 },
{ "slot", 1, underscore },
}

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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
___