[NTG-context] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
> On 24 Apr 2020, at 18:40, Thomas A. Schmitz  > wrote:
> 
> 
> 
>> On 24. Apr 2020, at 18:19, Gerben Wierda > > wrote:
>> 
>> \starttext
>> 
>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>  g=0.000,
>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
>> [My]\\Application\\(Component)}}
>> 
>> \stoptext
>> 
>> and if I change the value to 0.6, only the first line break gets packed 
>> somewhat. But I can’t get the entire paragraph inside the frame packed. I 
>> played around with the placing of setupinterlinespace in that snippet above, 
>> but nothing really works so far.
>> 
> 
> At the end of your frame, you need an explicit \par to make the change of 
> linespacing work:
> 
> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000,
> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm 
> [My]\\Application\\(Component)\par }}

Thank you, that works. (Can’t put in the images to show, as this gets my 
message over 100k)

But it turns out, I have an additional problem because I am doing this inside a 
textext() from METAPOST and that seems to strip the \pars again. Tracking 
ConTeXt:

cld > tex > f : 8 : picture pic; x:=33.000; y:=53.000; w:=133.000; 
h:=53.000;pic := ApplicationComponentLogo( w, h, (0.686,1.000,1.000), 0.200, 
1.000, (0.000,0.000,0.000), 1.000, 0.700, (0.000,0.000,0.000), 1.000, 
"\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw pic;path 
AllNodeIds_idIC;  AllNodeIds_idIC := pathpart pic; pair AllNodeCenters_idIC; 
AllNodeCenters_idIC := center pic;

which looks OK (this is lmtx passing the string to ConTeXt using the lua 
context() call). The \pars are still there.

Then later, when METAPOST is at it and that same string is used to put into 
textext(), it results in:

cld > tex > w : - : \MPLIBsetNtextX{3}{\framed 
[align=flushright,frame=on,offset=none,width=106.400bp]{\colored [r=0.000, 
g=0.000, b=0.000]{\switchtobodyfont [11.0pt]\setupinterlinespace [11.5pt] \rm 
[My]\\Application\\(Component)}}}


Minimal example:

\enabletrackers[context.trace]
\starttext

% Works OK:
\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000,
b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}

% Doesn’t work:
\startMPpage[instance=doublefun]
draw 
textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par");
\stopMPpage


\stoptext

So, now I’m looking for a way to prevent textext() to eat my \pars

G

___
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] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda


> On 24 Apr 2020, at 18:40, Thomas A. Schmitz  > wrote:
> 
> 
> 
>> On 24. Apr 2020, at 18:19, Gerben Wierda > > wrote:
>> 
>> \starttext
>> 
>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>  g=0.000,
>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
>> [My]\\Application\\(Component)}}
>> 
>> \stoptext
>> 
>> and if I change the value to 0.6, only the first line break gets packed 
>> somewhat. But I can’t get the entire paragraph inside the frame packed. I 
>> played around with the placing of setupinterlinespace in that snippet above, 
>> but nothing really works so far.
>> 
> 
> At the end of your frame, you need an explicit \par to make the change of 
> linespacing work:
> 
> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000,
> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm 
> [My]\\Application\\(Component)\par }}

Thank you, that works: 



But it turns out, I have an additional problem because I am doing this inside a 
textext() from METAPOST and that seems to strip the \pars again. Tracking 
ConTeXt:

cld > tex > f : 8 : picture pic; x:=33.000; y:=53.000; w:=133.000; 
h:=53.000;pic := ApplicationComponentLogo( w, h, (0.686,1.000,1.000), 0.200, 
1.000, (0.000,0.000,0.000), 1.000, 0.700, (0.000,0.000,0.000), 1.000, 
"\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw pic;path 
AllNodeIds_idIC;  AllNodeIds_idIC := pathpart pic; pair AllNodeCenters_idIC; 
AllNodeCenters_idIC := center pic;

which looks OK (this is lmtx passing the string to ConTeXt using the lua 
context() call). The \pars are still there.

Then later, when METAPOST is at it and that same string is used to put into 
textext(), it results in:

cld > tex > w : - : \MPLIBsetNtextX{3}{\framed 
[align=flushright,frame=on,offset=none,width=106.400bp]{\colored [r=0.000, 
g=0.000, b=0.000]{\switchtobodyfont [11.0pt]\setupinterlinespace [11.5pt] \rm 
[My]\\Application\\(Component)}}}

The result of which is



Minimal example:

\enabletrackers[context.trace]
\starttext

% Works OK:
\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000,
b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}

