Re: [NTG-context] new lua/stack error

2017-02-23 Thread Alan Bowen
In my larger document (approx 600 pages, over 1000 references)
problematic entries like \cite[{{A, B, and C}}] did not display at all,
though the document did process without claims of stack errors etc.
Curiously,
\goto{A, B, and C}[{{A, B, and C}}]
does work as expected.

Alan

On Thu, Feb 23, 2017 at 4:12 PM, Alan Bowen  wrote:

> Thanks, Hans! That does work nicely.
>
> On Thu, Feb 23, 2017 at 3:42 PM, Hans Hagen  wrote:
>
>> On 2/22/2017 6:21 PM, Alan Bowen wrote:
>>
>>> Here is the file that I have been working with:
>>>
>>> \installlanguage[packed][en]
>>> \setuplanguage[packed][spacing=packed]
>>> \startsetups[tightspace]
>>>   \spaceskip 0.5\interwordspace plus .5\interwordstretch minus
>>> \interwordshrink
>>> \stopsetups
>>>
>>> \def\dostartbibitem[#1]{\startBibItem[title={#1},reference={#1}]}
>>> \def\startbibitem{\dosingleempty\dostartbibitem}
>>> \def\stopbibitem{\stopBibItem}
>>>
>>> \definedescription[BibItem][
>>> width=broad,
>>> margin=1.5pc,
>>> indenting={no},
>>> indentnext=no,
>>> alternative=hanging,
>>> hang=1,
>>> headcommand=\gobbleoneargument,
>>> align=right,
>>> before={\directsetup{tightspace}\bgroup\language[packed]},
>>> after={\egroup},
>>> ]
>>>
>>> \definereferenceformat [cite]  [type=title,left={},right={}]
>>> \definereferenceformat [bibpage]   [type=page]
>>>
>>> \starttext
>>>
>>> \startbibitem[A, B, and C]\stopbibitem % TEST by commenting these
>>> %\startbibitem[A{,} B{,} and C]\stopbibitem% lines out
>>>
>>> \startbibitem[ABC]\stopbibitem
>>> \startbibitem[A]\stopbibitem
>>> \startbibitem[B]\stopbibitem
>>> \startbibitem[C]\stopbibitem
>>>
>>> * \cite[A, B, and C] \qquad{\red output should  be: A{,} B{,} and C}
>>>
>>> **\cite[ABC] \qquad{\red output should be: ABC}
>>>
>>> ***\cite[A], \cite[B], \cite[C]  \qquad{\red output should be: A, B, C}
>>>
>>> \cite[A]\cite[B]\cite[C] \qquad{\red output should be: ABC}
>>>
>>> \stoptext
>>>
>>
>> references can be a comma separated list, so
>>
>> A, B, and C
>>
>> is actually three tags:  "A" "B" "and C"
>>
>> so, you run into parsing problems, so how to deal with:
>>
>> [A, B, and C]
>>
>> maybe:
>>
>> [{A, B, and C}]
>>
>> alas, in comma separated list the first level of {} is removed but we can
>> cheat:
>>
>> [{{A, B, and C}}]
>>
>> works with \cite [{{A, B, and C}}]
>>
>> Hans
>>
>>
>> -
>>   Hans Hagen | PRAGMA ADE
>>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>tel: 038 477 53 69 | www.pragma-ade.nl | 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/list
>> info/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> 
>> ___
>>
>
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] new lua/stack error

2017-02-23 Thread Alan Bowen
Thanks, Hans! That does work nicely.

On Thu, Feb 23, 2017 at 3:42 PM, Hans Hagen  wrote:

