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
___

[NTG-context] references.bookmarks.preroll and quotation

2016-12-20 Thread Christoph Reller
Hi,

I have the following MWE:

\setupinteraction[state=start]
\placebookmarks[chapter]
\enabledirectives[references.bookmarks.preroll]
\starttext
\startchapter[title=B \quotation{C} D]
  \input ward
\stopchapter
\stoptext

The generated bookmark has wrongly placed spaces:

B“ C ” D

Without the directive references.bookmarks.preroll, the bookmark is:

B "C" D

I need this directive because in titles I use macros that use
\autoinsertnextspace.

Is this a bug?

Any feedback is welcome.

Cheers,
Christoph
___
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
___

[NTG-context] \copypages and page numbering

2016-12-20 Thread Andrea Valle
Dear all,

I’m assembling into a unique pdf the proceedings of a conference.
They have been created by various sw (latex, word, writer etc).
In order to include the papers, I’m just using a series of commands like

\copypages[CIMXXI_contributi/dapelo][][scale=950]

They are not provided with page numbers, and I’m including them in the usual 
way.
Now, most of the time it just works.
All the papers should conform to a template, but in some cases, page numbers 
are not displayed, and this depends on the fact that the page setup in that 
paper has a greater height (or maybe a different crop area), so that it covers 
the page number.
I would simply solve the problem by having the page number on top of the 
imported pdf.
Is it possible?

Many thanks

-a-
 

--
Andrea Valle
--
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--> andrea.va...@unito.it
--

"This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a 
lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)

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