Re: [NTG-context] Problem with \overrightarrow over BC and CB

2013-10-14 Thread Mikael P. Sundqvist
On Mon, Oct 14, 2013 at 12:05 AM, Hans Hagen pra...@wxs.nl wrote:

 On 10/11/2013 9:53 AM, Mikael P. Sundqvist wrote:

 Dear all,

 with the latest beta (and older ones), the following file


 you can control this with

 \setupmathstackers
   [both]
   [hoffset=.5pt]

 granularity might improve over time (as arrows are proper extensibles now)

 (I have no time now to look into more automated threshold adaption)


  %%% start test file
 \definefontfamily [mainface] [serif] [DejaVu Serif]
 \definefontfamily [mainface] [sans]  [DejaVu Sans]
 \definefontfamily [mainface] [mono]  [DejaVu Sans Mono] [feature=none]
 \definefontfamily [mainface] [math]  [TeX Gyre Pagella Math][scale=1..12]


 \setupbodyfont[mainface]

 \starttext
 $
 \overrightarrow{AB}
 \overrightarrow{BA}
 \overrightarrow{AC}
 \overrightarrow{CA}
 \overrightarrow{AD}
 \overrightarrow{DA}
 \overrightarrow{BC}
 \overrightarrow{CB}
 \overrightarrow{BD}
 \overrightarrow{DB}
 \overrightarrow{CD}
 \overrightarrow{DC}
 $
 \stoptext
 %%% end test file

 gives a shorter arrow than expected above BC and CB (but over the other
 ones it is OK).

 Is this a bug in the Pagella math font (it looks OK if one comments out
 the \setupbodyfont[mainface] above)?

 Can it be fixed?

 Best regards, 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 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : 
 http://foundry.supelec.fr/**projects/contextrev/http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __**__**
 ___



 --

 --**--**-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : 
 http://foundry.supelec.fr/**projects/contextrev/http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __**__**
 ___


Thank you Hans, now it looks much better.

I ended up with

\setupmathstackers[both][
 hoffset=.5pt,
 voffset=0pt,
]

which also reduced the vertical space. I have not seen any bad consequences
of this yet.

/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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Using lua with the command line for macros

2013-10-14 Thread Hans Hagen

On 10/14/2013 4:48 AM, Kumar Appaiah wrote:

On Sun, Oct 13, 2013 at 09:31:11PM -0400, Kumar Appaiah wrote:

On Mon, Oct 14, 2013 at 03:17:28AM +0200, luigi scarso wrote:

Have you seen
[2]http://www.pragma-ade.com/general/manuals/cld-mkiv.pdf


No, I haven't seen it. I'll have a close look at it. Thanks for the
pointer.


Well, upon reading the document you suggested, I just realised that I
could work around my issue by creating A.tex and B.tex as follows:

A.tex:
\startluacode
  -- define A's variables
\stopluacode
\input generic

And a similar b.tex. This is more flexible in terms of my
implementation constraints as well.


if you make a file whatever.cld like:

local name = ward.tex

context.starttext()
context.title(name)
context.blank()
context.input(name)
context.stoptext()

you can directly runt it with the context command.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Updated Wiki Mac Installation page

2013-10-14 Thread Keith J. Schultz
Hi Everbody,

I have revised the Mac Installation Page on the wiki.
Critic invited.

I am somewhat uncertain how much I should use the finder or the Terminal.

Discussion invited.

regards
Keith.

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


Re: [NTG-context] Using lua with the command line for macros

2013-10-14 Thread Kumar Appaiah
On Mon, Oct 14, 2013 at 09:47:49AM +0200, Hans Hagen wrote:
 Well, upon reading the document you suggested, I just realised that I
 could work around my issue by creating A.tex and B.tex as follows:
 
 A.tex:
 \startluacode
   -- define A's variables
 \stopluacode
 \input generic
 
 And a similar b.tex. This is more flexible in terms of my
 implementation constraints as well.
 
 if you make a file whatever.cld like:
 
 local name = ward.tex
 
 context.starttext()
 context.title(name)
 context.blank()
 context.input(name)
 context.stoptext()
 
 you can directly runt it with the context command.

Thanks Hans. This is a cleaner solution; I'll adopt it in the next
document I am writing today.

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


[NTG-context] functions and paths in metapost

2013-10-14 Thread Jean Magnan de Bornier
Hello all,