> On 2/22/2017 6:21 PM, Alan Bowen wrote:
>
>> Here is the file that I have been working with:
>>
>> \installlanguage[packed][en]
>> \setuplanguage[packed][spacing=packed]
>> \startsetups[tightspace]
>>   \spaceskip 0.5\interwordspace plus .5\interwordstretch minus
>> \interwordshrink
>> \stopsetups
>>
>> \def\dostartbibitem[#1]{\startBibItem[title={#1},reference={#1}]}
>> \def\startbibitem{\dosingleempty\dostartbibitem}
>> \def\stopbibitem{\stopBibItem}
>>
>> \definedescription[BibItem][
>> width=broad,
>> margin=1.5pc,
>> indenting={no},
>> indentnext=no,
>> alternative=hanging,
>> hang=1,
>> headcommand=\gobbleoneargument,
>> align=right,
>> before={\directsetup{tightspace}\bgroup\language[packed]},
>> after={\egroup},
>> ]
>>
>> \definereferenceformat [cite]  [type=title,left={},right={}]
>> \definereferenceformat [bibpage]   [type=page]
>>
>> \starttext
>>
>> \startbibitem[A, B, and C]\stopbibitem % TEST by commenting these
>> %\startbibitem[A{,} B{,} and C]\stopbibitem% lines out
>>
>> \startbibitem[ABC]\stopbibitem
>> \startbibitem[A]\stopbibitem
>> \startbibitem[B]\stopbibitem
>> \startbibitem[C]\stopbibitem
>>
>> * \cite[A, B, and C] \qquad{\red output should  be: A{,} B{,} and C}
>>
>> **\cite[ABC] \qquad{\red output should be: ABC}
>>
>> ***\cite[A], \cite[B], \cite[C]  \qquad{\red output should be: A, B, C}
>>
>> \cite[A]\cite[B]\cite[C] \qquad{\red output should be: ABC}
>>
>> \stoptext
>>
>
> references can be a comma separated list, so
>
> A, B, and C
>
> is actually three tags:  "A" "B" "and C"
>
> so, you run into parsing problems, so how to deal with:
>
> [A, B, and C]
>
> maybe:
>
> [{A, B, and C}]
>
> alas, in comma separated list the first level of {} is removed but we can
> cheat:
>
> [{{A, B, and C}}]
>
> works with \cite [{{A, B, and C}}]
>
> Hans
>
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>tel: 038 477 53 69 | www.pragma-ade.nl | 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/list
> info/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] floats on pages without headers

2017-02-23 Thread Alan Bowen
I have some large floats that look best on empty pages, i.e., pages that do
not have headers?

The wiki suggests that
location=page
will put the float on an empty page but this does not seem to be the case:

\starttext
\dorecurse{3}{\input knuth}

\startplacefigure[title=Cow,
location={page}]
{\externalfigure[cow.pdf][width=.7\textwidth]}
\stopplacefigure

\dorecurse{3}{\input knuth}

\stoptext

I am using the latest beta.

Alan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] new lua/stack error

2017-02-23 Thread Hans Hagen

On 2/22/2017 6:21 PM, Alan Bowen wrote:

Here is the file that I have been working with:

\installlanguage[packed][en]
\setuplanguage[packed][spacing=packed]
\startsetups[tightspace]
  \spaceskip 0.5\interwordspace plus .5\interwordstretch minus
\interwordshrink
\stopsetups

