Re: [NTG-context] linking to an external PDF file

2018-10-07 Thread Hans Hagen

On 10/7/2018 8:41 PM, Pablo Rodriguez wrote:

On 10/7/18 8:33 PM, Hans Hagen wrote:

On 10/7/2018 8:19 PM, Pablo Rodriguez wrote:

[...]
Is there a way to hyperlink to an attached document? I mean, no matter
whether it has been generated by ConTeXt or not.
i have no clue what you mean


Is there a way to link to a page or a destination (such as in
https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#page=500
or
https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#nameddest=G12.2456615)
to a document that is attached (using \attachment) in ConTeXt?

I hope it is clear now,
it points to the media mess .. which relates to either or not obsolete 
stuff (flash related)


anyway, i don't know as i never embed pdf docs and if i would i'd have 
no reason to refer to them (it probably depends on a viewer extracting 
the attachment, caching it and then providing access: it makes no sense 
to waste time on features that are not supported or maybe only by 
acrobat unless it's a well paid projects in which case throw away code 
is a bit less waste of time because it brings foon on the table)


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] Font Awesome (again)

2018-10-07 Thread Aditya Mahajan

On Sun, 7 Oct 2018, Ulrike Fischer wrote:


Am Sun, 7 Oct 2018 09:26:11 -0400 (EDT) schrieb Aditya Mahajan:


Would it make sense to update the fonts in the distribution?


I didn't quite follow the discussion and the suggested code, but
from a similar discussion for latex I know that the symbols in
fontawesome 4 and 5 looks different (that's why there is an explicit
fontawesome5 package in latex).


Then Wolfgang's solution makes even more sense as it is possible to use 
BOTH v4 and v5 of the font.


Aditya
___
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] linking to an external PDF file

2018-10-07 Thread Pablo Rodriguez
On 10/7/18 8:33 PM, Hans Hagen wrote:
> On 10/7/2018 8:19 PM, Pablo Rodriguez wrote:
>> [...]
>> Is there a way to hyperlink to an attached document? I mean, no matter
>> whether it has been generated by ConTeXt or not.
> > i have no clue what you mean

Is there a way to link to a page or a destination (such as in
https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#page=500
or
https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#nameddest=G12.2456615)
to a document that is attached (using \attachment) in ConTeXt?

I hope it is clear now,

Pablo
-- 
http://www.ousia.tk
___
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] linking to an external PDF file

2018-10-07 Thread Hans Hagen

On 10/7/2018 8:19 PM, Pablo Rodriguez wrote:

On 10/7/18 8:05 PM, Hans Hagen wrote:

On 10/7/2018 6:26 PM, Alan Bowen wrote:

A how-to question that has come up:

Is there a way to establish to hyperlink to a specific page or footnote
in an external PDF document?


Many thanks for your reply, Hans.

Is there a way to hyperlink to an attached document? I mean, no matter
whether it has been generated by ConTeXt or not.

i have no clue what you mean

-
  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] linking to an external PDF file

2018-10-07 Thread Pablo Rodriguez
On 10/7/18 8:05 PM, Hans Hagen wrote:
> On 10/7/2018 6:26 PM, Alan Bowen wrote:
>> A how-to question that has come up:
>>
>> Is there a way to establish to hyperlink to a specific page or footnote 
>> in an external PDF document?

Many thanks for your reply, Hans.

Is there a way to hyperlink to an attached document? I mean, no matter
whether it has been generated by ConTeXt or not.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
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] linking to an external PDF file

2018-10-07 Thread Hans Hagen

On 10/7/2018 6:26 PM, Alan Bowen wrote:

A how-to question that has come up:

Is there a way to establish to hyperlink to a specific page or footnote 
in an external PDF document?

-- first.tex --

\setupinteraction[state=start]

\starttext

whatever \footnote[whatever:1]{whatever 1}

\goto{note 3}[second::whatever:3]
\goto{note 4}[second::whatever:4]

\in{note (1)}[whatever:1]
\in{note (2)}[whatever:2]
\in{note (3)}[second::whatever:3]
\in{note (4)}[second::whatever:4]

\page

whatever \footnote[whatever:2]{whatever 2}

\goto{note 3}[second::whatever:3]
\goto{note 4}[second::whatever:4]

\in{note (1)}[whatever:1]
\in{note (2)}[whatever:2]
\in{note (3)}[second::whatever:3]
\in{note (4)}[second::whatever:4]

\stoptext

-- second.tex --


\setupinteraction[state=start]

\starttext

whatever \footnote[whatever:3]{whatever 3}

\goto{note 1}[first::whatever:1]
\goto{note 2}[first::whatever:2]

\in{note (1)}[first::whatever:1]
\in{note (2)}[first::whatever:2]
\in{note (3)}[whatever:3]
\in{note (4)}[whatever:4]

\page

whatever \footnote[whatever:4]{whatever 4}

\goto{note 1}[first::whatever:1]
\goto{note 2}[first::whatever:2]

\in{note (1)}[first::whatever:1]
\in{note (2)}[first::whatever:2]
\in{note (3)}[whatever:3]
\in{note (4)}[whatever:4]

\stoptext

--

the \in ref to the other doc will work ok in a next beta (normally one 
will use a proper project / component structure for such cases)


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] Implicit plots/level curves possible?

2018-10-07 Thread Hans Hagen

On 10/7/2018 7:14 PM, Alan Braslau wrote:

On Sun, 7 Oct 2018 17:25:35 +0200
"Mikael P. Sundqvist"  wrote:


ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}]


Brut force:

\startTEXpage
\startMPcode {doublefun}
pen savedpen ; savedpen := currentpen ;
pickup pencircle scaled .01 ;
path p ;
p := for i=0 upto 1000 :
for j=0 upto 1000 :
  hide(x := 2i/1000 ; y := 2.5j/1000 - 2 ;)
  if abs(2*(x**5)+x*y+y**5) < .002i/1000 : (x,y) .. fi
endfor
  endfor cycle ;
draw subpath (0,length p - 1) of p ;
setbounds currentpicture to (0,-2)--(2,-2)--(2,.5)--(0,.5)--cycle ;
currentpicture := currentpicture xsized 5cm ;
pickup savedpen ;

