ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Some Metapost Problems
       [not found] <mailman.5393.1223355310.4320.ntg-context@ntg.nl>
@ 2008-10-07 19:54 ` Wolfgang Werners-Lucchini
  2008-10-07 21:38   ` Mojca Miklavec
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Werners-Lucchini @ 2008-10-07 19:54 UTC (permalink / raw)
  To: ntg-context

Hallo Mojca,

> > 1. The labels of the first graphic are xscaled (randomly)
> 
> They are not scaled randomly :P
> They inherit the sizes from the second graphic.
> 
> See
>    
> http://archive.contextgarden.net/message/20061204.102337.280a6589.en
> .html

strange

> You need
>     \runMPgraphicstrue

Yes, this helps! 

But what are the sideeffects? When is the opposite needed? 

> These settings are used exclusevely for btex ... etex and textext.
> \sometxt uses the surounding font.
> 
> There could be some settings for fonts in metapost graphics, but
> I'm not aware of any.
> However, it's rather easy to either:
> 
> a) write your own metapost macro for placing labels that scales
> down
> everything by 20%
>     label.top(myscaled(\sometxt{Samstag}), z0) ;
> where
>     vardef myscaled(expr t) = (t scaled 0.8) enddef;

This works.

> b) write your own handle
>     \definetextext[scaled]{\switchtobodyfont[8pt]\strut}
> and then
>     label.top(\sometxt[scaled]{Samstag}, z0) ;

This works, too. Where is this documented?
 
> c) write your own macro or put some font size switch in front of
> the graphic (I did not try it out)
> \long\def\startuseMPgraphicwithscaledtext#1\stopuseMPgraphicwithscal
> edtext
> {\bgroup\switchtobodyfont[8pt]\startuseMPgraphic#1\stopuseMPgraphic\
> egroup}

This is not working. 
Even an explizit

{\switchtobodyfont[8pt]
\startuseMPgraphic

<mp-code>

\stopuseMPgraphic
}

didn't work.

I will use one of the other solutions. Thank you very much!

Wolfgang

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


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

* Re: Some Metapost Problems
  2008-10-07 19:54 ` Some Metapost Problems Wolfgang Werners-Lucchini
@ 2008-10-07 21:38   ` Mojca Miklavec
  2008-10-08  7:35     ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Mojca Miklavec @ 2008-10-07 21:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Oct 7, 2008 at 9:54 PM, Wolfgang Werners-Lucchini wrote:
> Hallo Mojca,
>
>> > 1. The labels of the first graphic are xscaled (randomly)
>>
>> They are not scaled randomly :P
>> They inherit the sizes from the second graphic.
>>
>> See
>>
>> http://archive.contextgarden.net/message/20061204.102337.280a6589.en
>> .html
>
> strange
>
>> You need
>>     \runMPgraphicstrue
>
> Yes, this helps!
>
> But what are the sideeffects? When is the opposite needed?

I don't know. Ask Hans or Taco. It might have to do with write18
(perhaps when it's desabled, one of them doesn't work, but I don't
really know).

>> These settings are used exclusevely for btex ... etex and textext.
>> \sometxt uses the surounding font.
>>
>> There could be some settings for fonts in metapost graphics, but
>> I'm not aware of any.
>> However, it's rather easy to either:
>>
>> a) write your own metapost macro for placing labels that scales
>> down
>> everything by 20%
>>     label.top(myscaled(\sometxt{Samstag}), z0) ;
>> where
>>     vardef myscaled(expr t) = (t scaled 0.8) enddef;
>
> This works.
>
>> b) write your own handle
>>     \definetextext[scaled]{\switchtobodyfont[8pt]\strut}
>> and then
>>     label.top(\sometxt[scaled]{Samstag}, z0) ;
>
> This works, too. Where is this documented?

The \sometxt myway (http://wiki.contextgarden.net/My_Way).

>> c) write your own macro or put some font size switch in front of
>> the graphic (I did not try it out)
>> \long\def\startuseMPgraphicwithscaledtext#1\stopuseMPgraphicwithscal
>> edtext
>> {\bgroup\switchtobodyfont[8pt]\startuseMPgraphic#1\stopuseMPgraphic\
>> egroup}
>
> This is not working.
> Even an explizit
>
> {\switchtobodyfont[8pt]
> \startuseMPgraphic
>
> <mp-code>
>
> \stopuseMPgraphic
> }
>
> didn't work.