\def\dostartbibitem[#1]{\startBibItem[title={#1},reference={#1}]}
\def\startbibitem{\dosingleempty\dostartbibitem}
\def\stopbibitem{\stopBibItem}

\definedescription[BibItem][
width=broad,
margin=1.5pc,
indenting={no},
indentnext=no,
alternative=hanging,
hang=1,
headcommand=\gobbleoneargument,
align=right,
before={\directsetup{tightspace}\bgroup\language[packed]},
after={\egroup},
]

\definereferenceformat [cite]  [type=title,left={},right={}]
\definereferenceformat [bibpage]   [type=page]

\starttext

\startbibitem[A, B, and C]\stopbibitem % TEST by commenting these
%\startbibitem[A{,} B{,} and C]\stopbibitem% lines out

\startbibitem[ABC]\stopbibitem
\startbibitem[A]\stopbibitem
\startbibitem[B]\stopbibitem
\startbibitem[C]\stopbibitem

* \cite[A, B, and C] \qquad{\red output should  be: A{,} B{,} and C}

**\cite[ABC] \qquad{\red output should be: ABC}

***\cite[A], \cite[B], \cite[C]  \qquad{\red output should be: A, B, C}

\cite[A]\cite[B]\cite[C] \qquad{\red output should be: ABC}

\stoptext


references can be a comma separated list, so

A, B, and C

is actually three tags:  "A" "B" "and C"

so, you run into parsing problems, so how to deal with:

[A, B, and C]

maybe:

[{A, B, and C}]

alas, in comma separated list the first level of {} is removed but we 
can cheat:


[{{A, B, and C}}]

works with \cite [{{A, B, and C}}]

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread luigi scarso
On Thu, Feb 23, 2017 at 6:50 PM, Ulrike Fischer  wrote:
> Am Thu, 23 Feb 2017 18:45:04 +0100 schrieb luigi scarso:
>
>> no crash here with luatex 1.0.4 on my local box
>
> I just tried the lualatex examples with my luatex 1.0.4 too (I got
> it from w32tex.org) and the error seems to be gone.
ah w32tex.. right.
(offtopic)
So... can you check if the png/svg backed of mplib in luatex is still
available ?

-- 
luigi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Hans Hagen

On 2/23/2017 6:26 PM, Ulrike Fischer wrote:

Am Thu, 23 Feb 2017 16:55:08 +0100 schrieb Hans Hagen:


it's not a ligature but a multiple

fonts.handlers.otf.addfeature
   {
 name= "decompose",
 type= "multiple",
 nocheck = true, -- new trick



I updated my context version and changed my luaotfload.conf so that
it uses the context fontloader. Then the following plain tex
document (and a similar latex document) works and gives the wanted
output.

BUT: If I uncomment the AU+0323 then I get a fatal error:

texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc)table={
 [7684]={ 66, 803 },
}

! error:  (linebreak): invalid list tail, probably missing glue
!  ==> Fatal error occurred, no output PDF file produced!Drücken Sie
eine beliebige Taste . . .

(that's from the terminal output, the log doesn't show the
"table=..." part).


This "invalid list tail" is popping up now an then. Philip even
found a version were context crashed:
https://github.com/lualatex/luaotfload/issues/388


\input luaotfload.sty

\directlua
{
  fonts.handlers.otf.addfeature
  {
name = "compose",
type = "ligature",
data =
{
  ["Ạ"]={ "A", "̣" },
},
  }
}
\directlua{
fonts.handlers.otf.addfeature
   {
 name= "decompose",
 type= "multiple",
 nocheck = true,
 data=
 {
   ["Ḅ"] = { "B", "̣" },
 },
   }
}
%\begin{document}
\font\test={file:lmroman10-regular.otf:mode=node;+decompose;+compose;}

\test

Ḅ Ạ % Ạ  %uncomment this to get a fatal error.
Ḅ

\bye


With the standard fontloader of luaotfload there is no error but the
output is not correct.


I think that you cannot drop the new context code in an old otfload, 
because (1) afaik otfload patches code, and (2) because the context code 
assumes luatex 1.0.3 at least. Philip send me some test files a while 
ago so these bugs might have been fixed.


(There are no real fundamental changes, most is performance related and 
there have been improvements in discretionary handling. I have no clue 
if I added all relevant helpers to the generic code but normally  Philip 
checks that.)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
Am Thu, 23 Feb 2017 18:45:04 +0100 schrieb luigi scarso:

> no crash here with luatex 1.0.4 on my local box

I just tried the lualatex examples with my luatex 1.0.4 too (I got
it from w32tex.org) and the error seems to be gone. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Hans Hagen

On 2/23/2017 6:26 PM, Ulrike Fischer wrote:


With the standard fontloader of luaotfload there is no error but the
output is not correct.


btw, plain tests can be done with

mtxrun --script plain --make

mtxrun --script plain yourfile

(at least that is how Luigi and I test generic when plain crashes are 
reported)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
Am Thu, 23 Feb 2017 18:41:28 +0100 schrieb Hans Hagen:


> I think that you cannot drop the new context code in an old otfload, 
> because (1) afaik otfload patches code,

Well not every fontloader version works, and it is always possible
that a too new (or too old) context fontloader breaks, but it
doesn't hurt to try

> and (2) because the context code  assumes luatex 1.0.3 at least.

Bingo. With luatex 1.0.4 it works and the fatal error is gone ;-)



