Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-16 Thread Sergey Slyusarev
> the (subtle) difference between the two [*MPinclusions and 
> **MPinitializations*] is not a bug but a feature

If I understood correctly, *MPinitializations affects everything and
can't be assigned to a specific instance (or can it?),
in some cases (like mine) this difference is not so subtle.

Look at the following example (not so minimal):

\startMPinitializations

picture p;

p := image(

draw fullsquare scaled 1cm;

draw textext("1");

);

\stopMPinitializations

\startMPinitializations

picture s;

s := image(

draw (fullsquare rotated 45) scaled 1cm;

draw textext("2");

);

\stopMPinitializations

\defineMPinstance[foo][initializations=yes]

\startMPcode{foo}

picture q;

q := image(

draw fullcircle scaled 1cm;

draw textext("3");

);

draw q;

\stopMPcode

\startMPcode{foo}

draw p;

draw q shifted (2cm, 0);

draw s shifted (4cm, 0);

\stopMPcode

\defineMPinstance[bar][initializations=yes]

\startMPcode{bar}

picture r;

r := image(

draw fullcircle scaled 1cm;

draw textext("4");

);

draw r;

\stopMPcode

\startMPcode{bar}

draw p;

draw r shifted (2cm, 0);

draw s shifted (4cm, 0);

\stopMPcode


First, it shows why *MPinitializations can't replace *MPinclusions for me
(it affects all instances),

and second, it silently produces produces some really unexpected results:

It looks like it should produce (by line)

A circle with "3" inside (yes)

A square with "1" inside (yes); A circle with "3" inside again (no, instead
it produces circle with "2" inside); A rhombus with "2" inside (no, instead
it produces a rhombus with "1")

and so on.

(tested on http://live.contextgarden.net/)

In fact, I failed to declare picture variable inside with text inside one
*MPcode environment and pass it to another safely

(text either disappears or changes to other text, and this time ConTeXt
returns no error), that surely is a bug?


Sergey
___
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] Displayed formula inside paragraph change vertical space before the paragraph

2017-01-16 Thread Hans Hagen

On 1/16/2017 11:27 PM, Jeong Dal wrote:


If I remove either “%” or the formula, then the output looks fine.


indeed, some subtle end-par-too-late-then-and-grouping issue

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] Displayed formula inside paragraph change vertical space before the paragraph

2017-01-16 Thread Jeong Dal
Dear Mikael,

 I didn’t see any problem which you mentioned when I run it under the ConTeXt 
version 2016.10. 6 MKIV beta.
But I saw a change the vertical space when I run it under ConTeXt version 2016. 
12. 28 MKIV beta after updated the bata.

I tested in several ways and found that the vertical space is narrow only in 
the following case:

Bla bla bla bla bla bla bla bla bla
%
\startformula
k>1000\implies |1/k-0|=1/k<1/1000=0.001.
\stopformula

Bla bla bla bla bla bla bla bla bla

If I remove either “%” or the formula, then the output looks fine.

As Otaired said it is better to open a new thread.

Best regards,

Dalyoung


> Maybe you should open a new thread with a title like « Bug in vertical 
> spacing of paragraphs » so that Hans may see it more easily.
> 
> Best regards: OK

___
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] Displayed formula inside paragraph change vertical space before the paragraph

2017-01-16 Thread Hans Hagen

On 1/16/2017 12:56 PM, Otared Kavian wrote:

Hi Mikael,

Thanks for making it clear to me: I was looking for the changes in vertical 
spacing around the formula… Now it is clear that there is a bug in the vertical 
spacing: when I typeset your example with mkii or mkiv ConTeXt Version 
2016.05.17 from TeXLive, the issue is not present, as one may see from the 
attached output.

Maybe you should open a new thread with a title like « Bug in vertical spacing 
of paragraphs » so that Hans may see it more easily.


fixed in next beta

-
  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] scancsv module and lua

2017-01-16 Thread DesdeChaves
Fixed. Sorry for the noise.

2017-01-16 17:35 GMT+00:00 DesdeChaves :