picture pic ; pic := currentpicture ;
drawarrow llcorner pic--lrcorner pic ;
drawarrow llcorner pic--ulcorner pic ;
label.rt ("$x$", lrcorner pic) ;
label.top("$y$", ulcorner pic) ;
for x=0 step .5 until 2 :
 label.bot(decimal x,(x/2)[llcorner pic,lrcorner pic]) ;
endfor
for y=0 step .5 until 2.5 :
 label.lft(decimal (y-2),(y/2.5)[llcorner pic,ulcorner pic]) ;
endfor
\stopMPcode
\stopTEXpage

as this takes some time here's a cheat:

\starttext

\startbuffer[demo]
% when an environment is used, load it here
\startMPcode {doublefun}
pen savedpen ; savedpen := currentpen ;
pickup pencircle scaled .01 ;
numeric stp ; stp := 1 ;
path p ;
p := for i=0 step stp until 1000 :
for j=0 step stp until 1000 :
hide(x := 2i/1000 ; y := 2.5j/1000 - 2 ;)
if abs(2*(x**5)+x*y+y**5) < .002i/1000 : (x,y) .. fi
endfor
endfor cycle ;
draw subpath (0,length p - 1) of p ;
setbounds currentpicture to (0,-2)--(2,-2)--(2,.5)--(0,.5)--cycle ;
currentpicture := currentpicture xsized 5cm ;
pickup savedpen ;
picture pic ; pic := currentpicture ;
drawarrow llcorner pic--lrcorner pic ;
drawarrow llcorner pic--ulcorner pic ;
label.rt ("$x$", lrcorner pic) ;
label.top("$y$", ulcorner pic) ;
for x=0 step .5 until 2 :
label.bot(decimal x,(x/2)[llcorner pic,lrcorner pic]) ;
endfor ;
for y=0 step .5 until 2.5 :
label.lft(decimal (y-2),(y/2.5)[llcorner pic,ulcorner pic]) ;
endfor ;
\stopMPcode
\stopbuffer

\startTEXpage
\typesetbuffer[demo]
\stopTEXpage

\stoptext

a next run the already prepared buffer will be taken unles it has been 
changed.


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] Implicit plots/level curves possible?

2018-10-07 Thread Mikael P. Sundqvist
On Sun, Oct 7, 2018 at 7:14 PM Alan Braslau  wrote:
>
> On Sun, 7 Oct 2018 17:25:35 +0200
> "Mikael P. Sundqvist"  wrote:
>
> > ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}]
>
> Brut force:
>
> \startTEXpage
> \startMPcode {doublefun}
> pen savedpen ; savedpen := currentpen ;
> pickup pencircle scaled .01 ;
> path p ;
> p := for i=0 upto 1000 :
>for j=0 upto 1000 :
>  hide(x := 2i/1000 ; y := 2.5j/1000 - 2 ;)
>  if abs(2*(x**5)+x*y+y**5) < .002i/1000 : (x,y) .. fi
>endfor
>  endfor cycle ;
> draw subpath (0,length p - 1) of p ;
> setbounds currentpicture to (0,-2)--(2,-2)--(2,.5)--(0,.5)--cycle ;
> currentpicture := currentpicture xsized 5cm ;
> pickup savedpen ;
>
> picture pic ; pic := currentpicture ;
> drawarrow llcorner pic--lrcorner pic ;
> drawarrow llcorner pic--ulcorner pic ;
> label.rt ("$x$", lrcorner pic) ;
> label.top("$y$", ulcorner pic) ;
> for x=0 step .5 until 2 :
> label.bot(decimal x,(x/2)[llcorner pic,lrcorner pic]) ;
> endfor
> for y=0 step .5 until 2.5 :
> label.lft(decimal (y-2),(y/2.5)[llcorner pic,ulcorner pic]) ;
> endfor
> \stopMPcode
> \stopTEXpage
>
>
> Alan

Thanks both to luigi and to Alan! I'm impressed by your brute force
method, Alan! In particular it learned me the "hide" command.

I feel a bit ashamed. Earlier today I answered something else giving a
reference to the metafun manual. Now I'm here not reading it carefully
enough myself. In the helpers section it is clearly written how to
import and plot data. Thus, I exported the data from the Mathematica
plot (that file is pasted below in case anyone wants to try this
themselves, sorry in advance for the big amount of text it generates
in this email) and then importing it just worked fine. I like Alan's
method very much, but it takes some time during compilation, so I will
probably stick with importing. Working code below (where one can see
that Alan's method is indeed working fine, at least with this
example).

Again, thanks to both luigi and Alan!

\starttext

\startTEXpage[offset=2bp]
\startMPcode{doublefun}

pen savedpen ; savedpen := currentpen ;
pickup pencircle scaled .01 ;

lua("MP = { } MP.data = table.load('mmadata.txt')") ;
numeric n ;
lua("mp.print('n := ',\#MP.data)") ;
path mycurve;
mycurve :=
lua("mp.pair(MP.data[1])")
for i=2 upto n :
.. lua("mp.pair(MP.data[" & decimal i & "])")
endfor;
draw mycurve withcolor darkred withpen pencircle scaled 0.04;

path p ;
p := for i=0 upto 1000 :
   for j=0 upto 1000 :
 hide(x := 2i/1000 ; y := 2.5j/1000 - 2 ;)
 if abs(2*(x**5)+x*y+y**5) < .002i/1000 : (x,y) .. fi
   endfor
 endfor cycle ;
draw subpath (0,length p - 1) of p ;
setbounds currentpicture to (0,-2)--(2,-2)--(2,.5)--(0,.5)--cycle ;
currentpicture := currentpicture xsized 5cm ;
pickup savedpen ;

picture pic ; pic := currentpicture ;
drawarrow llcorner pic--lrcorner pic ;
drawarrow llcorner pic--ulcorner pic ;
label.rt ("$x$", lrcorner pic) ;
label.top("$y$", ulcorner pic) ;
for x=0 step .5 until 2 :
label.bot(decimal x,(x/2)[llcorner pic,lrcorner pic]) ;
endfor
for y=0 step .5 until 2.5 :
label.lft(decimal (y-2),(y/2.5)[llcorner pic,ulcorner pic]) ;
endfor
\stopMPcode
\stopTEXpage
\stoptext