-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread luigi scarso
On Thu, Feb 23, 2017 at 6:26 PM, Ulrike Fischer  wrote:
> Am Thu, 23 Feb 2017 16:55:08 +0100 schrieb Hans Hagen:
>
>> it's not a ligature but a multiple
>>
>> fonts.handlers.otf.addfeature
>>{
>>  name= "decompose",
>>  type= "multiple",
>>  nocheck = true, -- new trick
>
>
> I updated my context version and changed my luaotfload.conf so that
> it uses the context fontloader. Then the following plain tex
> document (and a similar latex document) works and gives the wanted
> output.
>
> BUT: If I uncomment the AU+0323 then I get a fatal error:
>
> texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc)table={
>  [7684]={ 66, 803 },
> }
>
> ! error:  (linebreak): invalid list tail, probably missing glue
> !  ==> Fatal error occurred, no output PDF file produced!Drücken Sie
> eine beliebige Taste . . .
>
> (that's from the terminal output, the log doesn't show the
> "table=..." part).
>
>
> This "invalid list tail" is popping up now an then. Philip even
> found a version were context crashed:
> https://github.com/lualatex/luaotfload/issues/388

https://bitbucket.org/phg/lua-la-tex-tests/src/tip/context/cnt-luatex-2-crash-kern-base.tex?fileviewer=file-view-default
\starttext
  \def \feats {+kern;mode=base} %% “node” works
  \definefontfeature [crash] [kern=yes,mode=base]
  \definedfont [file:Iwona-Regular.otf*crash]
  participated
\stoptext

no crash here with luatex 1.0.4 on my local box
(will commit soon to experimental)


-- 
luigi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
Am Thu, 23 Feb 2017 16:55:08 +0100 schrieb Hans Hagen:

> it's not a ligature but a multiple
> 
> fonts.handlers.otf.addfeature
>{
>  name= "decompose",
>  type= "multiple",
>  nocheck = true, -- new trick


I updated my context version and changed my luaotfload.conf so that
it uses the context fontloader. Then the following plain tex
document (and a similar latex document) works and gives the wanted
output. 

BUT: If I uncomment the AU+0323 then I get a fatal error:

texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc)table={
 [7684]={ 66, 803 },
}

! error:  (linebreak): invalid list tail, probably missing glue
!  ==> Fatal error occurred, no output PDF file produced!Drücken Sie
eine beliebige Taste . . .

(that's from the terminal output, the log doesn't show the
"table=..." part).


This "invalid list tail" is popping up now an then. Philip even
found a version were context crashed:
https://github.com/lualatex/luaotfload/issues/388


\input luaotfload.sty

\directlua
{
  fonts.handlers.otf.addfeature
  {
name = "compose",
type = "ligature",
data =
{
  ["Ạ"]={ "A", "̣" },
},
  }
}
\directlua{
fonts.handlers.otf.addfeature
   {
 name= "decompose",
 type= "multiple",
 nocheck = true, 
 data=
 {
   ["Ḅ"] = { "B", "̣" },
 },
   }
}
%\begin{document}
\font\test={file:lmroman10-regular.otf:mode=node;+decompose;+compose;}

\test

Ḅ Ạ % Ạ  %uncomment this to get a fatal error. 
Ḅ

\bye


With the standard fontloader of luaotfload there is no error but the
output is not correct. 

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Arthur Reutenauer
> I looked at the code and it actually uses an idea that I had already
> tried. The problem I couldn't solve was do decompose a glyph.
> Looking at an context example it seems that context can do it. The B
> with dot below (U+1E04) ends as BU+0323 in the pdf. But how does
> context does it?

  It uses the Unicode composition information (part of UnicodeData.txt),
they’re made into a Lua table in ConTeXt (named char-def.lua, if it
hasn’t changed).

Best,

Arthur
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Hans Hagen

On 2/23/2017 4:12 PM, Ulrike Fischer wrote:

Am Thu, 23 Feb 2017 14:08:54 +0100 schrieb Hans Hagen:


Did you sent the second mail only for me for a reason or did you
only forget to add the list? Imho this is interesting for others
too.


well, it had an attachment that you can test which is not meant for
context (to which i'll add a similar collapse feature, off by default of
course as an escape) .. if that kind of stuff makes it into the latex
font code is up to others


I looked at the code and it actually uses an idea that I had already
tried. The problem I couldn't solve was do decompose a glyph.
Looking at an context example it seems that context can do it. The B
with dot below (U+1E04) ends as BU+0323 in the pdf. But how does
context does it? It doesn't happen with a similar latex example.
There the U+1E04 is simply missing.

And why is the dot of the first B better placed than the second?


\starttext
\directlua
{
  fonts.handlers.otf.addfeature
  {
name = "compose",
type = "ligature",
data =
{
  ["Ạ"]={ "A", "̣" },
  ["Ḅ"]={ "B", "̣" },
},
  }
}