Try:

\switchtobodyfont[50pt]
\startMPcode
draw \sometxt{abc};
\stopMPcode

Maybe the labels are typeset when you \useMPgraphic, not when you
define it (but better have the sizes kept in sync).

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Some Metapost Problems
  2008-10-07 21:38   ` Mojca Miklavec
@ 2008-10-08  7:35     ` Taco Hoekwater
  0 siblings, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2008-10-08  7:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Mojca Miklavec wrote:
>>
>>> You need
>>>     \runMPgraphicstrue
>> Yes, this helps!
>>
>> But what are the sideeffects? When is the opposite needed?

\runMPgraphicfalse is faster when you need two tex runs anyway,
because it collects all the graphics in a single metapost run
which is a more efficient way of generating the graphics (in mkii),
that is its reason for existence. But sometimes it doesn't work,
so having \runMPgraphicstrue in your cont-usr.tex is not a bad idea.

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Some Metapost Problems
  2008-10-08 13:02 ` Wolfgang Werners-Lucchini
@ 2008-10-08 13:34   ` Taco Hoekwater
  0 siblings, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2008-10-08 13:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Wolfgang Werners-Lucchini wrote:
> 
> I did this, but 'cont-usr.tex' is never included (windows minimal).

cont-usr is read by texexec --make (at format generation time)

> The file 'core-job.tex' should do this but it is itself not included.

but it does (at format generation time)

> 'cont-sys.tex' has a commented entry
> \runMPgraphicstrue
> uncommenting this works.

yes, that is fine also

> There is also a variable \runMPTEXgraphicstrue.
> What is this for? Should this be uncommented, too?

I think so, yes.  (iirc, this is for textext() in mkii)

> Will this be overwritten with the next update?

No, cont-sys.tex is never distributed

Best wishes,
Taco

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Some Metapost Problems
       [not found] <mailman.5483.1223452260.4320.ntg-context@ntg.nl>
@ 2008-10-08 13:02 ` Wolfgang Werners-Lucchini
  2008-10-08 13:34   ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Werners-Lucchini @ 2008-10-08 13:02 UTC (permalink / raw)
  To: ntg-context

Hallo, 

> Mojca Miklavec wrote:
> >>
> >>> You need
> >>>     \runMPgraphicstrue
> >> Yes, this helps!
> >>
> >> But what are the sideeffects? When is the opposite needed?
> 
> \runMPgraphicfalse is faster when you need two tex runs anyway,
> because it collects all the graphics in a single metapost run
> which is a more efficient way of generating the graphics (in
> mkii),
> that is its reason for existence. But sometimes it doesn't work,
> so having \runMPgraphicstrue in your cont-usr.tex is not a bad
> idea.

I did this, but 'cont-usr.tex' is never included (windows minimal).
The file 'core-job.tex' should do this but it is itself not included.

Is 'core-job.tex' not needed?

'cont-sys.tex' has a commented entry
\runMPgraphicstrue
uncommenting this works.

There is also a variable \runMPTEXgraphicstrue.
What is this for? Should this be uncommented, too?

Will this be overwritten with the next update?

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


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

* Re: Some Metapost Problems
  2008-10-05 18:03 Wolfgang Werners-Lucchini
@ 2008-10-06 22:13 ` Mojca Miklavec
  0 siblings, 0 replies; 8+ messages in thread
From: Mojca Miklavec @ 2008-10-06 22:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, Oct 5, 2008 at 8:03 PM, Wolfgang Werners-Lucchini wrote:
> Hallo,
>
> I have a lot of problems with the following example:
> ------------------------------------------------

> \startuseMPgraphic{Wochentage}
...
>  label.top(\sometxt{Samstag}, z0) ;

> 1. The labels of the first graphic are xscaled (randomly)

They are not scaled randomly :P
They inherit the sizes from the second graphic.

See
    http://archive.contextgarden.net/message/20061204.102337.280a6589.en.html

> when the
> second graphic is included. Comment the second, and the first is ok.
> What I am doing wrong here?