%%% mmadata.txt %%%
return {{1.7781332646374535, -2.0}, {1.7768209908069152,
-1.9983615165933983}, {1.775510204081634, -1.9967215415115265},
{1.7664030082433901, -1.985873790716172}, {1.756875567501,
-1.9744897959183674}, {1.7559890220139953, -1.973381069421283},
{1.7551020408163278, -1.9722667987462739}, {1.7455791311458495,
-1.9608832289248324}, {1.7356495451060165, -1.9489795918367347},
{1.7351734376993888, -1.9483801416512756}, {1.7346938775510217,
-1.9477751961654046}, {1.7247720468786834, -1.9358716760955252},
{1.714463398255413, -1.9234693877551021}, {1.7142857142857155,
-1.9232445076564075}, {1.7093814232165505, -1.9173390239186459},
{1.7039827159442558, -1.910837931600294}, {1.6938775510204094,
-1.8986359463002893}, {1.6935950869756253, -1.8983122637294494},
{1.6932881048717179, -1.8979591836734695}, {1.683212201778606,
-1.8857806661440912}, {1.6734693877551032, -1.8739731304347957},
{1.6728341829160982, -1.873242985640593}, {1.6721459415303699,
-1.8724489795918369}, {1.6624611568740721, -1.8606990641114929},
{1.653061224489797, -1.8492648538255463}, {1.6520932542108602,
-1.8481487383588753}, {1.6510476808879386, -1.8469387755102042},
{1.6417306097129987, -1.8355918398995696}, {1.632653061224491,
-1.824508389583349}, {1.6313733625579403, -1.82302819476176},
{1.6299953447379028, -1.8214285714285716}, {1.621021656483979,
-1.8104576232725786}, {1.6122448979591848, -1.7997008180397196},
{1.6106756399677442, -1.7978799398362397}, {1.6089910811705357,
-1.795918367346939}, {1.6003354664096425, -1.7852949527022344},
{1.5918367346938787, -1.7748390113411368}, {1.5900012943276478,
-1.7727024637230948}, {1.5880371747643334, -1.7704081632653064},
{1.5796732875598591, -1.760102268101198}, {1.5714285714285725,
-1.749919616723856

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-07 Thread Alan Braslau
On Sun, 7 Oct 2018 17:25:35 +0200
"Mikael P. Sundqvist"  wrote:

> ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}]

Brut force:

\startTEXpage
\startMPcode {doublefun}
pen savedpen ; savedpen := currentpen ;
pickup pencircle scaled .01 ;
path p ;
p := for i=0 upto 1000 :
   for j=0 upto 1000 :
 hide(x := 2i/1000 ; y := 2.5j/1000 - 2 ;)
 if abs(2*(x**5)+x*y+y**5) < .002i/1000 : (x,y) .. fi
   endfor
 endfor cycle ;
draw subpath (0,length p - 1) of p ;
setbounds currentpicture to (0,-2)--(2,-2)--(2,.5)--(0,.5)--cycle ;
currentpicture := currentpicture xsized 5cm ;
pickup savedpen ;

picture pic ; pic := currentpicture ;
drawarrow llcorner pic--lrcorner pic ;
drawarrow llcorner pic--ulcorner pic ;
label.rt ("$x$", lrcorner pic) ;
label.top("$y$", ulcorner pic) ;
for x=0 step .5 until 2 :
label.bot(decimal x,(x/2)[llcorner pic,lrcorner pic]) ;
endfor
for y=0 step .5 until 2.5 :
label.lft(decimal (y-2),(y/2.5)[llcorner pic,ulcorner pic]) ;
endfor
\stopMPcode
\stopTEXpage


Alan
___
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] Homebrew packaging for macOS

2018-10-07 Thread Mojca Miklavec
On Sun, 7 Oct 2018 at 01:24, Andrew Dunning wrote:
>
> Dear list,
>
> Has anyone ever looked into packaging ConTeXt for Homebrew on macOS (see 
> )?

I'm not aware of any such effort so far, but we gladly help you if you
are willing to invest effort into creating one yourself.

> Providing it as an installation option would make it far easier to obtain the 
> latest version.

Obtaining the latest version is already relatively easy, but I fully
understand your point :)

> In looking into it myself, I immediately came across the problem of not being 
> exactly sure where to find a versioned download link. See their guidelines at 
> .

Maybe
https://github.com/contextgarden/context-mirror
comes closest to what you are looking for, but note that ConTeXt
provides several releases per day (or maybe a release every few days
at most) which is more resembling individual commits in other projects
than one release per every few months as would be common with other
projects.

The only thing that comes somewhat closer to a release is a version
that gets released with TeX Live once per year, but that's not in line
with your desire to easily get the latest version. We had the latest
version of ConTeXt in TLContrib repository for a while which could
probably be reinstated if desired, but that means using MacTeX (even
if from HB).

If you want to provide a package for HB, you either need to use "HEAD"
or create a cron job that will update the package definition several
times per day :) :) :)

But note that installing ConTeXt alone is not sufficient. You also
need LuaTeX, a bunch of fonts and other files (I'm not sure which
ones; with the old ConTeXt MKII it was a lot more dependencies than
with the new ConTeXt MKIV). The easiest way would be to install TeX
Live as a dependency, but from what I saw I suspect that HB only
packages MacTeX as a binary installation. You could install ConTeXt on
top of that in a way that doesn't conflict. Alternatively you need to
spend (quite some) effort figuring out what exactly is needed.

I'll probably create another git repository with a standalone
installation, but it's not yet ready and you should not count on it.

I suspect that you'll find a slightly hard time getting this package
into core HomeBrew and that you'll need to provide your own
repository, but I might be wrong. I decided against providing a
package for MacPorts precisely because it's not really practical to
update a package definition every few days.

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

Re: [NTG-context] Font Awesome (again)

2018-10-07 Thread Ulrike Fischer
Am Sun, 7 Oct 2018 09:26:11 -0400 (EDT) schrieb Aditya Mahajan:

> Would it make sense to update the fonts in the distribution?

I didn't quite follow the discussion and the suggested code, but
from a similar discussion for latex I know that the symbols in
fontawesome 4 and 5 looks different (that's why there is an explicit
fontawesome5 package in latex).


-- 
Ulrike Fischer 
https://www.troubleshooting-tex.de/

___
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] linking to an external PDF file

2018-10-07 Thread Alan Bowen
A how-to question that has come up:

Is there a way to establish to hyperlink to a specific page or footnote in
an external PDF document?

Alan
___
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] Font Awesome (again)

2018-10-07 Thread Hans Hagen

On 10/7/2018 5:25 PM, Alan Braslau wrote:

On Sun, 7 Oct 2018 16:19:13 +0200
Hans Hagen  wrote:


hm, one of these projects that when it got some reasonable user base
went 'pro', collects money as kick start which looks proffitable enough
to keep all open, but then goes for a limited free version to play nice,
and go for a subscription model (so lock-in) ... some fashion in
(pseudo) open source ... pretty confusing too (hopefully Hraban got a
live long pro license for free)


The community offers the 'Pro' version of ConTeXt for free...

And context group members also get the 'Enterprise' version for free ...

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] Font Awesome (again)

2018-10-07 Thread Hans Hagen

On 10/7/2018 5:39 PM, Aditya Mahajan wrote:

On Sun, 7 Oct 2018, Wolfgang Schuster wrote:


This sounds reasonable. Could we add these definitions to 
symb-imp-fontawesome?

sure

-
  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] Font Awesome (again)

2018-10-07 Thread Aditya Mahajan

On Sun, 7 Oct 2018, Wolfgang Schuster wrote:


Aditya Mahajan schrieb am 07.10.18 um 15:26:

Hi,

There is a FontAwesome.otf file that is distributed with ConTeXt 
minimals. Does anyone know what version (4 or 5) of the font it is? I am 
asking because the names of the symbols used in the font do not match 
those on the font-awesome website. For example, using


\showsymbolset[fontawesome]


The distribution includes version 4.7.

I get that the symbol for "utensils" 
(https://fontawesome.com/icons/utensils?style=solid) is actually mapped 
to "food" in ConTeXt. Since the names of the symbols are now taken from 
the font, my guess is that the distribution has an old version of the 
font (also because it is a single font rather than three).


Would it make sense to update the fonts in the distribution? If not, then 
simply remove the old version of the fonts?


Also, don't we need to update the symb-imp-fontawesome.mkiv file to work 
with the new symbols. Font awesome has split the fonts into three
(https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started): 
Solid, Regular, and Brands. (There are also pro version of the fonts). 
The simplest way to use them will be to have three symbolsets 
(fontawesome, fontawesome-solid, and fontawesome-brands), where the names 
are taken from the fonts.


In the meanwhile, Hraban has painstakenly written out the mappings by 
hand, but the automatic mapping might be simpler (and more future proof).

https://github.com/fiee/ConTeXt/blob/master/symbols/symb-awesome5.mkiv


While I have no problem replacing the old symbols you can support both when 
you use new set names for the new version (even for the regular style).



\definefontsynonym [FontAwesomeBrands] 
[file:fontawesome5brandsregular400.otf]
\definefontsynonym [FontAwesomeRegular] 
[file:fontawesome5freeregular400.otf]

\definefontsynonym [FontAwesomeSolid] [file:fontawesome5freesolid900.otf]

\startsymbolset [fontawesome-brands] [font=FontAwesomeBrands]
  % Font Awesome Brands
\stopsymbolset

\startsymbolset [fontawesome-regular] [font=FontAwesomeRegular]
  % Font Awesome Regular
\stopsymbolset

\startsymbolset [fontawesome-solid] [font=FontAwesomeSolid]
  % Font Awesome Solid
\stopsymbolset

\starttext

\startnamedsection [title] [title={Font Awesome Brands}]
  \showsymbolset [fontawesome-brands]
\stopnamedsection

\startnamedsection [title] [title={Font Awesome Regular}]
  \showsymbolset [fontawesome-regular]
\stopnamedsection

\startnamedsection [title] [title={Font Awesome Solid}]
  \showsymbolset [fontawesome-solid]
\stopnamedsection

\stoptext


This sounds reasonable. Could we add these definitions to 
symb-imp-fontawesome?


Thanks,
Aditya___
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] Implicit plots/level curves possible?

2018-10-07 Thread luigi scarso
On Sun, Oct 7, 2018 at 5:26 PM Mikael P. Sundqvist  wrote:

> Dear list,
>
> Is it possiblet to make implicit plots (i.e. ploting the curves
> described by equations) in MetaFun? I cannot find anything about them
> in the MetaFun manual.
>
> For example, in Mathematica I can write something like
>
> ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}]
>

you need some  " Groebner basis computation " kernel to do this kind of
computations.
Have a look  at https://www-fourier.ujf-grenoble.fr/~parisse/giac.html

-- 
luigi
___
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] Implicit plots/level curves possible?

2018-10-07 Thread Mikael P. Sundqvist
Dear list,

Is it possiblet to make implicit plots (i.e. ploting the curves
described by equations) in MetaFun? I cannot find anything about them
in the MetaFun manual.

For example, in Mathematica I can write something like

ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}]

to get the attached figure.

The closest I have found which is something MetaPost-like, is the
levelcurve command in mfpic (see for example this answer
https://tex.stackexchange.com/a/405527/52406).

If this is not currently possible in MetaFun, what is the simplest way
to proceed (I want the same style of the plots as the other ones in my
doc)? Is it to

1) somehow run mfpic from within ConTeXt?
2) export points from Mathematica and plot them in ConTeXt (how could
that be done?). In the latter case, say I have the points (0,0),
(0.4,1), and (0.8,2) exported to a file. What format should it be in
to be easily imported and plot in MetaFun?
3) some other way?

/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
___

Re: [NTG-context] Font Awesome (again)

2018-10-07 Thread Alan Braslau
On Sun, 7 Oct 2018 16:19:13 +0200
Hans Hagen  wrote:

> hm, one of these projects that when it got some reasonable user base 
> went 'pro', collects money as kick start which looks proffitable enough 
> to keep all open, but then goes for a limited free version to play nice, 
> and go for a subscription model (so lock-in) ... some fashion in 
> (pseudo) open source ... pretty confusing too (hopefully Hraban got a 
> live long pro license for free)

The community offers the 'Pro' version of ConTeXt for free...

;-)
___
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] Font Awesome (again)

2018-10-07 Thread Hans Hagen

On 10/7/2018 3:43 PM, Wolfgang Schuster wrote:



Aditya Mahajan schrieb am 07.10.18 um 15:26:

Hi,

There is a FontAwesome.otf file that is distributed with ConTeXt 
minimals. Does anyone know what version (4 or 5) of the font it is? I 
am asking because the names of the symbols used in the font do not 
match those on the font-awesome website. For example, using


\showsymbolset[fontawesome]


The distribution includes version 4.7.