\font\test={file:lmroman10-regular.otf:+compose;}

\test

Ḅ Ạ Ḅ %why are both B in the pdf???

\stoptext


it's not a ligature but a multiple

fonts.handlers.otf.addfeature
  {
name= "decompose",
type= "multiple",
nocheck = true, -- new trick
data=
{
  ["Ḅ"] = { "Q", "̣" },
  ["Ạ"] = { "X", "̣" },
},
  }

as with all features we check against the font so of the font has no Ḅ
nothing happens and you won't see one either (as the font has no)

i'll add the nocheck option (but of course one can expect side effects 
when a font has nothing relevant)



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
Am Thu, 23 Feb 2017 14:08:54 +0100 schrieb Hans Hagen:

>> Did you sent the second mail only for me for a reason or did you
>> only forget to add the list? Imho this is interesting for others
>> too.
> 
> well, it had an attachment that you can test which is not meant for 
> context (to which i'll add a similar collapse feature, off by default of 
> course as an escape) .. if that kind of stuff makes it into the latex 
> font code is up to others

I looked at the code and it actually uses an idea that I had already
tried. The problem I couldn't solve was do decompose a glyph.
Looking at an context example it seems that context can do it. The B
with dot below (U+1E04) ends as BU+0323 in the pdf. But how does
context does it? It doesn't happen with a similar latex example.
There the U+1E04 is simply missing.

And why is the dot of the first B better placed than the second?
 

\starttext
\directlua
{
  fonts.handlers.otf.addfeature
  {
name = "compose",
type = "ligature",
data =
{
  ["Ạ"]={ "A", "̣" },
  ["Ḅ"]={ "B", "̣" },
},
  }
}

\font\test={file:lmroman10-regular.otf:+compose;}

\test

Ḅ Ạ Ḅ %why are both B in the pdf???

\stoptext




-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Hans Hagen

On 2/23/2017 3:05 PM, Ulrike Fischer wrote:

Am Thu, 23 Feb 2017 14:08:54 +0100 schrieb Hans Hagen:


btw, i suppose most context enter composed glyphs anyway instead of
separate thingies


But as my example (for the B with dot below) shows that this fails
if the font hasn't the precomposed glyph.

Also the problem is not so much to control the direct input but
copy


collapsing only can work for direct chars (so not \char for which we 
need that pseudo feature) ... when you put this on the first line it 
should do better


% directives="filters.utf.collapse=yes"

\starttext
ạ ị Ạ g̣
\stoptext

should work (and it should be on by default which somehow it wasn't, 
probably disabled when i added some other input handling but no one 
noticed so far)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
Am Thu, 23 Feb 2017 14:08:54 +0100 schrieb Hans Hagen:

> btw, i suppose most context enter composed glyphs anyway instead of 
> separate thingies

But as my example (for the B with dot below) shows that this fails
if the font hasn't the precomposed glyph.

Also the problem is not so much to control the direct input but
copy  

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] controlling title head distances when grid is enabled

2017-02-23 Thread Csikos Bela
Dear context users:

I would like to typeset my documents to gridlines. If grid is enabled,
the distances between titles (section, subsection,subsubsection heads)
and text are too big. Here's an example:

\setuplayout[grid=yes]
\showgrid
\starttext
\section{Section One}
\input tufte
\subsection{Subsection One}
\input ward
\subsubsection{Subsubsection One}
\input tufte
\section{Section Two}
\subsection{Subsection Two}
\input davis
\subsection{Subsection Three}
\input dawkins
\stoptext

In the output there are 3 empty lines before and 2 after Subsection One.
It would be enough 2 and 1 lines, respectively. On page 2, between
Section Two and Subsection Two heads 4 empty lines are inserted,
which is to much (ugly). How can I control the empty space before
and after heads when grid is enabled? 

I tried this:
\setuphead[section][before=\vskip-2.8ex,after=\vskip-2.8ex]
but it removes all spaces not only 1 line.

I also tried 
\setuphead[section][before={\blank[2*line]},after={\blank[line]}]
but it doesn't have any effect.

Thank you in advance,

bcsikos

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] XML export of a lua table