> Dear sirs,
>
> In my project I need to format some data from a csv file. The csv file is
> scanned using the scancsv module and part of this information is formatted
> inside luacode environment, but the text.print("") and the  context("")
>  functions don´t be able to send the formatted data to the output. The
> result is a empty pdf.
>
> The example attached is from a old question.
>
> Thanks a lot for your time
>
> Jorge M.
>
> --- example --
>
> \usemodule[scancsv]
>
> \def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
> \startlua
>  local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
>  local day=tonumber(parsedate[1]);
>  local month=tonumber(parsedate[2]);
>  local year=tonumber(parsedate[3]);
> -- tex.print(day..'#3'..month..'#3'..year);
>  text.print("Hello");
> \stoplua
> }
>
> \unexpanded\def\lineaction{
>  \Name\ arrived on \ddmm{\Date}{/}{.\\,} \\
> }
>
>
> % Name;Date
> % ME;11/10/14
> % You;05/02/14
> % He;15/02/2014
> % She;03/03/12
> % It;03/03/14
>
> \setheader
>   \setsep{;}
>   \setfiletoscan{mail.csv}
>
> \starttext
> \filelineaction
> \stoptext
>



-- 
Atentamente

DesdeChaves
___
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] scancsv module and lua

2017-01-16 Thread DesdeChaves
Dear sirs,

In my project I need to format some data from a csv file. The csv file is
scanned using the scancsv module and part of this information is formatted
inside luacode environment, but the text.print("") and the  context("")
 functions don´t be able to send the formatted data to the output. The
result is a empty pdf.

The example attached is from a old question.

Thanks a lot for your time

Jorge M.

--- example --

\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
 local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
 local day=tonumber(parsedate[1]);
 local month=tonumber(parsedate[2]);
 local year=tonumber(parsedate[3]);
-- tex.print(day..'#3'..month..'#3'..year);
 text.print("Hello");
\stoplua
}

\unexpanded\def\lineaction{
 \Name\ arrived on \ddmm{\Date}{/}{.\\,} \\
}


% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14

\setheader
  \setsep{;}
  \setfiletoscan{mail.csv}

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

Re: [NTG-context] Displayed formula inside paragraph change vertical space before the paragraph

2017-01-16 Thread Otared Kavian
Hi Mikael,

Thanks for making it clear to me: I was looking for the changes in vertical 
spacing around the formula… Now it is clear that there is a bug in the vertical 
spacing: when I typeset your example with mkii or mkiv ConTeXt Version 
2016.05.17 from TeXLive, the issue is not present, as one may see from the 
attached output.

Maybe you should open a new thread with a title like « Bug in vertical spacing 
of paragraphs » so that Hans may see it more easily.

Best regards: OK



formula-vertical-distance-2016-05-17.pdf
Description: Adobe PDF document




formula-vertical-distance-2016-12-28.pdf
Description: Adobe PDF document


> On 16 Jan 2017, at 11:12, Mikael P. Sundqvist  wrote:
> 
> On Mon, Jan 16, 2017 at 10:51 AM, Otared Kavian  wrote:
>> Hi Mikael,
>> 
>> To make sure we are talking about the same issue, here are the outputs 
>> obtained with and without blank lines around \startformula…\stopformula: Can 
>> you please send me too your outputs so I can compare with mines?
>> 
>> Best regards: OK
>> 
>> 
>> 
>> 
>>> On 15 Jan 2017, at 19:29, Mikael P. Sundqvist  wrote:
>>> 
>>> On Sat, Jan 14, 2017 at 8:32 AM, Mikael P. Sundqvist  
>>> wrote:
 On Sat, Jan 14, 2017 at 1:00 AM, Otared Kavian  wrote:
> Hi Mikael,
> 
> I tested your example but I see no difference in the outputs, with, or 
> without a blank line between the text and the displayed formula.
> I am using ConteXt 2016.12.28 17:55 MKIV beta.
> 
> Best regards: OK
> 
>> On 13 Jan 2017, at 14:13, Mikael P. Sundqvist  wrote:
>> 
>> Dear list,
>> 
>> please have a look at the output (ctx-example13.pdf) of the somewhat
>> ugly example below. The vertical space before the paragraph with the
>> displayed formula is almost none. If I remove the % signs before and
>> after the formula, the space before the paragraph looks ok.
>> 
>> Do I have to enter those empty lines? Is this a bug or feature?
>> 
>> (I use a recently updated standalone)
>> 
>> /Mikael
>> 
>> \starttext
>> 
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> 
>> 
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> 
>> 
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> %
>> \startformula
>> k>1000\implies |1/k-0|=1/k<1/1000=0.001.
>> \stopformula
>> %
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> Bla bla bla bla bla bla bla bla bla
>> 
>> 
>> \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://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
> ___
 
 Thank you for testing, Otared.
 
 I still have the same problem with a freshly installed
 
 ConTeXt  ver: 2016.12.28 17:55 MKIV beta  fmt: 2017.1.14  int: 
 english/english
 
 /Mikael