I get that the symbol for "utensils" 
(https://fontawesome.com/icons/utensils?style=solid) is actually 
mapped to "food" in ConTeXt. Since the names of the symbols are now 
taken from the font, my guess is that the distribution has an old 
version of the font (also because it is a single font rather than three).


Would it make sense to update the fonts in the distribution? If not, 
then simply remove the old version of the fonts?


Also, don't we need to update the symb-imp-fontawesome.mkiv file to 
work with the new symbols. Font awesome has split the fonts into three
(https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started): 

Solid, Regular, and Brands. (There are also pro version of the fonts). 
The simplest way to use them will be to have three symbolsets 
(fontawesome, fontawesome-solid, and fontawesome-brands), where the 
names are taken from the fonts.


In the meanwhile, Hraban has painstakenly written out the mappings by 
hand, but the automatic mapping might be simpler (and more future proof).

https://github.com/fiee/ConTeXt/blob/master/symbols/symb-awesome5.mkiv


While I have no problem replacing the old symbols you can support both 
when you use new set names for the new version (even for the regular 
style).



\definefontsynonym [FontAwesomeBrands] 
[file:fontawesome5brandsregular400.otf]
\definefontsynonym [FontAwesomeRegular] 
[file:fontawesome5freeregular400.otf]

\definefontsynonym [FontAwesomeSolid] [file:fontawesome5freesolid900.otf]

\startsymbolset [fontawesome-brands] [font=FontAwesomeBrands]
   % Font Awesome Brands
\stopsymbolset

\startsymbolset [fontawesome-regular] [font=FontAwesomeRegular]
   % Font Awesome Regular
\stopsymbolset

\startsymbolset [fontawesome-solid] [font=FontAwesomeSolid]
   % Font Awesome Solid
\stopsymbolset

\starttext

\startnamedsection [title] [title={Font Awesome Brands}]
   \showsymbolset [fontawesome-brands]
\stopnamedsection

\startnamedsection [title] [title={Font Awesome Regular}]
   \showsymbolset [fontawesome-regular]
\stopnamedsection

\startnamedsection [title] [title={Font Awesome Solid}]
   \showsymbolset [fontawesome-solid]
\stopnamedsection

\stoptext
hm, one of these projects that when it got some reasonable user base 
went 'pro', collects money as kick start which looks proffitable enough 
to keep all open, but then goes for a limited free version to play nice, 
and go for a subscription model (so lock-in) ... some fashion in 
(pseudo) open source ... pretty confusing too (hopefully Hraban got a 
live long pro license for free)


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] context and sqlite - here is the code

2018-10-07 Thread Hans Hagen

On 10/7/2018 9:35 AM, Jörg Hofmann wrote:

Hallo Hans,
hallo Luigi,

Am Samstag, den 06.10.2018, 20:01 +0200 schrieb Jörg Hofmann:

I've been trying to connect ConTeXt to sqlite for almost a week
but I have repeatedly failed. Neither the
"internal" variant according to the documentation, nor the attempt on
luasql
have worked. Above all, the Google request showed me that
not alone with this problem - how reassuring. ;-)

At the moment, concentrate I am accessing via swiglib and think my
problem lies here (from my log file):

sql> start loading method 'sqlite'
swiglib> unknown: 'swiglib.sqlite.core'
swiglib> unknown: 'swiglib.helpers.core'

Obviously, the appropriate modules are not found, but where
Can I get them and where do they belong? And maybe
also someone a working code example for me.
I'm working with Texlive 2017 on XUBUNTU 16.04.


Many thanks for your help. I have read both manuals but may not
understand it correctly. That's why I send my file and the log file.
the latest versions of context use ffi for mysql and sqlite interfacing 
so you just need the libraries


if you add \enabletrackers[*ffi*] to your file you get something

ffilib  > requiring library 'sqlite3' with version 'any'
ffilib  > tds path 1: .
ffilib  > tds path 2: 
c:/data/develop/tex-context/tex/texmf-win64/bin/lib/context/lua//
ffilib  > tds path 3: 
c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luatex/lua//
ffilib  > tds path 4: 
c:/data/develop/tex-context/tex/texmf-win64/bin/lib//lua//

ffilib  > attemp 1, engine 'luatex'
ffilib  > checking tds lib paths strictly
ffilib  > checking with version: 'sqlite3.dll'
ffilib  > found: 
'c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luatex/lua/copies/sqlite/sqlite3.dll'

ffilib  > stored library: 'sqlite3'
sql > loading method 'sqlite' done

anyway, best keep your libe in the tex tree because otherwise you get 
some random one that is found on your system


attached a better example file (hard to test without a database here so 
need to make one ... next time proviode a real mwe)


in util-sql-imp-sqlite.lua remove a pragma line so we get:

local f_preamble = formatters[ [[
ATTACH `%s` AS `%s` ;
PRAGMA `%s`.synchronous = normal ;
]] ]



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
\starttext

\enabletrackers[*ffi*]

\startluacode
require("util-sql")

local sql = utilities.sql

sql.setmethod("sqlite")

document.sqlpresets = {
database = "aufgaben",
id   = "aufgaben",
}

local template = [[
CREATE TABLE IF NOT EXISTS `aufgaben` (
`id`  INTEGER PRIMARY KEY AUTOINCREMENT,
`titel`   BLOB NOT NULL,
`sachverhalt` BLOB NOT NULL,
`auftraege`   BLOB NOT NULL
) ;
]]

function document.createdatabase()

return utilities.sql.execute {
presets   = document.sqlpresets,
template  = template,
}

end

local template = [[
INSERT INTO `aufgaben` (
`titel`,
`sachverhalt`,
`auftraege`
) VALUES (
'%titel%',
'%sachverhalt%',
'%auftraege%'
) ;
]]

function document.addtodatabase(t)

return utilities.sql.execute {
presets   = document.sqlpresets,
template  = template,
variables = {
titel   = t.titel,
sachverhalt = t.sachverhalt,
auftraege   = t.auftraege,
},
}

end

local template_id = [[
SELECT
*
FROM
`aufgaben`
WHERE
`id` = '%id%' ;
]]

document.sqlconverter = sql.makeconverter {
{ name = "id",  type = "number" },
{ name = "titel",   type = "string" },
{ name = "sachverhalt", type = "string" },
{ name = "auftraege",   type = "string" },
}

function document.getfromdatabase(t)

if t.id then