2017-02-23 Thread Peter Rolf
Am 23.02.2017 um 14:10 schrieb Hans Hagen:
> On 2/23/2017 1:50 PM, Peter Rolf wrote:
>> Hi,
>>
>> what is the easiest way to export a lua table (mostly key-value pairs)
>> into a XML file? I found 'lxml.save', but no luck with a converter
>> function. Any help welcome.
> 
> kind of obvious:
> 
> local t = { a = { b = 1 } }
> 
> inspect(table.toxml(t))
> 

Mhhh, tried that among others (always an empty XML document as result).
I guess I better start with only a small portion of the original table
(~560Kbyte as lua code).

Thanks for the pointer :D

> 
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] XML export of a lua table

2017-02-23 Thread Hans Hagen

On 2/23/2017 1:50 PM, Peter Rolf wrote:

Hi,

what is the easiest way to export a lua table (mostly key-value pairs)
into a XML file? I found 'lxml.save', but no luck with a converter
function. Any help welcome.


kind of obvious:

local t = { a = { b = 1 } }

inspect(table.toxml(t))


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Hans Hagen

On 2/23/2017 1:35 PM, Ulrike Fischer wrote:


Did you sent the second mail only for me for a reason or did you
only forget to add the list? Imho this is interesting for others
too.


well, it had an attachment that you can test which is not meant for 
context (to which i'll add a similar collapse feature, off by default of 
course as an escape) .. if that kind of stuff makes it into the latex 
font code is up to others


btw, i suppose most context enter composed glyphs anyway instead of 
separate thingies


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] XML export of a lua table

2017-02-23 Thread Peter Rolf
Hi,

what is the easiest way to export a lua table (mostly key-value pairs)
into a XML file? I found 'lxml.save', but no luck with a converter
function. Any help welcome.


Peter

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
Am Thu, 23 Feb 2017 13:19:12 +0100 schrieb Hans Hagen:

> On 2/23/2017 11:58 AM, Ulrike Fischer wrote:
>> When using input like the following with xetex then harfbuzz kicks
>> in and one would always get the good looking precomposed U+1EA0 for
>> the A and the decomposed B+U+0323 for the B.
>>
>> With context (and lualatex) one get a rather bad looking -- as the
>> dot is misplaced -- output for the A0323 input and no output at
>> all for 1e04.
>>
>> As the coverage for precomposed glyphs varies a lot across fonts
>> this is rather a nuisance.  Is there a way to get the fontloader
>> (also the one used by luaotfload) to do a similar substituation as
>> done by harfbuzz?
>>
>> \starttext
>> \catcode`\^= 7
>> Ạ A0323  %decomposed input -> U+1EA0 with xetex
>>
>> Ạ  1ea0  %precomposed input
>>
>>
>> Ḅ B0323  %decomposed input
>>
>> 1e04 %precomposed input -> B+U+0323 with xetex
>>
>>
>> \stoptext
>>
>>
>> (I added the ^^-notation to avoid problems with copy)
> 
> In context one can enable a collapse (last week i found out that it was 
> off by default).
> 
> Anyway, there are two issues here:
> 
> (1) one can in the input stream collapse the dot accent and the other 
> character but of course an altered input might not be what one wants,

No changing the input is imho not a solution as the document fonts
can have different coverage of the glyphs. Whatever is done must be
font dependant. 

> (btw, I suppose that xetex can disable that on demand as from your
> post I deduce that it's default behaviour and fighting defaults
> is a pain).

I don't think that one disable the behaviour in xetex, the internal
harfbuzz library is doing it. There is imho no way to get a
A+combining accent in a document.

I agree that it would be neat to be able to disable it but on the
whole: if I had only the choice between "the xetex-substituation"
and the current luatex/context behaviour I would prefer the first.
For normal documents it is preferable. 

Did you sent the second mail only for me for a reason or did you
only forget to add the list? Imho this is interesting for others
too. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Hans Hagen

On 2/23/2017 11:58 AM, Ulrike Fischer wrote:

When using input like the following with xetex then harfbuzz kicks
in and one would always get the good looking precomposed U+1EA0 for
the A and the decomposed B+U+0323 for the B.

With context (and lualatex) one get a rather bad looking -- as the
dot is misplaced -- output for the A0323 input and no output at
all for 1e04.

As the coverage for precomposed glyphs varies a lot across fonts
this is rather a nuisance.  Is there a way to get the fontloader
(also the one used by luaotfload) to do a similar substituation as
done by harfbuzz?

\starttext
\catcode`\^= 7
Ạ A0323  %decomposed input -> U+1EA0 with xetex