You need
    \runMPgraphicstrue

> This seems to be ok with luatex.

LuaTeX is a story on its own. It works differentrly anyway.

> 2. The settings in \startMPenvironment do not use the smaller font
> size [8pt] without [global]. And the outside Text (Bla) remains not
> big [11pt] with [global]. How can I toggle the two sizes differently?

These settings are used exclusevely for btex ... etex and textext.
\sometxt uses the surounding font.

There could be some settings for fonts in metapost graphics, but I'm
not aware of any.
However, it's rather easy to either:

a) write your own metapost macro for placing labels that scales down
everything by 20%
    label.top(myscaled(\sometxt{Samstag}), z0) ;
where
    vardef myscaled(expr t) = (t scaled 0.8) enddef;

b) write your own handle
    \definetextext[scaled]{\switchtobodyfont[8pt]\strut}
and then
    label.top(\sometxt[scaled]{Samstag}, z0) ;

c) write your own macro or put some font size switch in front of the
graphic (I did not try it out)
\long\def\startuseMPgraphicwithscaledtext#1\stopuseMPgraphicwithscaledtext
{\bgroup\switchtobodyfont[8pt]\startuseMPgraphic#1\stopuseMPgraphic\egroup}

Disclaimer: I did not try out any of the methods mentioned about, so
it might be that they don't work and need some syntactic changes, but
they should work in principle.

> 3. After editing the mp-code I allways have to purge files between
> two runs. Is this normal?

Probably not, but I somehow got used to run every document twice
before getting the right graphic. It should be fixed, but Hans is
probably focused on mkiv now.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Some Metapost Problems
@ 2008-10-06 21:10 Wolfgang Werners-Lucchini
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Werners-Lucchini @ 2008-10-06 21:10 UTC (permalink / raw)
  To: ntg-context

Hallo,

I have a lot of problems with the following example:
------------------------------------------------
\usetypescriptfile[type-exa]
\usetypescript[iwona][ec]
\setupbodyfont[iwona,11pt]

\startMPenvironment%[global]
\usetypescript[iwona][ec]
\setupbodyfont[iwona,8pt]
\stopMPenvironment

\startuseMPgraphic{Wochentage}
 save x,y ;

 z0 = (3cm,6cm) ;
 for i:=1 upto 6:
  z[i] = z[i-1] rotatedaround((3cm,3cm),720/7) ;
 endfor ;

 label.top(\sometxt{Samstag}, z0) ;
 label.lft(\sometxt{Donnerstag}, z1) ;
 label.lrt(\sometxt{Dienstag}, z2) ;
 label.urt(\sometxt{Sonntag}, z3) ;
 label.ulft(\sometxt{Freitag}, z4) ;
 label.llft(\sometxt{Mittwoch}, z5) ;
 label.rt(\sometxt{Montag}, z6) ;
\stopuseMPgraphic

\startuseMPgraphic{Tierkreis}
 save x,y ;

 z0 = (4cm,8cm) rotatedaround((4cm,4cm),15) ;
 for i:=1 upto 11:
  z[i] = z[i-1] rotatedaround((4cm,4cm),30) ;
 endfor ;

 label.ulft(\sometxt{Zwillinge}, z0) ;
 label.ulft(\sometxt{Stier}, z1) ;
 label.lft(\sometxt{Widder}, z2) ;
 label.lft(\sometxt{Fische}, z3) ;
 label.llft(\sometxt{Wassermann}, z4) ;
 label.llft(\sometxt{Steinbock}, z5) ;
 label.lrt(\sometxt{Schütze}, z6) ;
 label.lrt(\sometxt{Skorpion}, z7) ;
 label.rt(\sometxt{Waage}, z8) ;
 label.rt(\sometxt{Jungfrau}, z9) ;
 label.urt(\sometxt{Löwe}, z[10]) ;
 label.urt(\sometxt{Krebs}, z[11]) ;
\stopuseMPgraphic

\starttext

\useMPgraphic{Wochentage}

Bla

\useMPgraphic{Tierkreis}

\stoptext
------------------------------------------------

1. The labels of the first graphic are xscaled (randomly) when the 
second graphic is included. Comment the second, and the first is ok.
What I am doing wrong here?

This seems to be ok with luatex.

2. The settings in \startMPenvironment do not use the smaller font 
size [8pt] without [global]. And the outside Text (Bla) remains not 
big [11pt] with [global]. How can I toggle the two sizes differently?

3. After editing the mp-code I allways have to purge files between 
two runs. Is this normal?

Thanks for your help

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


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

* Some Metapost Problems
@ 2008-10-05 18:03 Wolfgang Werners-Lucchini
  2008-10-06 22:13 ` Mojca Miklavec
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Werners-Lucchini @ 2008-10-05 18:03 UTC (permalink / raw)
  To: ntg-context

Hallo,

I have a lot of problems with the following example:
------------------------------------------------
\usetypescriptfile[type-exa]
\usetypescript[iwona][ec]
\setupbodyfont[iwona,11pt]

\startMPenvironment%[global]
\usetypescript[iwona][ec]
\setupbodyfont[iwona,8pt]
\stopMPenvironment

\startuseMPgraphic{Wochentage}
 save x,y ;

 z0 = (3cm,6cm) ;
 for i:=1 upto 6:
  z[i] = z[i-1] rotatedaround((3cm,3cm),720/7) ;
 endfor ;

 label.top(\sometxt{Samstag}, z0) ;
 label.lft(\sometxt{Donnerstag}, z1) ;
 label.lrt(\sometxt{Dienstag}, z2) ;
 label.urt(\sometxt{Sonntag}, z3) ;
 label.ulft(\sometxt{Freitag}, z4) ;
 label.llft(\sometxt{Mittwoch}, z5) ;
 label.rt(\sometxt{Montag}, z6) ;
\stopuseMPgraphic

\startuseMPgraphic{Tierkreis}
 save x,y ;

 z0 = (4cm,8cm) rotatedaround((4cm,4cm),15) ;
 for i:=1 upto 11:
  z[i] = z[i-1] rotatedaround((4cm,4cm),30) ;
 endfor ;

 label.ulft(\sometxt{Zwillinge}, z0) ;
 label.ulft(\sometxt{Stier}, z1) ;
 label.lft(\sometxt{Widder}, z2) ;
 label.lft(\sometxt{Fische}, z3) ;
 label.llft(\sometxt{Wassermann}, z4) ;
 label.llft(\sometxt{Steinbock}, z5) ;
 label.lrt(\sometxt{Schütze}, z6) ;
 label.lrt(\sometxt{Skorpion}, z7) ;
 label.rt(\sometxt{Waage}, z8) ;
 label.rt(\sometxt{Jungfrau}, z9) ;
 label.urt(\sometxt{Löwe}, z[10]) ;
 label.urt(\sometxt{Krebs}, z[11]) ;
\stopuseMPgraphic

\starttext

\useMPgraphic{Wochentage}

Bla

\useMPgraphic{Tierkreis}

\stoptext
------------------------------------------------

1. The labels of the first graphic are xscaled (randomly) when the 
second graphic is included. Comment the second, and the first is ok.
What I am doing wrong here?

This seems to be ok with luatex.

2. The settings in \startMPenvironment do not use the smaller font 
size [8pt] without [global]. And the outside Text (Bla) remains not 
big [11pt] with [global]. How can I toggle the two sizes differently?

3. After editing the mp-code I allways have to purge files between 
two runs. Is this normal?

Thanks for your help

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


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

end of thread, other threads:[~2008-10-08 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.5393.1223355310.4320.ntg-context@ntg.nl>
2008-10-07 19:54 ` Some Metapost Problems Wolfgang Werners-Lucchini
2008-10-07 21:38   ` Mojca Miklavec
2008-10-08  7:35     ` Taco Hoekwater
     [not found] <mailman.5483.1223452260.4320.ntg-context@ntg.nl>
2008-10-08 13:02 ` Wolfgang Werners-Lucchini
2008-10-08 13:34   ` Taco Hoekwater
2008-10-06 21:10 Wolfgang Werners-Lucchini
  -- strict thread matches above, loose matches on Subject: below --
2008-10-05 18:03 Wolfgang Werners-Lucchini
2008-10-06 22:13 ` Mojca Miklavec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).