return utilities.sql.execute {
presets   = document.sqlpresets,
template  = template_id,
variables = { id = t.id },
 -- converter = document.sqlconverter,
}

end

end

\stopluacode

\startluacode

document.createdatabase()

local tufte = io.loaddata(resolvers.findfile("tufte.tex"))
local ward  = io.loaddata(resolvers.findfile("ward.tex"))
local knuth = io.loaddata(resolvers.findfile("knuth.tex"))

document.addtodatabase { titel = "aufgabe 1", sachverhalt = "one",   auftraege 
= tufte }
document.addtodatabase { titel = "aufgabe 2", sachverhalt = "two",   auftraege 
= ward }
document.addtodatabase { titel = "aufgabe 3", sachverhalt = "three", auftraege 
= knuth }

function document.showrecord(n)

local result = document.getfromdatabase { id = n }

for i=1,#result do
local 

Re: [NTG-context] Font Awesome (again)

2018-10-07 Thread Wolfgang Schuster



Aditya Mahajan schrieb am 07.10.18 um 15:26:

Hi,

There is a FontAwesome.otf file that is distributed with ConTeXt 
minimals. Does anyone know what version (4 or 5) of the font it is? I 
am asking because the names of the symbols used in the font do not 
match those on the font-awesome website. For example, using


\showsymbolset[fontawesome]


The distribution includes version 4.7.

I get that the symbol for "utensils" 
(https://fontawesome.com/icons/utensils?style=solid) is actually 
mapped to "food" in ConTeXt. Since the names of the symbols are now 
taken from the font, my guess is that the distribution has an old 
version of the font (also because it is a single font rather than three).


Would it make sense to update the fonts in the distribution? If not, 
then simply remove the old version of the fonts?


Also, don't we need to update the symb-imp-fontawesome.mkiv file to 
work with the new symbols. Font awesome has split the fonts into three
(https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started): 

Solid, Regular, and Brands. (There are also pro version of the fonts). 
The simplest way to use them will be to have three symbolsets 
(fontawesome, fontawesome-solid, and fontawesome-brands), where the 
names are taken from the fonts.


In the meanwhile, Hraban has painstakenly written out the mappings by 
hand, but the automatic mapping might be simpler (and more future proof).

https://github.com/fiee/ConTeXt/blob/master/symbols/symb-awesome5.mkiv


While I have no problem replacing the old symbols you can support both 
when you use new set names for the new version (even for the regular style).



\definefontsynonym [FontAwesomeBrands] 
[file:fontawesome5brandsregular400.otf]
\definefontsynonym [FontAwesomeRegular] 
[file:fontawesome5freeregular400.otf]

\definefontsynonym [FontAwesomeSolid] [file:fontawesome5freesolid900.otf]

\startsymbolset [fontawesome-brands] [font=FontAwesomeBrands]
  % Font Awesome Brands
\stopsymbolset

\startsymbolset [fontawesome-regular] [font=FontAwesomeRegular]
  % Font Awesome Regular
\stopsymbolset

\startsymbolset [fontawesome-solid] [font=FontAwesomeSolid]
  % Font Awesome Solid
\stopsymbolset

\starttext

\startnamedsection [title] [title={Font Awesome Brands}]
  \showsymbolset [fontawesome-brands]
\stopnamedsection

\startnamedsection [title] [title={Font Awesome Regular}]
  \showsymbolset [fontawesome-regular]
\stopnamedsection

\startnamedsection [title] [title={Font Awesome Solid}]
  \showsymbolset [fontawesome-solid]
\stopnamedsection

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

[NTG-context] Font Awesome (again)

2018-10-07 Thread Aditya Mahajan

Hi,

There is a FontAwesome.otf file that is distributed with ConTeXt minimals. 
Does anyone know what version (4 or 5) of the font it is? I am asking 
because the names of the symbols used in the font do not match those on 
the font-awesome website. For example, using


\showsymbolset[fontawesome]

I get that the symbol for "utensils" 
(https://fontawesome.com/icons/utensils?style=solid) is actually mapped to 
"food" in ConTeXt. Since the names of the symbols are now taken from the 
font, my guess is that the distribution has an old version of the font 
(also because it is a single font rather than three).


Would it make sense to update the fonts in the distribution? If not, then 
simply remove the old version of the fonts?


Also, don't we need to update the symb-imp-fontawesome.mkiv file to work 
with the new symbols. Font awesome has split the fonts into three

(https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started):
Solid, Regular, and Brands. (There are also pro version of the fonts). The 
simplest way to use them will be to have three symbolsets (fontawesome, 
fontawesome-solid, and fontawesome-brands), where the names are taken from 
the fonts.


In the meanwhile, Hraban has painstakenly written out the mappings by 
hand, but the automatic mapping might be simpler (and more future proof).

https://github.com/fiee/ConTeXt/blob/master/symbols/symb-awesome5.mkiv

Thanks,
Aditya

___
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] Homebrew packaging for macOS

2018-10-07 Thread Hans Åberg

> On 7 Oct 2018, at 12:45, Hans Hagen  wrote:
> 
> On 10/7/2018 10:56 AM, Hans Åberg wrote:
>>> On 7 Oct 2018, at 01:32, Hans Hagen  wrote:
>>> 
>>> On 10/7/2018 1:24 AM, Andrew Dunning wrote:
 Dear list,
 Has anyone ever looked into packaging ConTeXt for Homebrew on macOS (see 
 )? Providing it as an installation option would make it 
 far easier to obtain the latest version.
>>> 
>>> How do you now update? It's just one recall to first-setup.sh
>> It would be better to put the development version in TeXLive as a separate 
>> package—on MacOS, it comes with the TeX Live Utility which gives update 
>> notifications frequently, once a week, but one can run it more frequently by 
>> hand. Just give it a different name than from the ordinary distribution, say 
>> context-.
>> When I used the beta, it was difficult to switch with other TeX software. So 
>> this might be better.
> hm, you can install context alongside texlive and just change the path as 
> everything else is picked up from that (also a lightweight context 
> distribution is normally faster than context in texlive)

I don't recall the problem, maybe using LuaTeX in another context that ConTeXt, 
so having to keep track of that switch.

> (till now we only update context in telive once per year and i don't know if 
> mojca pushes the latest context in there for the updating; till now often it 
> went in sync with a luatex update)

I get weekly update update notices from the TeX Live Utility, so it seems 
working fine at that end.


___
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] context and sqlite - here is the code