Ạ  1ea0  %precomposed input


Ḅ B0323  %decomposed input

1e04 %precomposed input -> B+U+0323 with xetex


\stoptext


(I added the ^^-notation to avoid problems with copy)


In context one can enable a collapse (last week i found out that it was 
off by default).


Anyway, there are two issues here:

(1) one can in the input stream collapse the dot accent and the other 
character but of course an altered input might not be what one wants, 
for instance because fonts fonts not always provide a decompose (ccmp) 
or composed glyphs


(2) one can mess at the node list level which has a potyential drawback 
that one cannot get a character (explicit \char) there without the 
danger of it being mangled


so, whatever method one chooses, it has to be controlled because in tex 
all is about control (think of verbatim)


I have a file here that implements a pseudo feature that does this kind 
of (trivial) magic and I can add that to the distribution. (btw, I 
suppose that xetex can disable that on demand as from your post I deduce 
that it's default behaviour and fighting defaults is a pain).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] decomposed and precomposde glyphs

2017-02-23 Thread Ulrike Fischer
When using input like the following with xetex then harfbuzz kicks
in and one would always get the good looking precomposed U+1EA0 for
the A and the decomposed B+U+0323 for the B.

With context (and lualatex) one get a rather bad looking -- as the
dot is misplaced -- output for the A0323 input and no output at
all for 1e04. 

As the coverage for precomposed glyphs varies a lot across fonts
this is rather a nuisance.  Is there a way to get the fontloader
(also the one used by luaotfload) to do a similar substituation as
done by harfbuzz?

\starttext
\catcode`\^= 7
Ạ A0323  %decomposed input -> U+1EA0 with xetex

Ạ  1ea0  %precomposed input 


Ḅ B0323  %decomposed input

1e04 %precomposed input -> B+U+0323 with xetex


\stoptext


(I added the ^^-notation to avoid problems with copy) 

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Purpose/use of loadsetup interface *.xml files

2017-02-23 Thread Stephen Gaito
Hello,

Problem:


I am having trouble getting a simple module's documentation to
load setup information.

Question:
-

Where can I find up-to-date documentation on the load setup
interface file use and required format?

Background:
--

I have a current standalone ConTeXt installation with only luatex(mkiv)
and all modules (updated yesterday).

I intend to write a number of ConTeXt modules to assist in my work.

My first module is ConTests a simple wrapper around lua's lunatest
framework. ( GitHub: stephengaito/ConTests )

As I work I like to write unit-tests and documentation
concurrently with the code itself (as much as possible).

I am basing my documentation effort on t-fancybreak.mkvi. As such I
have written a setup interface file t-contests.xml.

My directory structure is:

  t-contests/tex/context/interface/third/t-contests.xml
  t-contests/tex/context/third/ConTests/t-contests.mkiv
  t-contests/tex/context/third/ConTests/t-contests.lua

I am building my module documentation using:

  mtxrun --script modules --process t-contexts.mkiv

(inside the t-contests/tex/context/third/ConTests directory).

The resluting t-contests-mkiv.pdf file has 'MISSING SETUP' where I
would expect the \showsetup{loadSuite} output to be placed.

The mtxrun log output has the line:

  xml > core > load error in [id: setups:, file: .xml]:  empty xml file

I interpret this to mean that my interface file was not found (or
possibly not correctly specified).

The relevant contents of t-contests.mkiv are:

%M \usemodule[contests]
%M \loadsetups[t-contests.xml]

\writestatus{loading}{ConTeXt User Module / ConTests}

%D \subject{Implementation}

\unprotect

\ctxloadluafile{t-contests}

%D \macros{loadSuite}
%D
%D \showsetup{loadSuite}

\def\loadSuite#1{\directlua{thirddata.contests.lunatest.loadSuite('#1.lua')}}

\protect \endinput
-

The contents of t-contests.xml is:
--





http://www.pragma-ade.com/commands; name="context" 
language="en" version="2010.06.21">


  
 
  
  

  

  

-

Any and all assistance would be greatly appreciated.

Regards,
Stephen Gaito
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___