>>> 
>>> Am I the only one affected by this? Can someone confirm that they see
>>> the same problem?
>>> 
>>> Thanks,
>>> 
>>> Mikael
>>> ___
>>> If your question is of interest to 

Re: [NTG-context] Displayed formula inside paragraph change vertical space before the paragraph

2017-01-16 Thread Mikael P. Sundqvist
On Mon, Jan 16, 2017 at 10:51 AM, Otared Kavian  wrote:
> Hi Mikael,
>
> To make sure we are talking about the same issue, here are the outputs 
> obtained with and without blank lines around \startformula…\stopformula: Can 
> you please send me too your outputs so I can compare with mines?
>
> Best regards: OK
>
>
>
>
>> On 15 Jan 2017, at 19:29, Mikael P. Sundqvist  wrote:
>>
>> On Sat, Jan 14, 2017 at 8:32 AM, Mikael P. Sundqvist  
>> wrote:
>>> On Sat, Jan 14, 2017 at 1:00 AM, Otared Kavian  wrote:
 Hi Mikael,

 I tested your example but I see no difference in the outputs, with, or 
 without a blank line between the text and the displayed formula.
 I am using ConteXt 2016.12.28 17:55 MKIV beta.

 Best regards: OK

> On 13 Jan 2017, at 14:13, Mikael P. Sundqvist  wrote:
>
> Dear list,
>
> please have a look at the output (ctx-example13.pdf) of the somewhat
> ugly example below. The vertical space before the paragraph with the
> displayed formula is almost none. If I remove the % signs before and
> after the formula, the space before the paragraph looks ok.
>
> Do I have to enter those empty lines? Is this a bug or feature?
>
> (I use a recently updated standalone)
>
> /Mikael
>
> \starttext
>
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
>
>
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
>
>
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> %
> \startformula
> k>1000\implies |1/k-0|=1/k<1/1000=0.001.
> \stopformula
> %
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
> Bla bla bla bla bla bla bla bla bla
>
>
> \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://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
 ___
>>>
>>> Thank you for testing, Otared.
>>>
>>> I still have the same problem with a freshly installed
>>>
>>> ConTeXt  ver: 2016.12.28 17:55 MKIV beta  fmt: 2017.1.14  int: 
>>> english/english
>>>
>>> /Mikael
>>
>> Am I the only one affected by this? Can someone confirm that they see
>> the same problem?
>>
>> Thanks,
>>
>> Mikael
>> ___
>> 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] Displayed formula inside paragraph change vertical space before the paragraph

2017-01-16 Thread Otared Kavian
Hi Mikael,

To make sure we are talking about the same issue, here are the outputs obtained 
with and without blank lines around \startformula…\stopformula: Can you please 
send me too your outputs so I can compare with mines?

Best regards: OK


formula-vertical-distance-with.pdf
Description: Adobe PDF document



formula-vertical-distance-without.pdf
Description: Adobe PDF document

> On 15 Jan 2017, at 19:29, Mikael P. Sundqvist  wrote:
> 
> On Sat, Jan 14, 2017 at 8:32 AM, Mikael P. Sundqvist  wrote:
>> On Sat, Jan 14, 2017 at 1:00 AM, Otared Kavian  wrote:
>>> Hi Mikael,
>>> 
>>> I tested your example but I see no difference in the outputs, with, or 
>>> without a blank line between the text and the displayed formula.
>>> I am using ConteXt 2016.12.28 17:55 MKIV beta.
>>> 
>>> Best regards: OK
>>> 
 On 13 Jan 2017, at 14:13, Mikael P. Sundqvist  wrote:
 
 Dear list,
 
 please have a look at the output (ctx-example13.pdf) of the somewhat
 ugly example below. The vertical space before the paragraph with the
 displayed formula is almost none. If I remove the % signs before and
 after the formula, the space before the paragraph looks ok.
 
 Do I have to enter those empty lines? Is this a bug or feature?
 
 (I use a recently updated standalone)
 
 /Mikael
 
 \starttext
 
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 
 
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 
 
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 %
 \startformula
 k>1000\implies |1/k-0|=1/k<1/1000=0.001.
 \stopformula
 %
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 Bla bla bla bla bla bla bla bla bla
 
 
 \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://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
>>> ___
>> 
>> Thank you for testing, Otared.
>> 
>> I still have the same problem with a freshly installed
>> 
>> ConTeXt  ver: 2016.12.28 17:55 MKIV beta  fmt: 2017.1.14  int: 
>> english/english
>> 
>> /Mikael
> 
> Am I the only one affected by this? Can someone confirm that they see
> the same problem?
> 
> Thanks,
> 
> Mikael
> ___
> 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
___