2018-10-07 Thread luigi scarso
On Sun, Oct 7, 2018 at 9:35 AM Jörg Hofmann  wrote:

> Hallo Hans,
> hallo Luigi,
>
> Am Samstag, den 06.10.2018, 20:01 +0200 schrieb Jörg Hofmann:
> > I've been trying to connect ConTeXt to sqlite for almost a week
> > but I have repeatedly failed. Neither the
> > "internal" variant according to the documentation, nor the attempt on
> > luasql
> > have worked. Above all, the Google request showed me that
> > not alone with this problem - how reassuring. ;-)
> >
> > At the moment, concentrate I am accessing via swiglib and think my
> > problem lies here (from my log file):
> >
> > sql> start loading method 'sqlite'
> > swiglib> unknown: 'swiglib.sqlite.core'
> > swiglib> unknown: 'swiglib.helpers.core'
>
>
hm,  sqlite uses luaffi, not swiglib.

Put libsqlite3.so  in the same folder of your example, and rename it
as sqlite3.so

Then put in your example
\setuppapersize[A4]
\enabletrackers[resolvers.ffilib]
\enabletrackers[sql.trace]
\enabletrackers[sql.queries]

I think that at least you should see something like
found: '//sqlite3.so'

-- 
luigi
___
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] filling overlap ?

2018-10-07 Thread Floris van Manen
so digging a little deeper brings me this solution:

path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
q := q shifted (3mm, -2mm);
path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
r := r shifted (0mm, -4mm);

fill p withcolor red ;
clip currentpicture to q ;
clip currentpicture to r ;

draw p ;
draw q ;
draw r ;




> On 7 Oct 2018, at 13:19, Mikael P. Sundqvist  wrote:
> 
> On Sun, Oct 7, 2018 at 1:10 PM Floris van Manen  wrote:
>> 
>> Could someone point me to te way as how to fill only the overlap of three 
>> paths using metafun ?
>> 
>> path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
>> path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
>> q := q shifted (3mm, -2mm);
>> path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
>> r := r shifted (0mm, -4mm);
>> draw p ;
>> draw q ;
>> draw r ;
>> 
>> 
>> 
>> Thanks
>> .Floris
>> 
>> ___
>> 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
>> ___
> 
> Hi!
> 
> This is something similar as in page 304 of the manual
> http://www.pragma-ade.com/general/manuals/metafun-p.pdf
> 
> \startMPpage
> path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
> path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
> q := q shifted (3mm, -2mm);
> path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
> r := r shifted (0mm, -4mm);
> path pr,pqr;
> pr = buildcycle(p, r);
> %fill pr withcolor 0.5white;
> pqr = buildcycle(q,pr) ;
> fill pqr withcolor darkyellow;
> draw p ;
> draw q withcolor darkred;
> draw r withcolor darkblue;
> \stopMPpage
> 
> /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
> ___



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] filling overlap ?

2018-10-07 Thread Floris van Manen
thanks !
.F



> 
> Hi!
> 
> This is something similar as in page 304 of the manual
> http://www.pragma-ade.com/general/manuals/metafun-p.pdf
> 
> \startMPpage
> path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
> path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
> q := q shifted (3mm, -2mm);
> path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
> r := r shifted (0mm, -4mm);
> path pr,pqr;
> pr = buildcycle(p, r);
> %fill pr withcolor 0.5white;
> pqr = buildcycle(q,pr) ;
> fill pqr withcolor darkyellow;
> draw p ;
> draw q withcolor darkred;
> draw r withcolor darkblue;
> \stopMPpage
> 
> /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] filling overlap ?

2018-10-07 Thread Mikael P. Sundqvist
On Sun, Oct 7, 2018 at 1:10 PM Floris van Manen  wrote:
>
> Could someone point me to te way as how to fill only the overlap of three 
> paths using metafun ?
>
> path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
> path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
> q := q shifted (3mm, -2mm);
> path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
> r := r shifted (0mm, -4mm);
> draw p ;
> draw q ;
> draw r ;
>
>
>
> Thanks
> .Floris
>
> ___
> 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
> ___

Hi!

This is something similar as in page 304 of the manual
http://www.pragma-ade.com/general/manuals/metafun-p.pdf

\startMPpage
path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
q := q shifted (3mm, -2mm);
path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
r := r shifted (0mm, -4mm);
path pr,pqr;
pr = buildcycle(p, r);
%fill pr withcolor 0.5white;
pqr = buildcycle(q,pr) ;
fill pqr withcolor darkyellow;
draw p ;
draw q withcolor darkred;
draw r withcolor darkblue;
\stopMPpage

/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
___

[NTG-context] filling overlap ?

2018-10-07 Thread Floris van Manen
Could someone point me to te way as how to fill only the overlap of three paths 
using metafun ?

path p ; p := fullsquare xscaled 10mm yscaled 12mm superellipsed .7 ;
path q ; q := fullsquare xscaled  9mm yscaled 11mm superellipsed .7 ;
q := q shifted (3mm, -2mm);
path r ; r := fullsquare xscaled  8mm yscaled 10mm superellipsed .7 ;
r := r shifted (0mm, -4mm);
draw p ;
draw q ;
draw r ;



Thanks
.Floris



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] Homebrew packaging for macOS

2018-10-07 Thread Hans Hagen

On 10/7/2018 11:32 AM, Jan U. Hasecke wrote:

On 07.10.18 01:39, Andrew Dunning wrote:

I think it might be possible to get the script version into Homebrew Cask as it 
stands, but it would be nicer if it could get directly into Homebrew if that is 
possible.


This project
https://pi-hole.net/

has the install command line right on the front page.

I think we could have something like this on the frontpage of the wiki
for quick installation.

A script that does all this:

mkdir ~/context
cd ~/context
wget http://minimals.contextgarden.net/setup/first-setup.sh
sh ./first-setup.sh --modules=all


So people could install the latest beta with something like this:

curl http://minimals.contextgarden.net/setup/first-setup.sh | bash
but after that updating is just calling first-setup again, no need to 
reinstall


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] Homebrew packaging for macOS

2018-10-07 Thread Hans Hagen

On 10/7/2018 10:56 AM, Hans Åberg wrote:



On 7 Oct 2018, at 01:32, Hans Hagen  wrote:

On 10/7/2018 1:24 AM, Andrew Dunning wrote:

