Re: [NTG-context] Some Metapost Problems

2008-10-08 Thread Taco Hoekwater


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
___


Re: [NTG-context] Some Metapost Problems

2008-10-08 Thread Wolfgang Werners-Lucchini
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
___


Re: [NTG-context] Some Metapost Problems

2008-10-08 Thread Taco Hoekwater


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
___


Re: [NTG-context] Some Metapost Problems

2008-10-07 Thread Wolfgang Werners-Lucchini
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
___


Re: [NTG-context] Some Metapost Problems

2008-10-07 Thread Mojca Miklavec
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
___


Re: [NTG-context] Some Metapost Problems

2008-10-06 Thread Mojca Miklavec
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
___