Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Aditya Mahajan

On Sat, 24 Dec 2016, Jaroslav Hajtmar wrote:

It seems now, that everything at this time works as intended. Many 
thanks for your support. Below is a minimal example. Attached is a PDF 
sample result.


Nice to know that it works.

I tried also to experiment with the choice "object = no", as suggested 
by Hans, but without success.


Note that it is "object=no" (without spaces around equal to)


I would asking if you make any changes in filter module?
Or have I misunderstood Your opinion?


I will add the code between \unprotect ... \protect to the filter module after
I have tested it a bit more thoroughly.

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] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
Hello Adytia.
It seems now, that everything at this time works as intended. Many thanks for 
your support. Below is a minimal example. Attached is a PDF sample result.
I tried also to experiment with the choice "object = no", as suggested by Hans, 
but without success. I would asking  if you make any changes in filter module?
Or have I misunderstood Your opinion? 
Thank you once again
Jaroslav Hajtmar


Here is minimal example:

\usemodule[filter]

\unprotect
\appendtoks
   \setuevalue{set\currentexternalfilter 
buffer}{\externalfilter@set[\currentexternalfilter]}%
\to \everydefineexternalfilter

\unexpanded\def\externalfilter@set
   {\dodoubleargument\externalfiter@set_indeed}

\starttexdefinition externalfiter@set_indeed [#1][#2]#3
% #1 = filter
% #2 = options

\begingroup
\edef\currentexternalfilter{#1}

\setupexternalfilter[#1][\c!name=,#2]

\externalfilter@set_filenames
\setbuffer[\externalfilter@buffer_name]#3\endbuffer

\externalfilter@process_filter
  \stoptexdefinition
\protect

\defineexternalfilter
   [ASY]
   [
 filtercommand={asy -tex context \externalfilterinputfile\space -o 
\externalfilteroutputfile}, output=\externalfilterbasefile.pdf,
 purge=no, 
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\define[1]\mycircle{
\setASYbuffer{
import graph;
draw(Circle((0,0),#1));
}}


\starttext

\startASY
 import graph;
 draw((0,0)--(100,100));
\stopASY

\mycircle{10}

\mycircle{20}

\mycircle{30}

\stoptext







Dne 23.12.16 20:22, ntg-context za uživatele Aditya Mahajan 
 napsal(a):

On Fri, 23 Dec 2016, Jaroslav Hajtmar wrote:

> Thanks for sending Your code. It seems that it works with Asymptote. 
> Unfortunately, when I am trying to multiple call a macro then I get 
> fatal error, and then compile collapse. I do not know what it could be.

When called for the first time, the code generates test-ASY.pdf file and 
includes it. After the second call, a new test-ASY.pdf is generated. 
ConTeXt generates an error because the name of the files is the same, but 
the content is not.

There should be an option for \externalfigure to disable this check, but I 
couldn't find it. Here is an alternative approach, that changes the name 
of the PDF.

\usemodule[filter]

\unprotect
\appendtoks
   \setuevalue{set\currentexternalfilter 
buffer}{\externalfilter@set[\currentexternalfilter]}%
\to \everydefineexternalfilter

\unexpanded\def\externalfilter@set
   {\dodoubleargument\externalfiter@set_indeed}

\starttexdefinition externalfiter@set_indeed [#1][#2]#3
% #1 = filter
% #2 = options

\begingroup
\edef\currentexternalfilter{#1}

\setupexternalfilter[#1][\c!name=,#2]

\externalfilter@set_filenames
\setbuffer[\externalfilter@buffer_name]#3\endbuffer

\externalfilter@process_filter
  \stoptexdefinition
\protect

\defineexternalfilter
 [MARKDOWN]
 [
   filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
   cache=yes,
   purge=no,
 ]

\define[1]\NEW
 {\setMARKDOWNbuffer{This is #1}}

\traceexternalfilters

\starttext
\startMARKDOWN
   This is **one**
\stopMARKDOWN

\NEW{**ONE**}

\NEW{_TWO_}
\stoptext

Note that this has the same limitation as using \type{...}. The contents of
\NEW{...} must have matched braces. If this works, I can include the code in
t-filter (mkiv only, as I no longer want to maintain the mkii branch).

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

___



AsymptoteCodeInConTeXt03a-Adytia.pdf
Description: AsymptoteCodeInConTeXt03a-Adytia.pdf
___
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] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Hans Hagen

On 12/23/2016 8:22 PM, Aditya Mahajan wrote:

On Fri, 23 Dec 2016, Jaroslav Hajtmar wrote:


Thanks for sending Your code. It seems that it works with Asymptote.
Unfortunately, when I am trying to multiple call a macro then I get
fatal error, and then compile collapse. I do not know what it could be.


When called for the first time, the code generates test-ASY.pdf file and
includes it. After the second call, a new test-ASY.pdf is generated.
ConTeXt generates an error because the name of the files is the same,
but the content is not.

There should be an option for \externalfigure to disable this check, but
I couldn't find it. Here is an alternative approach, that changes the
name of the PDF.


object=no should work but even then, the backend can keep files open and 
flush later


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] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Aditya Mahajan

On Fri, 23 Dec 2016, Jaroslav Hajtmar wrote:

Thanks for sending Your code. It seems that it works with Asymptote. 
Unfortunately, when I am trying to multiple call a macro then I get 
fatal error, and then compile collapse. I do not know what it could be.


When called for the first time, the code generates test-ASY.pdf file and 
includes it. After the second call, a new test-ASY.pdf is generated. 
ConTeXt generates an error because the name of the files is the same, but 
the content is not.


There should be an option for \externalfigure to disable this check, but I 
couldn't find it. Here is an alternative approach, that changes the name 
of the PDF.


\usemodule[filter]

\unprotect
\appendtoks
  \setuevalue{set\currentexternalfilter 
buffer}{\externalfilter@set[\currentexternalfilter]}%
\to \everydefineexternalfilter

\unexpanded\def\externalfilter@set
  {\dodoubleargument\externalfiter@set_indeed}

\starttexdefinition externalfiter@set_indeed [#1][#2]#3
   % #1 = filter
   % #2 = options

   \begingroup
   \edef\currentexternalfilter{#1}

   \setupexternalfilter[#1][\c!name=,#2]

   \externalfilter@set_filenames
   \setbuffer[\externalfilter@buffer_name]#3\endbuffer

   \externalfilter@process_filter
 \stoptexdefinition
\protect

\defineexternalfilter
[MARKDOWN]
[
  filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
  cache=yes,
  purge=no,
]

\define[1]\NEW
{\setMARKDOWNbuffer{This is #1}}

\traceexternalfilters

\starttext
\startMARKDOWN
  This is **one**
\stopMARKDOWN

\NEW{**ONE**}

\NEW{_TWO_}
\stoptext

Note that this has the same limitation as using \type{...}. The contents of
\NEW{...} must have matched braces. If this works, I can include the code in
t-filter (mkiv only, as I no longer want to maintain the mkii branch).

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] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
Hello Adytia.
Thanks for sending Your code. It seems that it works with Asymptote. 
Unfortunately, when I am trying to multiple call a macro then I get fatal 
error, and then compile collapse. I do not know what it could be. Is it 
possible that my code is wrong. But it is possible that there is a stack 
overflow etc. It would be a need to look at why the fatal error occurs - It 
probably can evaluate Hans. Thanks again for your support. Below is my code. If 
removed commentary characters occurs advised error.

Jaroslav Hajtmar


\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
 filtercommand={asy -tex context \externalfilterinputfile\space -o 
\externalfilteroutputfile}, output=\externalfilterbasefile.pdf,
 purge=no, 
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\define[1]\mycircle{
#1 - XXX
\setbuffer[ASY]
import graph;
draw(Circle((0,0),#1));
\endbuffer
\processASYbuffer[ASY]
}

\starttext
AAA
\startASY
import graph;
draw((0,0)--(100,100));
\stopASY

BBB
\mycircle{100}


%CCC
%\mycircle{50}

%DDD
%\mycircle{200}

\stoptext





Dne 22.12.16 5:49, ntg-context za uživatele Aditya Mahajan 
 napsal(a):

On Tue, 20 Dec 2016, Jaroslav Hajtmar wrote:

> very much for your Metapost example. This I certainly sufficient for the 
> production of simple images for my ideas.

> \define[1]\mycircle{
>   \startASY
>   import graph;
>   draw(Circle((0,0),#1));
>   \stopASY
> }
>
> \starttext
> \mycircle{20}
> \mycircle{30}
> \mycircle{40}
> \stoptext

It is already feasible to define something this simple using the filter 
module. I don't have asymptote installed on the machine that I am 
currently working on, but here is an example that uses pandoc.

\usemodule[filter]

\defineexternalfilter
 [MARKDOWN]
 [
   filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
   cache=yes,
   purge=no, % Just for testing. May be removed.
 ]

\define[1]\TEST
 {\setbuffer[MARKDOWN]This is #1\endbuffer
  \processMARKDOWNbuffer[MARKDOWN]}

\starttext
\startMARKDOWN
   This is **one**
\stopMARKDOWN

\TEST{**ONE**}

\TEST{_TWO_}
\stoptext

With this method, the results are not cached. Let me know if this works 
for your needs.

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

___

___
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] Asymptote or Metapost and ConTeXt parameters.

2016-12-21 Thread Aditya Mahajan

On Tue, 20 Dec 2016, Jaroslav Hajtmar wrote:

very much for your Metapost example. This I certainly sufficient for the 
production of simple images for my ideas.



\define[1]\mycircle{
\startASY
import graph;
draw(Circle((0,0),#1));
\stopASY
}

\starttext
\mycircle{20}
\mycircle{30}
\mycircle{40}
\stoptext


It is already feasible to define something this simple using the filter 
module. I don't have asymptote installed on the machine that I am 
currently working on, but here is an example that uses pandoc.


\usemodule[filter]

\defineexternalfilter
[MARKDOWN]
[
  filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
  cache=yes,
  purge=no, % Just for testing. May be removed.
]

\define[1]\TEST
{\setbuffer[MARKDOWN]This is #1\endbuffer
 \processMARKDOWNbuffer[MARKDOWN]}

\starttext
\startMARKDOWN
  This is **one**
\stopMARKDOWN

\TEST{**ONE**}

\TEST{_TWO_}
\stoptext

With this method, the results are not cached. Let me know if this works 
for your needs.


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] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Aditya Mahajan

On Tue, 20 Dec 2016, Alan Braslau wrote:


On Mon, 19 Dec 2016 08:19:25 -0800
Aditya Mahajan  wrote:


The ability to pass parameters to metapost has been around since the
beginning. See the metafun manual for details (search for MPvar).


Hans has developed tools making it quite easy to pass data back and
forth between MetaPost and lua. This is quite efficient, and it is
being used more and more in the development of macro functionality.


Thanks. It has been a few years since I read the ConTeXt+MP related part 
of the source. I'll look again to see how MP-Lua interface is developed.


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] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Alan Braslau
On Mon, 19 Dec 2016 08:19:25 -0800
Aditya Mahajan  wrote:

> The ability to pass parameters to metapost has been around since the 
> beginning. See the metafun manual for details (search for MPvar).

Hans has developed tools making it quite easy to pass data back and
forth between MetaPost and lua. This is quite efficient, and it is
being used more and more in the development of macro functionality.

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] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Jaroslav Hajtmar
Thanx Aditya 
very much for your Metapost example. This I certainly sufficient for the 
production of simple images for my ideas. I attach source code, which outlines 
how I imagined inserting Asymptote images into Context. In the lower part of 
commented code is fully functional, compiled ConTEXt of TeX Live 2016 (included 
in the package is also Asymptote). My idea is that Asymptote code is part of my 
ConTeXt macro and parameters of macro are passed into Asymptote. My example 
does not work because Asymptote is probably not enough linked with Context. I 
am very grateful that You would to deal with my problem. 

I am not sure whether it will do Asymptote example as in the case Metapost. 
That's why I use  filter in my own example (taken from 
https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html ).


Thank you once again.

Jaroslav Hajtmar



\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
 filter={asy -tex "context" -outformat pdf
 -outname \externalfilteroutputfile},
 output=\externalfilterbasefile.pdf,
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\define[1]\mycircle{
\startASY
import graph;
draw(Circle((0,0),#1));
\stopASY
}

\starttext
\mycircle{20}
\mycircle{30}
\mycircle{40}
\stoptext


%% simple asymptote example (compiled ConTeXt (LuaTeX) from TeX Live 2016)
%
%\usemodule[filter]
%
%\defineexternalfilter
%   [ASY]
%   [
% filter={asy -tex "context" -outformat pdf
% -outname \externalfilteroutputfile},
% output=\externalfilterbasefile.pdf,
% cache=yes,
% readcommand=\ReadImage,
%   ]
%
%\define[1]\ReadImage{\externalfigure[#1]}
%
%\starttext
%\startASY
%import graph;
%draw(Circle((0,0),20));
%\stopASY
%\stoptext


Dne 19.12.16 17:19, ntg-context za uživatele Aditya Mahajan 
 napsal(a):

On Mon, 19 Dec 2016, Jaroslav Hajtmar wrote:

> There is a similar possibility, at least in Metapost? For simpler 
> pictures it would probably suffice 

The ability to pass parameters to metapost has been around since the 
beginning. See the metafun manual for details (search for MPvar). For 
simple images, you can also do:

\define[1]\Circle{\startMPcode draw fullcircle scaled #1*cm; \stopMPcode}

\Circle{1} \Circle{2} \Circle{3}

> Is there a way to pass the ConTeXt parameter which influenced the 
> creation of the Asymptote image? My point eg. the ability to define 
> macros, which gave its parameters to Asymptote procedure or function and 
> depending on these parameters, the image created by Asymptote looked 
> differently.

In principle, something similar to \MPvar can work for asymptote as well 
(or one could do parse the content in Lua rather than expand variables in 
TeX).

> Before starting work on an illustrative example I am asking, whether it 
> makes sense to deal with such a thing ... I suppose the impossibility of 
> combining asymptote code and such Lua code (or not?).

ConTeXt and Metapost are very well integrated, even in MkII. The same 
ideas could work with other graphic backends as well (Asymptote, tikz, and 
others). But it does require a good knowledge of the graphics package.

I am willing to write the code at the context end, if someone who knows 
asymptote can tell me what needs to be done at the asymptote end.

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

___

___
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] Asymptote or Metapost and ConTeXt parameters.

2016-12-19 Thread Aditya Mahajan

On Mon, 19 Dec 2016, Jaroslav Hajtmar wrote:

There is a similar possibility, at least in Metapost? For simpler 
pictures it would probably suffice 


The ability to pass parameters to metapost has been around since the 
beginning. See the metafun manual for details (search for MPvar). For 
simple images, you can also do:


\define[1]\Circle{\startMPcode draw fullcircle scaled #1*cm; \stopMPcode}

\Circle{1} \Circle{2} \Circle{3}

Is there a way to pass the ConTeXt parameter which influenced the 
creation of the Asymptote image? My point eg. the ability to define 
macros, which gave its parameters to Asymptote procedure or function and 
depending on these parameters, the image created by Asymptote looked 
differently.


In principle, something similar to \MPvar can work for asymptote as well 
(or one could do parse the content in Lua rather than expand variables in 
TeX).


Before starting work on an illustrative example I am asking, whether it 
makes sense to deal with such a thing ... I suppose the impossibility of 
combining asymptote code and such Lua code (or not?).


ConTeXt and Metapost are very well integrated, even in MkII. The same 
ideas could work with other graphic backends as well (Asymptote, tikz, and 
others). But it does require a good knowledge of the graphics package.


I am willing to write the code at the context end, if someone who knows 
asymptote can tell me what needs to be done at the asymptote end.


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] Asymptote or Metapost and ConTeXt parameters.

2016-12-19 Thread Hans Hagen

On 12/19/2016 10:10 AM, Fabrice Couvreur wrote:

Hello,
I do not answer the question, but I'm interested because I also use
Asymptote. The following code works with context in texlive 2016 but
does not work with standalone context.
thank you,


it probably depends on what you want to pass as info (i don't have 
asymptote installed nor time to check it) but if the code you pass gets 
expanded then you can add expandable macros or \the\foo kind of code to it


Hans


Fabrice
% macros=mkvi

\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
 filter={asy -tex "context" -outformat pdf
 -outname \externalfilteroutputfile},
 output=\externalfilterbasefile.pdf,
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\starttext
   Testing if we can include an asymptote image
   \startplacefigure[location={here}, title={An Asymptote figure}]
 \startASY
   import three;
size(8cm,0);
currentlight.background=black;

material White(real x, real y){
   return material(diffusepen=gray(.05+.1x+.3y),
   emissivepen=gray(.05+.1x+.3y));
}

for(int y=0; y<=2; ++y)
for(int x=0; x<3; ++x)
draw(shift(2x,2y,0)*unitsphere,White(x,y));
 \stopASY
   \stopplacefigure
\stoptext


2016-12-19 8:41 GMT+01:00 Jaroslav Hajtmar mailto:hajt...@gyza.cz>>:

Hello ConTeXtist,

I saw the opportunity to insert an Asymptote picture into Context
source code (due filter).

For example here:
https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html


__ __

Is there a way to pass the ConTeXt parameter which influenced the
creation of the Asymptote image? My point eg. the ability to define
macros, which gave its parameters to Asymptote procedure or function
and depending on these parameters, the image created by Asymptote
looked differently.

__ __

Before starting work on an illustrative example I am asking, whether
it makes sense to deal with such a thing ... I suppose the
impossibility of combining asymptote code and such Lua code (or
not?).

__ __

There is a similar possibility, at least in Metapost? For simpler
pictures it would probably suffice 

__ __

Thanx 

Jaroslav Hajtmar

__ __



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




--

-
  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] Asymptote or Metapost and ConTeXt parameters.

2016-12-19 Thread Fabrice Couvreur
Hello,
I do not answer the question, but I'm interested because I also use
Asymptote. The following code works with context in texlive 2016 but does
not work with standalone context.
thank you,
Fabrice
% macros=mkvi

\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
 filter={asy -tex "context" -outformat pdf
 -outname \externalfilteroutputfile},
 output=\externalfilterbasefile.pdf,
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\starttext
   Testing if we can include an asymptote image
   \startplacefigure[location={here}, title={An Asymptote figure}]
 \startASY
   import three;
size(8cm,0);
currentlight.background=black;

material White(real x, real y){
   return material(diffusepen=gray(.05+.1x+.3y),
   emissivepen=gray(.05+.1x+.3y));
}

for(int y=0; y<=2; ++y)
for(int x=0; x<3; ++x)
draw(shift(2x,2y,0)*unitsphere,White(x,y));
 \stopASY
   \stopplacefigure
\stoptext


2016-12-19 8:41 GMT+01:00 Jaroslav Hajtmar :

> Hello ConTeXtist,
>
> I saw the opportunity to insert an Asymptote picture into Context source
> code (due filter).
>
> For example here: https://mailman.ntg.nl/pipermail/ntg-context/2015/
> 080581.html
>
>
>
> Is there a way to pass the ConTeXt parameter which influenced the creation
> of the Asymptote image? My point eg. the ability to define macros, which
> gave its parameters to Asymptote procedure or function and depending on
> these parameters, the image created by Asymptote looked differently.
>
>
>
> Before starting work on an illustrative example I am asking, whether it
> makes sense to deal with such a thing ... I suppose the impossibility of
> combining asymptote code and such Lua code (or not?).
>
>
>
> There is a similar possibility, at least in Metapost? For simpler pictures
> it would probably suffice 
>
>
>
> Thanx
>
> Jaroslav Hajtmar
>
>
>
> 
> ___
> 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
___

[NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-18 Thread Jaroslav Hajtmar
Hello ConTeXtist,
I saw the opportunity to insert an Asymptote picture into Context source code 
(due filter).
For example here: https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html

Is there a way to pass the ConTeXt parameter which influenced the creation of 
the Asymptote image? My point eg. the ability to define macros, which gave its 
parameters to Asymptote procedure or function and depending on these 
parameters, the image created by Asymptote looked differently.

Before starting work on an illustrative example I am asking, whether it makes 
sense to deal with such a thing ... I suppose the impossibility of combining 
asymptote code and such Lua code (or not?).

There is a similar possibility, at least in Metapost? For simpler pictures it 
would probably suffice 

Thanx
Jaroslav Hajtmar

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