Dear list,
Has anyone ever looked into packaging ConTeXt for Homebrew on macOS (see 
)? Providing it as an installation option would make it far 
easier to obtain the latest version.


How do you now update? It's just one recall to first-setup.sh


It would be better to put the development version in TeXLive as a separate package—on 
MacOS, it comes with the TeX Live Utility which gives update notifications 
frequently, once a week, but one can run it more frequently by hand. Just give it a 
different name than from the ordinary distribution, say context-.

When I used the beta, it was difficult to switch with other TeX software. So 
this might be better.
hm, you can install context alongside texlive and just change the path 
as everything else is picked up from that (also a lightweight context 
distribution is normally faster than context in texlive)


(till now we only update context in telive once per year and i don't 
know if mojca pushes the latest context in there for the updating; till 
now often it went in sync with a luatex update)


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] Homebrew packaging for macOS

2018-10-07 Thread Jan U. Hasecke
On 07.10.18 01:39, Andrew Dunning wrote:
> I think it might be possible to get the script version into Homebrew Cask as 
> it stands, but it would be nicer if it could get directly into Homebrew if 
> that is possible.

This project
https://pi-hole.net/

has the install command line right on the front page.

I think we could have something like this on the frontpage of the wiki
for quick installation.

A script that does all this:

mkdir ~/context
cd ~/context
wget http://minimals.contextgarden.net/setup/first-setup.sh
sh ./first-setup.sh --modules=all


So people could install the latest beta with something like this:

curl http://minimals.contextgarden.net/setup/first-setup.sh | bash


juh
___
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] Homebrew packaging for macOS

2018-10-07 Thread Hans Åberg

> On 7 Oct 2018, at 01:32, Hans Hagen  wrote:
> 
> On 10/7/2018 1:24 AM, Andrew Dunning wrote:
>> Dear list,
>> Has anyone ever looked into packaging ConTeXt for Homebrew on macOS (see 
>> )? Providing it as an installation option would make it far 
>> easier to obtain the latest version.
> 
> How do you now update? It's just one recall to first-setup.sh

It would be better to put the development version in TeXLive as a separate 
package—on MacOS, it comes with the TeX Live Utility which gives update 
notifications frequently, once a week, but one can run it more frequently by 
hand. Just give it a different name than from the ordinary distribution, say 
context-.

When I used the beta, it was difficult to switch with other TeX software. So 
this might be better.


___
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] context and sqlite - here is the code

2018-10-07 Thread Jörg Hofmann
Hallo Hans,
hallo Luigi,

Am Samstag, den 06.10.2018, 20:01 +0200 schrieb Jörg Hofmann:
> I've been trying to connect ConTeXt to sqlite for almost a week
> but I have repeatedly failed. Neither the
> "internal" variant according to the documentation, nor the attempt on
> luasql
> have worked. Above all, the Google request showed me that
> not alone with this problem - how reassuring. ;-)
> 
> At the moment, concentrate I am accessing via swiglib and think my
> problem lies here (from my log file):
> 
> sql> start loading method 'sqlite'
> swiglib> unknown: 'swiglib.sqlite.core'
> swiglib> unknown: 'swiglib.helpers.core'
> 
> Obviously, the appropriate modules are not found, but where
> Can I get them and where do they belong? And maybe
> also someone a working code example for me.
> I'm working with Texlive 2017 on XUBUNTU 16.04.
> 
> Best regards
> Jörg Hofmann
> _
> __
> 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/nt
> g-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> _
> __

Many thanks for your help. I have read both manuals but may not
understand it correctly. That's why I send my file and the log file.

Best regards
Jörgopen source > level 1, order 1, name '/usr/local/texlive/2017/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2017.05.15 21:48 MKIV beta  fmt: 2017.11.1  int: english/english
system  > 
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name '/usr/local/texlive/2017/texmf-dist/tex/context/base/mkiv/cont-new.mkiv'
close source> level 2, order 2, name '/usr/local/texlive/2017/texmf-dist/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'lua-test', input './lua-test', result 'lua-test'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/jorg/Dokumente/Projekte/ConTeXt - Test/lua-test.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
sql > start loading method 'sqlite'
swiglib > unknown: 'swiglib.sqlite.core'
swiglib > unknown: 'swiglib.helpers.core'

lua error   > lua error on line 64 in file /home/jorg/Dokumente/Projekte/ConTeXt - Test/lua-test.tex:

...texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua:36: attempt to index local 'sqlite' (a boolean value)
stack traceback:
	...texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua:36: in main chunk
	[C]: in function 'requiem'
	...live/2017/texmf-dist/tex/context/base/mkiv/l-sandbox.lua:180: in function <...live/2017/texmf-dist/tex/context/base/mkiv/l-sandbox.lua:165>
	(...tail calls...)
	...xlive/2017/texmf-dist/tex/context/base/mkiv/util-sql.lua:114: in function '__index'
	...xlive/2017/texmf-dist/tex/context/base/mkiv/util-sql.lua:288: in function 'execute'
	[ctxlua]:38: in main chunk

42 
43 -- ***
44 -- ** 1) intern mit swiglib 
45 -- ***
46 
47 require("util-sql")
48 utilities.sql.setmethod("sqlite")
49 
50 local presets = {
51database = db,
52 >> }
53 
54 local data, keys = utilities.sql.execute {
55presets = presets,
56template = abfrage,
57}
58 
59 context(data[titel])
60 context.crlf()
61 context(data[sachverhalt])
62 context.crlf()


? 

lua error   > lua error on line 64 in file /home/jorg/Dokumente/Projekte/ConTeXt - Test/lua-test.tex:

...texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua:36: attempt to index local 'sqlite' (a boolean value)
stack traceback:
	...texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua:36: in main chunk
	[C]: in function 'requiem'
	...live/2017/texmf-dist/tex/context/base/mkiv/l-sandbox.lua:180: in function <...live/2017/texmf-dist/tex/context/base/mkiv/l-sandbox.lua:165>
	(...tail calls...)
	...xlive/2017/texmf-dist/tex/context/base/mkiv/util-sql.lua:114: in function '__index'
	...xlive/2017/texmf-dist/tex/context/base/mkiv/util-sql.lua:288: in function 'execute'
	[ctxlua]:38: in main chunk

42 
43 -- ***
44 -- ** 1) intern mit swiglib 
45 -- *