% Doesn’t work:
\startMPpage[instance=doublefun]
draw 
textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par");
\stopMPpage


\stoptext

So, now I’m looking for a way to prevent textext() to eat my \pars

G___
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] metapost textext?

2005-12-22 Thread Hans van der Meer

I have another piece of information on my previous posting.
When I take the mpgraph mp-input for metapost produced by the ConTeXt  
run I see:


(1) running system(mpost  -progname=mpost -mem=metafun standalone2- 
mpgraph)...executed. as the log shows gives the wrong metafont  
output. I also ran mpost with those parameters standalone on that mp- 
file and got the same bad result.


(2) running texexec --mptex on the file gives the correct result.

Would this help locating the problem?
My mpost is according to mpout.log This is MetaPost, Version 0.901  
(Web2C 7.5.3) (mem=mpost 2005.11.12).


yours sincerely,
dr. H. van der Meer



On Dec 21, 2005, at 18:24, Taco Hoekwater wrote:


Peter Rolf wrote:

Hans Hagen wrote:

Hans van der Meer wrote:



Panic using metapost in context.
This used to work. I did a file that previously  
(\thisisutilityversion
{1998.12.20}) had good output but now has unknown everywhere  
for textext calls!


\starttext
\startuseMPgraphic{one}
   draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)-- 
(0,0);

   label (textext(label), (10,25));
\stopuseMPgraphic
\useMPgraphic{one}
\stoptext

But now I see unknown as the text typeset instead of label!
What happened. This is disastrous.


this normally points to an error in mp processing (unknown is the  
fall

back text), not so much to something wrong with context (i hope)

it runs ok here; how does it runs at other machines?


no problem here (using latest version)


Runs without problems here as well. The most likely cause of problems
in this subsystem nowadays is a
  format was written by (pdf)(e)tex
error message from a (pdf)(e)tex executable. Unfortunately, I also
find it hard to trace this stuff. It may help to run the example
in an isolated directory and zipmail everything in the directory
afterwards. I can at least have a look, but cannot give guarantees.

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] metapost textext?

2005-12-21 Thread Hans van der Meer

Panic using metapost in context.
This used to work. I did a file that previously (\thisisutilityversion 
{1998.12.20}) had good output but now has unknown everywhere for  
textext calls!


\starttext
\startuseMPgraphic{one}
draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)--(0,0);
label (textext(label), (10,25));
\stopuseMPgraphic
\useMPgraphic{one}
\stoptext

But now I see unknown as the text typeset instead of label!
What happened. This is disastrous.

yours sincerely,
dr. H. van der Meer



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metapost textext?

2005-12-21 Thread Hans Hagen

Hans van der Meer wrote:


Panic using metapost in context.
This used to work. I did a file that previously (\thisisutilityversion 
{1998.12.20}) had good output but now has unknown everywhere for  
textext calls!


\starttext
\startuseMPgraphic{one}
draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)--(0,0);
label (textext(label), (10,25));
\stopuseMPgraphic
\useMPgraphic{one}
\stoptext

But now I see unknown as the text typeset instead of label!
What happened. This is disastrous.


this normally points to an error in mp processing (unknown is the fall 
back text), not so much to something wrong with context (i hope)


it runs ok here; how does it runs at other machines?

(this intermediate mp runnig tex is a kind of messy mp feature and 
errors are hard to trace)


Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metapost textext?