Is it possible to define a path in metapost-metafun using function? In
the metafun manual (chapter on Functions) the examples shown are all of
the type draw function  I wonder if it is possible to define a path
with a function (picture after draw doesn't allow that afaik)?

tia,
(mkiv)
-- 
Jean
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Simplefonts

2013-10-14 Thread Lars Huttar
Hi Wolfgang,

I'm doing an overhaul of font handling in our large project, and
wondering whether I should switch to simplefonts at this point.

Can you tell me, how mature is simplefonts? Is it ready for heavy-duty,
complex production use?

Also, is it superceding the standard ConTeXt font handling? That is,
should I expect to find better help available from this list for issues
with simplefonts? Will new development be focused more on simplefonts?

Thanks,
Lars


On 10/10/2013 2:02 PM, Wolfgang Schuster wrote:
 Hi all,

 I’m happy to announce a new version of the simplefonts code. Thew new version 
 of the code
 is a complete rewrite and brings many changes.

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

Re: [NTG-context] Simplefonts

2013-10-14 Thread Prashanth
Hi Wolfgang,

Thanks for the update. I have a question, and I came across a bug.

Question: I need some keywords in a distinctively different font, which
I accomplished by defining \kword as \definesimplefont[kword][DejaVu
Mono][size=13pt]. I looked through font-sel.mkvi, but I did not see any
way of implementing equivalents. (I still haven't learnt macros
properly, though.) Can you please give me a hint on how I can do this
with the latest fonts interface?

Bug: I prefer Euler font for math. This does not seem to work with the
latest fonts interface.

Best regards,
Prash


On 10/10/13 20:02, Wolfgang Schuster wrote:
 Hi all,

 I’m happy to announce a new version of the simplefonts code. Thew new version 
 of the code
 is a complete rewrite and brings many changes.

 1. The module is now part of the core and no external module is needed 
 anymore.

 2. The commands to select a font have changed to commands which fit better to 
 context normal syntax.

 3. I removed the keys to enable font expansion and protrusion, when you need 
 them use \definefontfeature.


 To use a font with the simplefonts code two ways are available. The first 
 method is to create
 one or more typefaces and load it with \setupbodyfont. A complete example for 
 this is:

 \definefontfamily [mainface] [serif] [DejaVu Serif]
 \definefontfamily [mainface] [sans]  [DejaVu Sans]
 \definefontfamily [mainface] [mono]  [DejaVu Sans Mono] [feature=none]
 \definefontfamily [mainface] [math]  [TeX Gyre Pagella Math]

 \setupbodyfont[mainface]

 \starttext
 \startlines
 \rm DejaVu Serif
 \ss DejaVu Sans
 \tt DejaVu Sans Mono
 \m{c^2 = a^2 + b^2}
 \stoplines
 \stoptext


 The second method is similar to the old commands of the simplefonts module 
 (e.g. \setmainfont)
 where the font is enabled after it was set and no \setupbodyfont is 
 necessary. Below is a example
 for this method but I recommend to avoid this method because it’s slow when 
 you set font a font
 for each style in your document.

 \setupfontfamily [serif] [DejaVu Serif]
 \setupfontfamily [sans]  [DejaVu Sans]
 \setupfontfamily [mono]  [DejaVu Sans Mono] [feature=none]
 \setupfontfamily [math]  [TeX Gyre Pagella Math]

 \starttext
 \startlines
 \rm DejaVu Serif
 \ss DejaVu Sans
 \tt DejaVu Sans Mono
 \m{c^2 = a^2 + b^2}
 \stoplines
 \stoptext


 Another feature of simplefonts is the ability to set a fallback font when you 
 need certain glyphs
 from a different font (e.g. for cyrillic ) which aren’t available in the 
 mainfont of the document.
 To set such a fallback font the code provides the \definefallbackfamily 
 command where you
 can set in the fourth argument the range for the replacement characters.

 \definefallbackfamily [mainface] [serif] [DejaVu Serif] 
 [range=cyrillic,force=yes]
 \definefontfamily [mainface] [serif] [TeX Gyre Pagella]

 \setupbodyfont[mainface]

 \starttext

 \input knuth

 Традиционная систематика лишайников оказывается во многом условна и

 \stoptext


 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  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Simplefonts

2013-10-14 Thread Hans Hagen

On 10/14/2013 5:17 PM, Lars Huttar wrote:

Hi Wolfgang,


let me try to answer ...


I'm doing an overhaul of font handling in our large project, and
wondering whether I should switch to simplefonts at this point.


Tor a a real long term robust font usage it all depends on where you 
store your fonts: if you rely on the operating systems setup you could 
burn yourself in the long run with any setup, unless you use typescripts 
+ filenames but when you keep fonts in your project tree you can use 
selectfont (aka simplefonts) when it does the right job for you.



Can you tell me, how mature is simplefonts? Is it ready for heavy-duty,
complex production use?


The font system is sort of layered:

-- low level \font commands: most robust
-- \definefont: wrapper around this
-- typescripts: combines fonts in groups, create abstraction
-- fallbacks: combine fonts into one
-- typefaces: sets up a collection of fonts

In identifying fonts there are methods like file, name, spec and file is 
the most robust.


Selectfonts runs on top of all this, and given that its way of doing it 
has been around for a while (apart from the current implementation being 
done from scratch), it's pretty mature. If things change in the low 
level api (unlikely) I'm sure selectfont will adapt which is also easier 
now that it's in the core.



Also, is it superceding the standard ConTeXt font handling? That is,
should I expect to find better help available from this list for issues
with simplefonts? Will new development be focused more on simplefonts?


It is not a font mechanism, but a wrapper that generates unseen the 
standard commands. So, it runs on top of the font mechanism and not 
alongside; it's not a matter of replacing but of convenience. If you 
have a crappy font setup or use fuzzy names of use fonts that have 
confusing properties, nothing will help and you can't blame selectfont, 
but it will do its best to help you as much as possible.


Improvements might be possible in the heuristics, but I'm pretty sure 
that Wolfgang already covered most of it. If there are issues, then the 
challenge is to see if they are general enough to become part of the 
heuristics. In that process improvements might migrate into other places.


As it's now in the core, you can probably expect more of the (mw) 
examples to use it which is educational too.


(Btw, this new modules is a nice examples of hybrid coding.)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Simplefonts

2013-10-14 Thread Wolfgang Schuster

Am 14.10.2013 um 18:38 schrieb Prashanth prash.n@gmail.com:

 Hi Wolfgang,
 
 Thanks for the update. I have a question, and I came across a bug.
 
 Question: I need some keywords in a distinctively different font, which I 
 accomplished by defining \kword as \definesimplefont[kword][DejaVu 
 Mono][size=13pt]. I looked through font-sel.mkvi, but I did not see any way 
 of implementing equivalents. (I still haven't learnt macros properly, 
 though.) Can you please give me a hint on how I can do this with the latest 
 fonts interface?

I’m not bringing it back but you can achieve the same by defining a new 
typeface/family and refer to a certain alternative of this typeface with the 
\classfont command.

\definefontfamily[keywords][ss][DejaVu Sans Mono]

\definefont[kword][\classfont{keywords}{Sans} at 13pt]

\definehighlight[keyword][style=kword]

\starttext
Text font \keyword{keyword font}
\stoptext

 Bug: I prefer Euler font for math. This does not seem to work with the latest 
 fonts interface.


The name of the font is “Neo Euler”:

\definefontfamily[mainface][rm][TeX Gyre Pagella]
\definefontfamily[mainface][mm][Neo Euler]

\setupbodyfont[mainface]

\starttext
Text font $math font$
\stoptext

You can also use the predefined typescript which has the name “eulernova”:

\definefontfamily[mainface][rm][TeX Gyre Pagella]
\definefontfamily[mainface][mm][eulernova]

\setupbodyfont[mainface]

\starttext
Text font $math font$
\stoptext

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


[NTG-context] setuplayout with duplex - shifted textarea

2013-10-14 Thread Zenlima
Hi,

I have a both sided document in which I have to switch the layout
inside a page. If I do that with text only content it works fine, but
as soon I have bigger objects (like a table) the textarea get messed
up (shifted horizontally).

I added in this example inner and outer margin notes to make it more
obvious.

Is there a way so solve this unwanted shifting like on page 2 of the
attached example?

Thanks,
H.

--8
\setuppapersize[A4][A4]

\definelayout[WithoutMarginnotes][location={duplex},grid=no,topspace=3cm,height=24cm,backspace=3cm,cutspace=0cm,leftmargin=1cm,leftmargindistance=0.4cm,width=16cm,rightmargindistance=0cm,rightmargin=0cm]

\definelayout[WithMarginnotes][location={duplex},grid=no,topspace=3cm,height=24cm,backspace=3cm,cutspace=0cm,leftmargin=1cm,leftmargindistance=0.4cm,width=12.1cm,rightmargindistance=0.4cm,rightmargin=3.5cm]

\setuppagenumbering[alternative=doublesided,location=]


\starttext

\setuplayout[WithMarginnotes]

\dorecurse {6} {
 \ininner[stack=yes]{\expanded{\dorecurse{2}{IM\recurselevel\space}}}%
 \inouter[stack=yes]{\expanded{\dorecurse{3}{OM\recurselevel\space}}}%
 \input tufte \par
}

\setuplayout[WithoutMarginnotes]

\placetable[split][]{Big table object}
{
\setupTABLE[row][1][width=\textwidth]
\bTABLE[split=repeat]
\bTABLEhead
\bTR \bTD XXX \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{20}{
\bTR \bTD XXX \eTD \eTR}
\eTABLEbody
\eTABLE
}

\setuplayout[WithMarginnotes]

\dorecurse {3} {
 \ininner[stack=yes]{\expanded{\dorecurse{2}{IM\recurselevel\space}}}%
 \inouter[stack=yes]{\expanded{\dorecurse{3}{OM\recurselevel\space}}}%
 \input tufte \par
}

\stoptext

layoutchange-1.pdf
Description: Adobe PDF document
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-14 Thread Magnus J
Thanks for the code, the stretching is ok (can be hand-tuned) but I find
the positioning a bit odd. Look at the additions to your example:

--
\starttext

\useMPlibrary[txt]

\startsetups text-a
 \startuseMPgraphic{followtokens}
 path RotPath ; RotPath := reverse halfcircle xyscaled 5cm ;
 draw RotPath ;
 \stopuseMPgraphic
 \followtokens{some text but not that long{\hskip1em}}
\stopsetups

\startsetups text-b
 \startuseMPgraphic{followtokens}
 path RotPath ; RotPath := reverse halfcircle xyscaled 3cm  ;
 draw RotPath ;
 \stopuseMPgraphic
 \followtokens{{\hskip1em}some text{\hskip1em}}
\stopsetups

\startMPpage
 draw textext(\setups{text-a}) ;
 draw textext(\setups{text-b}) shifted (0,-.5cm);

 % equal to RotPath in text-b
 path RotPath ; RotPath := reverse halfcircle xyscaled 3cm  ;
 draw RotPath shifted (0,-.5cm) withcolor red ;

 % vertically aligned (by trial and error), but not horizontally)
 draw RotPath shifted (0,-1.5cm) withcolor blue ;
\stopMPpage
--

I guess the red arc needs to be shifted further down since is has no text,
but what about the horizontal alignment (as shown in blue)? If you look
closely, the two spacing is different even between the black arcs on left
and right sides.

Regards,

Magnus

On 2013-10-13 Hans Hagen wrote:

 inbetween the arcs, that should als? be drawn). The text should not be
 stretched but center on the top, flowing evenly distributed on each
 side. This link will give you an idea:
 
 
http://www.heilsuefling.is/heilsuefling/upload/images/whp_in_general/determinants_of_health/determinants_of_health.jpg
 
 How can this achieved?

 a bit clumsy but workable

 \starttext

 \useMPlibrary[txt]

 \startsetups text-a
 \startuseMPgraphic{
followtokens}
 path RotPath ; RotPath := reverse halfcircle xyscaled 5cm ;
 draw RotPath ;
 \stopuseMPgraphic
 \followtokens{some text but not that long{\hskip1em}}
 \stopsetups

 \startsetups text-b
 \startuseMPgraphic{followtokens}
 path RotPath ; RotPath := reverse halfcircle xyscaled 3cm  ;
 draw RotPath ;
 \stopuseMPgraphic
 \followtokens{{\hskip1em}some text{\hskip1em}}
 \stopsetups

 \startMPpage
 draw textext(\setups{text-a}) ;
 draw textext(\setups{text-b}) shifted (0,-.5cm);
 \stopMPpage

 \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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] functions and paths in metapost