2005-12-21 Thread Peter Rolf
Hans Hagen wrote:
 Hans van der Meer wrote:
 
 Panic using metapost in context.
 This used to work. I did a file that previously (\thisisutilityversion
 {1998.12.20}) had good output but now has unknown everywhere for 
 textext calls!

 \starttext
 \startuseMPgraphic{one}
 draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)--(0,0);
 label (textext(label), (10,25));
 \stopuseMPgraphic
 \useMPgraphic{one}
 \stoptext

 But now I see unknown as the text typeset instead of label!
 What happened. This is disastrous.
 
 this normally points to an error in mp processing (unknown is the fall
 back text), not so much to something wrong with context (i hope)
 
 it runs ok here; how does it runs at other machines?

no problem here (using latest version)

Peter

 (this intermediate mp runnig tex is a kind of messy mp feature and
 errors are hard to trace)
 
 Hans
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context
 
 

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metapost textext?

2005-12-21 Thread Taco Hoekwater

Peter Rolf wrote:

Hans Hagen wrote:


Hans van der Meer wrote:



Panic using metapost in context.
This used to work. I did a file that previously (\thisisutilityversion
{1998.12.20}) had good output but now has unknown everywhere for 
textext calls!


\starttext
\startuseMPgraphic{one}
   draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)--(0,0);
   label (textext(label), (10,25));
\stopuseMPgraphic
\useMPgraphic{one}
\stoptext

But now I see unknown as the text typeset instead of label!
What happened. This is disastrous.


this normally points to an error in mp processing (unknown is the fall
back text), not so much to something wrong with context (i hope)

it runs ok here; how does it runs at other machines?



no problem here (using latest version)



Runs without problems here as well. The most likely cause of problems
in this subsystem nowadays is a
  format was written by (pdf)(e)tex
error message from a (pdf)(e)tex executable. Unfortunately, I also
find it hard to trace this stuff. It may help to run the example
in an isolated directory and zipmail everything in the directory
afterwards. I can at least have a look, but cannot give guarantees.

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metapost textext?

2005-12-21 Thread David Arnold

Runs OK here as well.

Got a little graphic with the word label in it.

chapter3 $ texexec --version

TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

   texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
   texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
   tex : pdfeTeX, 3.141592-1.30.4-2.2 (Web2C 7.5.5)
   context : ver: 2005.12.01
   cont-en : ver: 2005.12.01  fmt: 2005.12.2  mes: english
   cont-nl : ver: 2005.12.01  fmt: 2005.12.2  mes: dutch

total run time : 2 seconds


On Dec 21, 2005, at 8:13 AM, Hans van der Meer wrote:


Panic using metapost in context.
This used to work. I did a file that previously  
(\thisisutilityversion{1998.12.20}) had good output but now has  
unknown everywhere for textext calls!


\starttext
\startuseMPgraphic{one}
draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)--(0,0);
label (textext(label), (10,25));
\stopuseMPgraphic
\useMPgraphic{one}
\stoptext

But now I see unknown as the text typeset instead of label!
What happened. This is disastrous.

yours sincerely,
dr. H. van der Meer



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metapost textext?

2005-12-21 Thread Willi Egger

Hi,

this code compiles without problems on a Windows-XP machine with:
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
ConTeXt  ver: 2005.11.30  fmt: 2005.12.19  int: english  mes: english

Willi

Hans Hagen wrote:


Hans van der Meer wrote:


Panic using metapost in context.
This used to work. I did a file that previously 
(\thisisutilityversion {1998.12.20}) had good output but now has 
unknown everywhere for  textext calls!


\starttext
\startuseMPgraphic{one}
draw (0,0)--(100,0)--(100,50)--(50,50)--(50,100)--(0,100)--(0,0);
label (textext(label), (10,25));
\stopuseMPgraphic
\useMPgraphic{one}
\stoptext

But now I see unknown as the text typeset instead of label!
What happened. This is disastrous.



this normally points to an error in mp processing (unknown is the fall 
back text), not so much to something wrong with context (i hope)


it runs ok here; how does it runs at other machines?

(this intermediate mp runnig tex is a kind of messy mp feature and 
errors are hard to trace)


Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context