2013-10-14 Thread Hans Hagen

On 10/14/2013 2:38 PM, Jean Magnan de Bornier wrote:

Hello all,

Is it possible to define a path in metapost-metafun using function? In
the metafun manual (chapter on Functions) the examples shown are all of
the type draw function  I wonder if it is possible to define a path
with a function (picture after draw doesn't allow that afaik)?


there are some helpers in the new graph module, but Alan has to give an 
example


% least-squares fit to a polynomial
%
% example :
%
%   path p[] ;
%   numeric a[] ; a0 := 1 ; a1 := .1 ; a2 := .01 ; a3 := .001 ; a4 := 
0.0001 ;

%   p0 := makefunctionpath(0,5,10,polynomial_function(a,4,x)) ;

(it fails here so I probably misunderstand it)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] setuplayout with duplex - shifted textarea

2013-10-14 Thread Hans Hagen

On 10/14/2013 8:00 PM, Zenlima wrote:

Hi,

I have a both sided document in which I have to switch the layout
inside a page. If I do that with text only content it works fine, but
as soon I have bigger objects (like a table) the textarea get messed
up (shifted horizontally).

I added in this example inner and outer margin notes to make it more
obvious.

Is there a way so solve this unwanted shifting like on page 2 of the
attached example?


I have no time not to look into it, but changing the layout halfways a 
page for sure has side effects as the page builder then is using the 
current one and some of the action is delayed till the page builder


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-14 Thread Marco Patzer
On 2013–10–14 Marco Patzer wrote:

 On 2013–10–13 Hans Hagen wrote:
 
  inbetween the arcs, that should alsó be drawn). The text should not be
  stretched but center on the top, flowing evenly distributed on each
  side. This link will give you an idea:
  
  http://www.heilsuefling.is/heilsuefling/upload/images/whp_in_general/determinants_of_health/determinants_of_health.jpg
  
  How can this achieved?

Here is a slightly modified version of the \followtokens macro with
centres the text without stretching it to the path size.

\useMPlibrary [txt]

\unexpanded\def\followtokenscentred#1%%
  {\vbox\bgroup
   \forgetall
   \dontcomplain
   \startMPenvironment
 \doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
   \stopMPenvironment
   \MPtoks\emptytoks
   \resetMPdrawing
   \startMPdrawing
 \includeMPgraphic{followtokenscentred} ;
 picture pic[] ; numeric len[], n ; n := 0 ;
   \stopMPdrawing
   \handletokens#1\with\processfollowingtoken
   \startMPdrawing
 if unknown RotPath  : pathRotPath  ; RotPath  := origin ; fi ;
 if unknown RotColor : color   RotColor ; RotColor := black  ; fi ;
 if unknown TraceRot : boolean TraceRot ; TraceRot := false  ; fi ;
 if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0  ; fi ;
 numeric al, at, pl, wid, pos ; pair ap, ad ;
 al := arclength RotPath ;
 if al=0 :
   al := len[n] + ExtraRot ;
   RotPath := origin -- (al,0) ;
 fi ;
 if allen[n]:
   RotPath := RotPath scaled ((len[n]+ExtraRot)/al) ;
   al := arclength RotPath ;
 fi ;
 pl := (al-len[n])/(if n1 : (n-1) else : 1 fi) ;
 pl := 0cm;
 if TraceRot :
   draw RotPath withpen pencircle scaled 1pt withcolor blue ;
 fi ;
 for i=1 upto n :
   wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ;
   pos := len[i]-wid/2 + (i-1)*pl + arclength RotPath/2 - len[n]/2 ;
   at := arctime   pos of RotPath ;
   ap := point at  of RotPath ;
   ad := direction at  of RotPath ;
   draw pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap
 withcolor RotColor ;
   if TraceRot :
 draw boundingbox
pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap
withpen pencircle scaled .25pt withcolor red ;
 draw ap
withpen pencircle scaled .50pt withcolor green ;
   fi ;
 endfor ;
   \stopMPdrawing
   \MPdrawingdonetrue
   \getMPdrawing
   \resetMPdrawing
   \egroup}

\def\followtokengraphicscale#1{%%
  \startuseMPgraphic {followtokenscentred}
path RotPath; RotPath :=  reverse halfcircle scaled #1 ;
setbounds currentpicture to boundingbox fullcircle scaled 12cm ;
  \stopuseMPgraphic}

\starttext

\startoverlay
  {\followtokengraphicscale{10cm}%%
   \followtokenscentred{General socioeconomic cultural and environmental 
conditions}}
  {\followtokengraphicscale{8cm}%%
   \followtokenscentred{Living and working conditions}}
  {\followtokengraphicscale{6cm}%%
   \followtokenscentred{Social and community influences}}
  {\followtokengraphicscale{4cm}%%
   \followtokenscentred{Individual lifestyle factors}}
\stopoverlay

\stoptext

Marco


signature.asc
Description: Digital signature
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___