Re: [NTG-context] Graphics placement with columnsets/page grids (was "no subject)

2019-07-28 Thread Denis Maier
Ok, I have now tested a more minimal example with version in TL 2019 and
with the current standalone.
The example works perfectly with the version that was included in TL 2019
(2019.03.21 21:39).
In the current beta I get this behaviour: A figure on a page after page 1
does not stick to the bottom of the page if we have no caption.

```
\usemodule[newcolumnsets]

\setuplayout
  [grid=yes]

\definecolumnset[example][n=2]

\starttext

\startcolumnset[example]

\dorecurse{11}{
  \input ward\par
}

\placefigure [btrl,none]
{}
{
\externalfigure[placeholder][width=\columnsetspanwidth{2}]
}

\dorecurse{10}{
  \input ward\par
}



\stopcolumnset
\stoptext
```

Is this a bug, or am I making a mistake somewhere?

Best,
Denis

Am Mi., 24. Juli 2019 um 09:08 Uhr schrieb Denis Maier :

> Hi,
>
> just a quick follow up:
>
> This (i.e., deleting the "none") gives the right result:
>
> ```
> \placefigure [btrl]
> {}
> {
> \externalfigure[placeholder][width=\columnsetspanwidth{2}]
> }
> ```
>
> The figure is indeed at the bottom of the page. Yet, `\placefigure
> [btrl,none]` seems to remove the caption, but the figure stays where it was
> and we have additional lines under the figure. Shouldn't the figure stick
> to the margin?
>
> Best,
> Denis
>
>
> Am Di., 23. Juli 2019 um 16:16 Uhr schrieb Denis Maier  >:
>
>> Hi,
>> I am typesetting a newsletter using newcolumnsets, and I am struggling
>> with placing my graphics. Why isn't the graphic on page 2 at the bottom
>> (code below)?
>> Best,
>> Denis
>>
>> ```
>> \usemodule[newcolumnsets,simulate]
>>
>> \useMPlibrary[dum]
>>
>> \setupbodyfont
>> [palatino]
>>
>> \setuphead[section][style=\bfa\ss]
>>
>> \setuplayout
>> [grid=yes]
>>
>> \setuplayout
>> [backspace=20mm,
>> cutspace=15mm,
>> width=middle,
>> height=middle]
>>
>> \setupsystem
>> [random=1234]
>>
>> \setuppagenumbering [
>> alternative=,
>> location=,
>> ]
>>
>> \setupfootertexts
>> [Laubblatt 2019/1] [{\externalfigure[cow][height=15mm]}]
>>
>> \setupfooter
>> [style=\ss]
>>
>> \setuptolerance
>> [verytolerant,stretch]
>>
>> \definecolor[color-1][.5(red,green)]
>> \definecolor[color-2][.5(green,blue)]
>> \definecolor[color-3][.5(blue,red)]
>> \definecolor[color-4][.5(white,black)]
>> \definecolor[color-5][.5(white,color-4)]
>>
>> \startuniqueMPgraphic{frame}
>> fill OverlayBox withcolor \MPcolor{color-1} ;
>> \stopuniqueMPgraphic
>>
>> \startuniqueMPgraphic{contrast}
>> fill OverlayBox withcolor \MPcolor{color-2} ;
>> \stopuniqueMPgraphic
>>
>> \defineoverlay[frame]   [\uniqueMPgraphic{frame}]
>> \defineoverlay[contrast][\uniqueMPgraphic{contrast}]
>>
>> \definecolumnset[example][n=2]
>>
>> %\setupcolumnsetstart[example][1][1][2]
>> %\setupcolumnsetstart[example][1][2][4]
>> %\setupcolumnsetlines[example][1][1][-5]
>> %\setupcolumnsetlines[example][1][2][-5]
>>
>>
>>
>> \definecolumnsetspan[wide] [n=2,
>> background=contrast,
>> color=white,
>> ]
>>
>>
>> \starttext
>>
>> \startcolumnset[example]
>>
>>
>>
>> \startcolumnsetspan[wide]
>> \subject{Einleitung}
>> {\tfx\setupinterlinespace\em
>> \dorecurse{1}{\fakewords{50}{100}\par}
>> }
>> \stopcolumnsetspan
>>
>> \placefigure [btrl,none]
>> {}
>> {
>> \externalfigure[placeholder][width=\columnsetspanwidth{1}]
>> }
>>
>> \dorecurse{5}{\fakewords{50}{100}\par}
>>
>> \placefigure [btrl,none]
>> {}
>> {
>> \externalfigure[placeholder][width=\columnsetspanwidth{2}]
>> }
>>
>> \dorecurse{5}{\fakewords{50}{100}\par}
>>
>> \stopcolumnset
>> \stoptext
>> ```
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Graphics placement with columnsets/page grids (was "no subject)

2019-07-24 Thread Denis Maier
Hi,

just a quick follow up:

This (i.e., deleting the "none") gives the right result:

```
\placefigure [btrl]
{}
{
\externalfigure[placeholder][width=\columnsetspanwidth{2}]
}
```

The figure is indeed at the bottom of the page. Yet, `\placefigure
[btrl,none]` seems to remove the caption, but the figure stays where it was
and we have additional lines under the figure. Shouldn't the figure stick
to the margin?

Best,
Denis


Am Di., 23. Juli 2019 um 16:16 Uhr schrieb Denis Maier :

> Hi,
> I am typesetting a newsletter using newcolumnsets, and I am struggling
> with placing my graphics. Why isn't the graphic on page 2 at the bottom
> (code below)?
> Best,
> Denis
>
> ```
> \usemodule[newcolumnsets,simulate]
>
> \useMPlibrary[dum]
>
> \setupbodyfont
> [palatino]
>
> \setuphead[section][style=\bfa\ss]
>
> \setuplayout
> [grid=yes]
>
> \setuplayout
> [backspace=20mm,
> cutspace=15mm,
> width=middle,
> height=middle]
>
> \setupsystem
> [random=1234]
>
> \setuppagenumbering [
> alternative=,
> location=,
> ]
>
> \setupfootertexts
> [Laubblatt 2019/1] [{\externalfigure[cow][height=15mm]}]
>
> \setupfooter
> [style=\ss]
>
> \setuptolerance
> [verytolerant,stretch]
>
> \definecolor[color-1][.5(red,green)]
> \definecolor[color-2][.5(green,blue)]
> \definecolor[color-3][.5(blue,red)]
> \definecolor[color-4][.5(white,black)]
> \definecolor[color-5][.5(white,color-4)]
>
> \startuniqueMPgraphic{frame}
> fill OverlayBox withcolor \MPcolor{color-1} ;
> \stopuniqueMPgraphic
>
> \startuniqueMPgraphic{contrast}
> fill OverlayBox withcolor \MPcolor{color-2} ;
> \stopuniqueMPgraphic
>
> \defineoverlay[frame]   [\uniqueMPgraphic{frame}]
> \defineoverlay[contrast][\uniqueMPgraphic{contrast}]
>
> \definecolumnset[example][n=2]
>
> %\setupcolumnsetstart[example][1][1][2]
> %\setupcolumnsetstart[example][1][2][4]
> %\setupcolumnsetlines[example][1][1][-5]
> %\setupcolumnsetlines[example][1][2][-5]
>
>
>
> \definecolumnsetspan[wide] [n=2,
> background=contrast,
> color=white,
> ]
>
>
> \starttext
>
> \startcolumnset[example]
>
>
>
> \startcolumnsetspan[wide]
> \subject{Einleitung}
> {\tfx\setupinterlinespace\em
> \dorecurse{1}{\fakewords{50}{100}\par}
> }
> \stopcolumnsetspan
>
> \placefigure [btrl,none]
> {}
> {
> \externalfigure[placeholder][width=\columnsetspanwidth{1}]
> }
>
> \dorecurse{5}{\fakewords{50}{100}\par}
>
> \placefigure [btrl,none]
> {}
> {
> \externalfigure[placeholder][width=\columnsetspanwidth{2}]
> }
>
> \dorecurse{5}{\fakewords{50}{100}\par}
>
> \stopcolumnset
> \stoptext
> ```
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] graphics

2018-12-13 Thread Henri Menke

On 14/12/18 5:07 AM, luigi scarso wrote:
> On Thu, Dec 13, 2018 at 4:45 PM Alan Braslau 
> wrote:
> 
>> Of course, it is:
>>
>> double jn(int n,double x);
>>
>> and
>>
>> vardef jn(expr n, x) = scantokens(lua("mp.quoted( ffi.C.jn(" & decimal n &
>> "," & decimal x & "))")) enddef ;
>>
>> Alan
>>
>> (shows that I have yet to use jn ;-)
>>
> 
> I often use this as reference
> source/texk/web2c/luatexdir/luaffi/test.lua

I have some Gists on GitHub using the FFI.

Binding interpreters of other scripting languages (so far Python, R,
Guile, and Lua):
https://gist.github.com/hmenke/2d57a3aa1d3d59a265f935dd4b384c36

Rendering SVG to PDF using Cairo and rsvg2:
https://gist.github.com/hmenke/9facc3fe5ede9ed46c1838a919f7376f#file-svg-to-pdf-lua

---

Some of the code on GitHub was inspired by answers of mine on the
StackExchange network.  Here is a collection of answers using FFI.  All
the answers from TeX Stack Exchange use LaTeX.  ConTeXt is not so
popular there.

How to implement X11 code for LuaJIT's FFI?
https://stackoverflow.com/a/53689893

How to plot a function in integral form with TikZ?
https://tex.stackexchange.com/a/403797
https://tex.stackexchange.com/a/403794

Erf function in LaTeX
https://tex.stackexchange.com/a/407087

Plot a factorial function
https://tex.stackexchange.com/a/371899

Plot bessel functions
https://tex.stackexchange.com/a/368692
https://tex.stackexchange.com/a/456772
https://tex.stackexchange.com/a/160749

(Lua) LaTeX & HeVeA with partly generated things
https://tex.stackexchange.com/a/429994

How to include SVG diagrams in LaTeX?
https://tex.stackexchange.com/a/408014

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

2018-12-13 Thread luigi scarso
On Thu, Dec 13, 2018 at 4:45 PM Alan Braslau 
wrote:

> Of course, it is:
>
> double jn(int n,double x);
>
> and
>
> vardef jn(expr n, x) = scantokens(lua("mp.quoted( ffi.C.jn(" & decimal n &
> "," & decimal x & "))")) enddef ;
>
> Alan
>
> (shows that I have yet to use jn ;-)
>

I often use this as reference
source/texk/web2c/luatexdir/luaffi/test.lua

-- 
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] graphics

2018-12-13 Thread Alan Braslau
Of course, it is:

double jn(int n,double x);

and

vardef jn(expr n, x) = scantokens(lua("mp.quoted( ffi.C.jn(" & decimal n & "," 
& decimal x & "))")) enddef ;

Alan

(shows that I have yet to use jn ;-)


On Thu, 13 Dec 2018 14:32:39 +0100
Otared Kavian  wrote:

> Hi Mikael,
> 
> Thank you, as ell as Alan and Henri, for giving us a simple way to use Bessel 
> functions, directly in ConTeXt.
> However I have a question, which may show my total ignorance of the maths 
> libraries ffi and consorts: how do you specify the value of the integr $n$ 
> when you want to use $J_{n}(x)$?
> 
> Best regards: OK
> 
> > On 12 Dec 2018, at 21:13, Mikael P. Sundqvist  wrote:
> > 
> > On Wed, Dec 12, 2018 at 9:02 PM Henri Menke  wrote:  
> >> 
> >> On 13/12/18 8:56 AM, Alan Braslau wrote:  
> >>> On Wed, 12 Dec 2018 20:42:56 +0100
> >>> "Mikael P. Sundqvist"  wrote:  
>  
>  Thanks, Alan! That looks very promising. I could not make it work,
>  though, and I guess that is because I use linux and do not know what
>  to change for what. I installed libcerf but I assume something else is
>  missing. In any case, this is one of the things it would be nice to
>  have, at least as a module. I have no idea on how to realize that,
>  though.
>  
>  /Mikael  
> >>> 
> >>> You likely also need to install libffi - I do not know what package
> >>> this is on your flavor of linux - Luigi is the ffi specialist!  
> >> 
> >> FFI is integrated in LuaTeX >= 1.03
> >> 
> >> In you example you load libcerf but you are not using it.  What you are
> >> actually using are the Bessel function from the C Standard library.  GCC
> >> includes them as a GNU extension.
> >> https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-j0
> >> Your example also works if you remove libcerf (at least for me on Linux).
> >>   
> > 
> > Thanks Henri! Indeed it worked now. The following example (just in
> > case someone else did not get what to change) compiles here, and shows
> > the expected graph. This is very good news!
> > 
> > \startluacode
> > 
> > ffi = require("ffi")
> > ffi.cdef[[
> > double j0(double x);
> > double j1(double x);
> > double jn(double x);
> > ]]
> > 
> > \stopluacode
> > 
> > \startMPdefinitions{doublefun}
> >  vardef jzero primary x = scantokens(lua("mp.quoted( ffi.C.j0(" &
> > decimal x & "))")) enddef ;
> >  vardef jone  primary x = scantokens(lua("mp.quoted( ffi.C.j1(" &
> > decimal x & "))")) enddef ;
> >  vardef jnprimary x = scantokens(lua("mp.quoted( ffi.C.jn(" &
> > decimal x & "))")) enddef ;
> > \stopMPdefinitions
> > 
> > 
> > \starttext
> > \startMPpage[instance=doublefun]
> > draw function(1,"x","jone(x)",epsed(0),epsed(10),1/10) scaled 1cm;
> > \stopMPpage
> > \stoptext
> > 
> > /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
> ___
___
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] graphics

2018-12-13 Thread Otared Kavian
Hi Mikael,

Thank you, as ell as Alan and Henri, for giving us a simple way to use Bessel 
functions, directly in ConTeXt.
However I have a question, which may show my total ignorance of the maths 
libraries ffi and consorts: how do you specify the value of the integr $n$ when 
you want to use $J_{n}(x)$?

Best regards: OK

> On 12 Dec 2018, at 21:13, Mikael P. Sundqvist  wrote:
> 
> On Wed, Dec 12, 2018 at 9:02 PM Henri Menke  wrote:
>> 
>> On 13/12/18 8:56 AM, Alan Braslau wrote:
>>> On Wed, 12 Dec 2018 20:42:56 +0100
>>> "Mikael P. Sundqvist"  wrote:
 
 Thanks, Alan! That looks very promising. I could not make it work,
 though, and I guess that is because I use linux and do not know what
 to change for what. I installed libcerf but I assume something else is
 missing. In any case, this is one of the things it would be nice to
 have, at least as a module. I have no idea on how to realize that,
 though.
 
 /Mikael
>>> 
>>> You likely also need to install libffi - I do not know what package
>>> this is on your flavor of linux - Luigi is the ffi specialist!
>> 
>> FFI is integrated in LuaTeX >= 1.03
>> 
>> In you example you load libcerf but you are not using it.  What you are
>> actually using are the Bessel function from the C Standard library.  GCC
>> includes them as a GNU extension.
>> https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-j0
>> Your example also works if you remove libcerf (at least for me on Linux).
>> 
> 
> Thanks Henri! Indeed it worked now. The following example (just in
> case someone else did not get what to change) compiles here, and shows
> the expected graph. This is very good news!
> 
> \startluacode
> 
> ffi = require("ffi")
> ffi.cdef[[
> double j0(double x);
> double j1(double x);
> double jn(double x);
> ]]
> 
> \stopluacode
> 
> \startMPdefinitions{doublefun}
>  vardef jzero primary x = scantokens(lua("mp.quoted( ffi.C.j0(" &
> decimal x & "))")) enddef ;
>  vardef jone  primary x = scantokens(lua("mp.quoted( ffi.C.j1(" &
> decimal x & "))")) enddef ;
>  vardef jnprimary x = scantokens(lua("mp.quoted( ffi.C.jn(" &
> decimal x & "))")) enddef ;
> \stopMPdefinitions
> 
> 
> \starttext
> \startMPpage[instance=doublefun]
> draw function(1,"x","jone(x)",epsed(0),epsed(10),1/10) scaled 1cm;
> \stopMPpage
> \stoptext
> 
> /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] graphics

2018-12-12 Thread Henri Menke


On 13/12/18 10:39 AM, Alan Braslau wrote:
> On Thu, 13 Dec 2018 10:03:40 +1300
> Henri Menke  wrote:
> 
>> Sorry, my mistake, the Bessel functions are not a GCC extension but
>> POSIX standard functions.
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/j0.html
>> Since TeX Live is always built on a POSIX platform (MSYS2 on Windows),
>> you can expect j0 etc. to be available in LuaTeX.
> 
> That is true for the Bessel functions, but not for some other "-lmath"
> functions (such as the erf), so they may depend on the system.

erf definitely does not depend on the system.  That is part of the C
Standard library.
https://en.cppreference.com/w/c/numeric/math/erf

But in general you are right.  The zoo of special functions in the
Standard library and POSIX is rather limited.  Personally I prefer using
the GNU Scientific library if I need special functions.
https://www.gnu.org/software/gsl/doc/html/index.html

Earlier this year I wrote a TUGboat article about using GSL with FFI in
LuaTeX.
https://tug.org/TUGboat/tb39-1/tb121menke-ffi.pdf
I also plan on submitting an abstract about that topic for TUG2019 in
Palo Alto.

> 
> 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] graphics

2018-12-12 Thread Alan Braslau
On Thu, 13 Dec 2018 10:03:40 +1300
Henri Menke  wrote:

> Sorry, my mistake, the Bessel functions are not a GCC extension but
> POSIX standard functions.
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/j0.html
> Since TeX Live is always built on a POSIX platform (MSYS2 on Windows),
> you can expect j0 etc. to be available in LuaTeX.

That is true for the Bessel functions, but not for some other "-lmath"
functions (such as the erf), so they may depend on the system.

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] graphics

2018-12-12 Thread Henri Menke


On 13/12/18 9:12 AM, Alan Braslau wrote:
> On Thu, 13 Dec 2018 09:02:05 +1300
> Henri Menke  wrote:
> 
>> On 13/12/18 8:56 AM, Alan Braslau wrote:
>>> On Wed, 12 Dec 2018 20:42:56 +0100
>>> "Mikael P. Sundqvist"  wrote:  

 Thanks, Alan! That looks very promising. I could not make it work,
 though, and I guess that is because I use linux and do not know
 what to change for what. I installed libcerf but I assume
 something else is missing. In any case, this is one of the things
 it would be nice to have, at least as a module. I have no idea on
 how to realize that, though.

 /Mikael  
>>>
>>> You likely also need to install libffi - I do not know what package
>>> this is on your flavor of linux - Luigi is the ffi specialist!  
>>
>> FFI is integrated in LuaTeX >= 1.03
>>
>> In you example you load libcerf but you are not using it.  What you
>> are actually using are the Bessel function from the C Standard
>> library.  GCC includes them as a GNU extension.
>> https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-j0
>> Your example also works if you remove libcerf (at least for me on
>> Linux).
> 
> I had stripped-down my example, for in fact I use the voigt and error
> functions from libcerf, and yes the Bessel functions from the standard
> C math library. One should note, by the way, that the C math library is
> more or less complete depending on the system, and not everyone uses
> gcc nor gnu...

Sorry, my mistake, the Bessel functions are not a GCC extension but
POSIX standard functions.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/j0.html
Since TeX Live is always built on a POSIX platform (MSYS2 on Windows),
you can expect j0 etc. to be available in LuaTeX.

> 
> 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] graphics

2018-12-12 Thread Mikael P. Sundqvist
On Wed, Dec 12, 2018 at 9:02 PM Henri Menke  wrote:
>
> On 13/12/18 8:56 AM, Alan Braslau wrote:
> > On Wed, 12 Dec 2018 20:42:56 +0100
> > "Mikael P. Sundqvist"  wrote:
> >>
> >> Thanks, Alan! That looks very promising. I could not make it work,
> >> though, and I guess that is because I use linux and do not know what
> >> to change for what. I installed libcerf but I assume something else is
> >> missing. In any case, this is one of the things it would be nice to
> >> have, at least as a module. I have no idea on how to realize that,
> >> though.
> >>
> >> /Mikael
> >
> > You likely also need to install libffi - I do not know what package
> > this is on your flavor of linux - Luigi is the ffi specialist!
>
> FFI is integrated in LuaTeX >= 1.03
>
> In you example you load libcerf but you are not using it.  What you are
> actually using are the Bessel function from the C Standard library.  GCC
> includes them as a GNU extension.
> https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-j0
> Your example also works if you remove libcerf (at least for me on Linux).
>

Thanks Henri! Indeed it worked now. The following example (just in
case someone else did not get what to change) compiles here, and shows
the expected graph. This is very good news!

\startluacode

ffi = require("ffi")
ffi.cdef[[
double j0(double x);
double j1(double x);
double jn(double x);
]]

\stopluacode

\startMPdefinitions{doublefun}
  vardef jzero primary x = scantokens(lua("mp.quoted( ffi.C.j0(" &
decimal x & "))")) enddef ;
  vardef jone  primary x = scantokens(lua("mp.quoted( ffi.C.j1(" &
decimal x & "))")) enddef ;
  vardef jnprimary x = scantokens(lua("mp.quoted( ffi.C.jn(" &
decimal x & "))")) enddef ;
\stopMPdefinitions


\starttext
\startMPpage[instance=doublefun]
draw function(1,"x","jone(x)",epsed(0),epsed(10),1/10) scaled 1cm;
\stopMPpage
\stoptext

/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] graphics

2018-12-12 Thread Alan Braslau
On Thu, 13 Dec 2018 09:02:05 +1300
Henri Menke  wrote:

> On 13/12/18 8:56 AM, Alan Braslau wrote:
> > On Wed, 12 Dec 2018 20:42:56 +0100
> > "Mikael P. Sundqvist"  wrote:  
> >>
> >> Thanks, Alan! That looks very promising. I could not make it work,
> >> though, and I guess that is because I use linux and do not know
> >> what to change for what. I installed libcerf but I assume
> >> something else is missing. In any case, this is one of the things
> >> it would be nice to have, at least as a module. I have no idea on
> >> how to realize that, though.
> >>
> >> /Mikael  
> > 
> > You likely also need to install libffi - I do not know what package
> > this is on your flavor of linux - Luigi is the ffi specialist!  
> 
> FFI is integrated in LuaTeX >= 1.03
> 
> In you example you load libcerf but you are not using it.  What you
> are actually using are the Bessel function from the C Standard
> library.  GCC includes them as a GNU extension.
> https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-j0
> Your example also works if you remove libcerf (at least for me on
> Linux).

I had stripped-down my example, for in fact I use the voigt and error
functions from libcerf, and yes the Bessel functions from the standard
C math library. One should note, by the way, that the C math library is
more or less complete depending on the system, and not everyone uses
gcc nor gnu...

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] graphics

2018-12-12 Thread Henri Menke
On 13/12/18 8:56 AM, Alan Braslau wrote:
> On Wed, 12 Dec 2018 20:42:56 +0100
> "Mikael P. Sundqvist"  wrote:
>>
>> Thanks, Alan! That looks very promising. I could not make it work,
>> though, and I guess that is because I use linux and do not know what
>> to change for what. I installed libcerf but I assume something else is
>> missing. In any case, this is one of the things it would be nice to
>> have, at least as a module. I have no idea on how to realize that,
>> though.
>>
>> /Mikael
> 
> You likely also need to install libffi - I do not know what package
> this is on your flavor of linux - Luigi is the ffi specialist!

FFI is integrated in LuaTeX >= 1.03

In you example you load libcerf but you are not using it.  What you are
actually using are the Bessel function from the C Standard library.  GCC
includes them as a GNU extension.
https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-j0
Your example also works if you remove libcerf (at least for me on Linux).

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

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

2018-12-12 Thread Alan Braslau
On Wed, 12 Dec 2018 20:42:56 +0100
"Mikael P. Sundqvist"  wrote:
> 
> Thanks, Alan! That looks very promising. I could not make it work,
> though, and I guess that is because I use linux and do not know what
> to change for what. I installed libcerf but I assume something else is
> missing. In any case, this is one of the things it would be nice to
> have, at least as a module. I have no idea on how to realize that,
> though.
> 
> /Mikael

You likely also need to install libffi - I do not know what package
this is on your flavor of linux - Luigi is the ffi specialist!

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] graphics

2018-12-12 Thread Mikael P. Sundqvist
On Sat, Dec 8, 2018 at 4:15 PM Alan Braslau  wrote:
>
> On Sat, 8 Dec 2018 09:31:46 +0100
> "Mikael P. Sundqvist"  wrote:
>
> > 3) It would be nice to be able to plot some special functions. I'm
> > thinking of the usual suspects, Airy, Bessel, Hypergeometric,
> > Laguerre, Legendre, ... Could it be that one could have support via
> > some lua library?
>
> I use ffi and libcerf (thank you Luigi!)
> For example (lots of other functions are available):
>
> \startluacode
>
> ffi = require("ffi")
> ffi.cdef[[
> double j0(double x);
> double j1(double x);
> double jn(double x);
> ]]
>
> cerf = ffi.load(ffi.os == "OSX" and "/opt/local/lib/libcerf.dylib" or "cerf")
>
> \stopluacode
>
> \startMPdefinitions {doublefun}
>
>   vardef jzero primary x = scantokens(lua("mp.quoted( ffi.C.j0(" & decimal x 
> & "))")) enddef ;
>   vardef jone  primary x = scantokens(lua("mp.quoted( ffi.C.j1(" & decimal x 
> & "))")) enddef ;
>   vardef jnprimary x = scantokens(lua("mp.quoted( ffi.C.jn(" & decimal x 
> & "))")) enddef ;
>
> \stopMPdefinitions

Thanks, Alan! That looks very promising. I could not make it work,
though, and I guess that is because I use linux and do not know what
to change for what. I installed libcerf but I assume something else is
missing. In any case, this is one of the things it would be nice to
have, at least as a module. I have no idea on how to realize that,
though.

/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] graphics

2018-12-12 Thread Alan Braslau
On Wed, 12 Dec 2018 14:51:47 +0100
Mathias Schickel  wrote:

> You can see the desired behaviour in the attached pdf output of the
> LaTeX file.

No, one cannot, unless one has Adobe...

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] graphics

2018-12-08 Thread Alan Braslau
On Sat, 8 Dec 2018 09:31:46 +0100
"Mikael P. Sundqvist"  wrote:

> 3) It would be nice to be able to plot some special functions. I'm
> thinking of the usual suspects, Airy, Bessel, Hypergeometric,
> Laguerre, Legendre, ... Could it be that one could have support via
> some lua library?

I use ffi and libcerf (thank you Luigi!)
For example (lots of other functions are available):

\startluacode

ffi = require("ffi")
ffi.cdef[[
double j0(double x);
double j1(double x);
double jn(double x);
]]

cerf = ffi.load(ffi.os == "OSX" and "/opt/local/lib/libcerf.dylib" or "cerf")

\stopluacode

\startMPdefinitions {doublefun}

  vardef jzero primary x = scantokens(lua("mp.quoted( ffi.C.j0(" & decimal x & 
"))")) enddef ;
  vardef jone  primary x = scantokens(lua("mp.quoted( ffi.C.j1(" & decimal x & 
"))")) enddef ;
  vardef jnprimary x = scantokens(lua("mp.quoted( ffi.C.jn(" & decimal x & 
"))")) enddef ;

\stopMPdefinitions
___
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] graphics

2018-12-08 Thread Mikael P. Sundqvist
On Fri, Dec 7, 2018 at 4:15 PM Alan Braslau  wrote:
>
> On Fri, 7 Dec 2018 09:06:03 +0100
> "Mikael P. Sundqvist"  wrote:
>
> > 2) Support for transforming images in a more general way. With the
> > zscaled, slanted, ... we are able to transform any object in an affine
> > way. It would be nice to be able to transform any object in a more
> > general way (i.e. by a mapping defined by the user). The example code
> > below shows what happens in the complex plane with a grid and a curve
> > when the mapping z to z^2 is applied.
>
> I have generalized my rewrite of the MP graph macros to handle any
> arbitrary mapping from data space to drawing (2D) space. At present, I
> have only considered the simple functions of log (and sqrt) scales as
> well as polar coordinates (x,y) = f(theta,r) with f(theta,r) = (r sin
> theta, r cos theta) as I have real use cases for these.

Sounds interesting. Do you have any "test document" to show the work
in progress?

>
> I also consider a simple 3D->2D mapping.

That sounds awesome!! The time working with colors as 3D might come to
an end! :)

>
> It would be very easy to transform z = a+ib to z^2 for example, as you
> show,
>
>
> The approach transforms a picture, applying to all stroked and
> filled paths, as well as to the *position* of text objects. I have not
> looked into somehow transforming a bitmap image.

You emphasize "position". Does it mean it will not be possible to
transform the shape of the letter?

>
> > Perhaps I am missing something,
> > but I'm not able to apply this to a piece of text for example, or to
> > apply it directly to a picture. Instead, I have to loop over all
> > separate paths. I think the ideal would be to have a "ftransformed"
> > (or with some other name), and then just define a function (as fun in
> > the example below), and then be able to do "draw X ftransformed fun;",
> > where X is some(any?) general object. Is that doable?
>
> for i within pic :
>   ...
> endfor
>
> So, yes, easy to write a primary (but I don't like the name
> "ftransformed"). Using lua helpers can make this efficient.

OK, looping through the pic sounds like a good idea. The word
ftransformed was made up while writing the email, and I agree it is
not good (perhaps "mapped" is better). I trust that you will come up
with something that fits well.

>
>
> Alan

Yet another wish:

3) It would be nice to be able to plot some special functions. I'm
thinking of the usual suspects, Airy, Bessel, Hypergeometric,
Laguerre, Legendre, ... Could it be that one could have support via
some lua library?

/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] graphics

2018-12-07 Thread Alan Braslau
On Fri, 7 Dec 2018 09:06:03 +0100
"Mikael P. Sundqvist"  wrote:

> 2) Support for transforming images in a more general way. With the
> zscaled, slanted, ... we are able to transform any object in an affine
> way. It would be nice to be able to transform any object in a more
> general way (i.e. by a mapping defined by the user). The example code
> below shows what happens in the complex plane with a grid and a curve
> when the mapping z to z^2 is applied.

I have generalized my rewrite of the MP graph macros to handle any
arbitrary mapping from data space to drawing (2D) space. At present, I
have only considered the simple functions of log (and sqrt) scales as
well as polar coordinates (x,y) = f(theta,r) with f(theta,r) = (r sin
theta, r cos theta) as I have real use cases for these.

I also consider a simple 3D->2D mapping.

It would be very easy to transform z = a+ib to z^2 for example, as you
show, 


The approach transforms a picture, applying to all stroked and
filled paths, as well as to the *position* of text objects. I have not
looked into somehow transforming a bitmap image.

> Perhaps I am missing something,
> but I'm not able to apply this to a piece of text for example, or to
> apply it directly to a picture. Instead, I have to loop over all
> separate paths. I think the ideal would be to have a "ftransformed"
> (or with some other name), and then just define a function (as fun in
> the example below), and then be able to do "draw X ftransformed fun;",
> where X is some(any?) general object. Is that doable?

for i within pic :
  ...
endfor

So, yes, easy to write a primary (but I don't like the name
"ftransformed"). Using lua helpers can make this efficient.


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] graphics

2018-12-07 Thread luigi scarso
On Fri, Dec 7, 2018 at 9:06 AM Mikael P. Sundqvist  wrote:

> On Tue, Dec 4, 2018 at 6:03 PM Hans Hagen  wrote:
> >
> > Hi,
> >
> > As most mechanism are reasonable okay now we can look into what future
> > versions of ConteXt should provide in terms of functionality. The
> > (luatex) engine is also more of less finished or at least stable in
> > terms of functionality.
> >
> > One possible area of further development is graphics so I'd like to know
> > if there are (reasonable) demands for more graphics support using
> > metapost. Alan and I are on-and-off working on some extensions and one
> > of the things we discuss is visualization of data. The question is of
> > course what should be done in the lua/mp/tex combination and what
> > externally but the combination has some advantages. There has been
> > presentations and discussions at the last meeting and graphics is always
> > a nice topic, and also kind of rewarding in terms of development.
> >
> > Of course other demands can be formulated too, but these then need to
> > come with well defined descriptions (or mockup examples).
> >
> > 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
> >
> ___
>
> Hi,
>
> I don't know if what I describe below is along the lines you ask for,
> but here comes two wishes:
>
> 1) Full support for drawing implicit curve plots. For some curves,
> like a lemniscate
> (https://en.wikipedia.org/wiki/Lemniscate_of_Bernoulli) one can easily
> succeed by using a parametrisation, but sometimes one end up with
> equations and to find a parametrisation might be difficult (not to say
> impossible).

sure, see  eg
https://math.stackexchange.com/questions/904782/is-there-a-general-way-to-parameterize-all-implicit-functions


-- 
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] graphics

2018-12-07 Thread Mikael P. Sundqvist
On Tue, Dec 4, 2018 at 6:03 PM Hans Hagen  wrote:
>
> Hi,
>
> As most mechanism are reasonable okay now we can look into what future
> versions of ConteXt should provide in terms of functionality. The
> (luatex) engine is also more of less finished or at least stable in
> terms of functionality.
>
> One possible area of further development is graphics so I'd like to know
> if there are (reasonable) demands for more graphics support using
> metapost. Alan and I are on-and-off working on some extensions and one
> of the things we discuss is visualization of data. The question is of
> course what should be done in the lua/mp/tex combination and what
> externally but the combination has some advantages. There has been
> presentations and discussions at the last meeting and graphics is always
> a nice topic, and also kind of rewarding in terms of development.
>
> Of course other demands can be formulated too, but these then need to
> come with well defined descriptions (or mockup examples).
>
> 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
> ___

Hi,

I don't know if what I describe below is along the lines you ask for,
but here comes two wishes:

1) Full support for drawing implicit curve plots. For some curves,
like a lemniscate
(https://en.wikipedia.org/wiki/Lemniscate_of_Bernoulli) one can easily
succeed by using a parametrisation, but sometimes one end up with
equations and to find a parametrisation might be difficult (not to say
impossible). I asked about this a while ago and got a simple solution
working for that curve, but I think a general working solution would
be neat. I think the bernoulli lemniscate could be a good test curve,
since it intersect itself.

2) Support for transforming images in a more general way. With the
zscaled, slanted, ... we are able to transform any object in an affine
way. It would be nice to be able to transform any object in a more
general way (i.e. by a mapping defined by the user). The example code
below shows what happens in the complex plane with a grid and a curve
when the mapping z to z^2 is applied. Perhaps I am missing something,
but I'm not able to apply this to a piece of text for example, or to
apply it directly to a picture. Instead, I have to loop over all
separate paths. I think the ideal would be to have a "ftransformed"
(or with some other name), and then just define a function (as fun in
the example below), and then be able to do "draw X ftransformed fun;",
where X is some(any?) general object. Is that doable?

/Mikael

%%% Example code
\starttext
\startMPpage[offset=3bp]
u:=3cm;

def fun(expr x,y) = (x**2-y**2,2*x*y) enddef;

def sq(expr kv,s) =
fun(xpart point 0 along kv,ypart point 0 along kv)
  for i=s step s until 1: -- fun(xpart point i along kv,ypart point i
along kv) endfor
enddef;

path rp;
rp = (0,-0.8)..(0.7,-0.2)..(0.7,0.6){dir
150}..(-0.7,0.4)..(-0.4,-0.5){dir 0}..cycle;


% Draw the original grid and the path
for i = -1 step 1/10 until 1+eps:
 for j = -1 step 1/10 until 1+eps:
  draw ((i,-1)--(i,1)) scaled u;
  draw ((-1,j)--(1,j)) scaled u;
 endfor;
endfor;

draw rp scaled u withcolor darkred withpen pencircle scaled 2bp;

% Draw the grid and curve after map z->z^2
draw image(
for i = -1 step 1/10 until 1+eps:
 for j = 0 step 1/10 until 1+eps:
  draw (sq(((i,0)--(i,1)),1/100)) scaled u;
  draw (sq(((-1,j)--(1,j)),1/100)) scaled u;
 endfor;
endfor;
draw (sq(rp,1/100)) scaled u withcolor darkred withpen pencircle scaled 2bp;
) xshifted 2.5u;

\stopMPpage
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] graphics

2018-12-05 Thread Procházka Lukáš Ing .

Hello,

would it be possible to provide some samples finally?

That would be very handy especially for those who are used to create plots via 
"several clicks on Excel ribbon".

Personally, I am interested in 2D plots to be created loading (an) external data file(s) 
(text files formed into tables with some headers and comments marked by a letter in the 
beginning of the line), often altered by Lua somehow (e.g. trimming "bad" 
values).
I am used to use tickz/pgfplots for this purpose; use of pgfplots is (probably) 
very powerful but one has to study a lot of pages to create a simple plot 
followed by many try-and-see.
Also, support for showing extremal values (local extremes) in 2d plots is 
something handy.

"My" typical 2d plot looks:

A
|
30  | 24.1 <- local extreme
| +
20  |  --- ---   15.6 <- local extreme
|/ \  +
10  |   -- ---
|
+->
10. 20.  30.  40.

Best regards,

Lukas


On Tue, 04 Dec 2018 19:54:54 +0100, Alan Braslau  
wrote:


On Tue, 4 Dec 2018 18:03:14 +0100
Hans Hagen  wrote:


Hi,

As most mechanism are reasonable okay now we can look into what
future versions of ConteXt should provide in terms of functionality.
The (luatex) engine is also more of less finished or at least stable
in terms of functionality.

One possible area of further development is graphics so I'd like to
know if there are (reasonable) demands for more graphics support
using metapost. Alan and I are on-and-off working on some extensions
and one of the things we discuss is visualization of data. The
question is of course what should be done in the lua/mp/tex
combination and what externally but the combination has some
advantages. There has been presentations and discussions at the last
meeting and graphics is always a nice topic, and also kind of
rewarding in terms of development.

Of course other demands can be formulated too, but these then need to
come with well defined descriptions (or mockup examples).


Hans is alluding to work that we are doing to explore the possibilities
of lua + MetaPost in the treatment and visualization of data,
efficiently, with the possibility of handling large quantities of data.
Lua does this particularly well.

My first exercise has been a complete rewrite of the John Hobby graph
macros. It was/is an exercise in recreating the functionality "from
scratch", trying to use lua effectively when needed. The code and
approach is entirely new. My use case was the analysis of a large set
of data - entirely ridiculous for graphical display but containing
"outliers" or instances that are significant, and it works! I am
trying to generalize, and am doing this in my "free time".

So the aim is two-fold:

1) to efficiently handle large datasets through the use of lua

2) to generalize the notion of user data space from the
two-dimensional drawing space of MetaPost (and the represented page),
and affine transformations of this 2D space to other coordinate
systems and dimensions. We are not thinking about 3D rendering or
raytracing, but rather simple projections and other transformations
such as polar coordinates. (Of course, log scales, for example are a
"simple" non-linear transformation.)

I guess that Hans would like to expand the discussion to the future of
graphics in general, inviting input from everybody.

Alan



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS: 
nrpt3sn | IČO: 40763439
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

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

2018-12-05 Thread Alan Braslau
On Wed, 5 Dec 2018 13:59:35 +0100
Hans Hagen  wrote:

> > On this note: I would like to have an ‘official’ way to map 3D
> > coordinates to 2D coordinates with for a camera position with an
> > orthogonal window.
> > 
> > Not the most complicated thing in the world, but it would be nice if
> > metafun had an ‘official’ way of setting up a scene.  
> sounds like a challenge for our meta-math-magician Alan

Not a particularly hard problem (well known) but then one will want
hidden line removal, (partial) transparency, shading, ... and whereas
this is possible, it becomes complicated (and one will then want
animation).

For now, in my simple use of 3D to create diagrams, not any attempt to
make phluffy* images, I am quite content with a simple "caviler"
projection (infinite view position).

Alan

*Tufte's phluff!
___
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] graphics

2018-12-05 Thread Hans Hagen

On 12/5/2018 10:02 AM, Taco Hoekwater wrote:




On 4 Dec 2018, at 19:54, Alan Braslau  wrote:

2) to generalize the notion of user data space from the
two-dimensional drawing space of MetaPost (and the represented page),
and affine transformations of this 2D space to other coordinate
systems and dimensions. We are not thinking about 3D rendering or
raytracing, but rather simple projections and other transformations
such as polar coordinates. (Of course, log scales, for example are a
"simple" non-linear transformation.)


On this note: I would like to have an ‘official’ way to map 3D coordinates
to 2D coordinates with for a camera position with an orthogonal window.

Not the most complicated thing in the world, but it would be nice if
metafun had an ‘official’ way of setting up a scene.

sounds like a challenge for our meta-math-magician Alan

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] graphics

2018-12-05 Thread luigi scarso
On Wed, Dec 5, 2018 at 1:37 PM Hans Hagen  wrote:

> On 12/5/2018 10:14 AM, Henri Menke wrote:
> > ConTeXt already comes with a full XML parser. SVG is XML. It would be
> > nice if it was possible to render some subset of SVG.
> So what subset? ... Doing some shapes etc is doable but doing all is
> over the top
>
and of course some  will never be enough... never ending story.
The sad story with svg is that is an all-or-nothing thing  .

-- 
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] graphics

2018-12-05 Thread Hans Hagen

On 12/5/2018 10:14 AM, Henri Menke wrote:

ConTeXt already comes with a full XML parser. SVG is XML. It would be
nice if it was possible to render some subset of SVG.
So what subset? ... Doing some shapes etc is doable but doing all is 
over the top


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] graphics

2018-12-05 Thread luigi scarso
On Wed, Dec 5, 2018 at 10:15 AM Henri Menke  wrote:

> ConTeXt already comes with a full XML parser. SVG is XML. It would be
> nice if it was possible to render some subset of SVG.
>
In the mean time, I think we should also consider
 Headless Chromium for SVG -> PDF (with --print-to-pdf )
(together with inkscape)
-- 
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] graphics

2018-12-05 Thread Henri Menke
ConTeXt already comes with a full XML parser. SVG is XML. It would be
nice if it was possible to render some subset of SVG.

On 12/5/18 6:03 AM, Hans Hagen wrote:
> Hi,
> 
> As most mechanism are reasonable okay now we can look into what future
> versions of ConteXt should provide in terms of functionality. The
> (luatex) engine is also more of less finished or at least stable in
> terms of functionality.
> 
> One possible area of further development is graphics so I'd like to know
> if there are (reasonable) demands for more graphics support using
> metapost. Alan and I are on-and-off working on some extensions and one
> of the things we discuss is visualization of data. The question is of
> course what should be done in the lua/mp/tex combination and what
> externally but the combination has some advantages. There has been
> presentations and discussions at the last meeting and graphics is always
> a nice topic, and also kind of rewarding in terms of development.
> 
> Of course other demands can be formulated too, but these then need to
> come with well defined descriptions (or mockup examples).
> 
> 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
> ___

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

2018-12-05 Thread Taco Hoekwater


> On 4 Dec 2018, at 19:54, Alan Braslau  wrote:
> 
> 2) to generalize the notion of user data space from the
> two-dimensional drawing space of MetaPost (and the represented page),
> and affine transformations of this 2D space to other coordinate
> systems and dimensions. We are not thinking about 3D rendering or
> raytracing, but rather simple projections and other transformations
> such as polar coordinates. (Of course, log scales, for example are a
> "simple" non-linear transformation.) 

On this note: I would like to have an ‘official’ way to map 3D coordinates
to 2D coordinates with for a camera position with an orthogonal window.

Not the most complicated thing in the world, but it would be nice if
metafun had an ‘official’ way of setting up a scene.

Best wishes,
Taco



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] graphics

2018-12-04 Thread Alan Braslau
On Tue, 4 Dec 2018 18:03:14 +0100
Hans Hagen  wrote:

> Hi,
> 
> As most mechanism are reasonable okay now we can look into what
> future versions of ConteXt should provide in terms of functionality.
> The (luatex) engine is also more of less finished or at least stable
> in terms of functionality.
> 
> One possible area of further development is graphics so I'd like to
> know if there are (reasonable) demands for more graphics support
> using metapost. Alan and I are on-and-off working on some extensions
> and one of the things we discuss is visualization of data. The
> question is of course what should be done in the lua/mp/tex
> combination and what externally but the combination has some
> advantages. There has been presentations and discussions at the last
> meeting and graphics is always a nice topic, and also kind of
> rewarding in terms of development.
> 
> Of course other demands can be formulated too, but these then need to 
> come with well defined descriptions (or mockup examples).

Hans is alluding to work that we are doing to explore the possibilities
of lua + MetaPost in the treatment and visualization of data,
efficiently, with the possibility of handling large quantities of data.
Lua does this particularly well.

My first exercise has been a complete rewrite of the John Hobby graph
macros. It was/is an exercise in recreating the functionality "from
scratch", trying to use lua effectively when needed. The code and
approach is entirely new. My use case was the analysis of a large set
of data - entirely ridiculous for graphical display but containing
"outliers" or instances that are significant, and it works! I am
trying to generalize, and am doing this in my "free time".

So the aim is two-fold:

1) to efficiently handle large datasets through the use of lua

2) to generalize the notion of user data space from the
two-dimensional drawing space of MetaPost (and the represented page),
and affine transformations of this 2D space to other coordinate
systems and dimensions. We are not thinking about 3D rendering or
raytracing, but rather simple projections and other transformations
such as polar coordinates. (Of course, log scales, for example are a
"simple" non-linear transformation.) 

I guess that Hans would like to expand the discussion to the future of
graphics in general, inviting input from everybody.

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] graphics

2018-12-04 Thread Hans Hagen

Hi,

As most mechanism are reasonable okay now we can look into what future 
versions of ConteXt should provide in terms of functionality. The 
(luatex) engine is also more of less finished or at least stable in 
terms of functionality.


One possible area of further development is graphics so I'd like to know 
if there are (reasonable) demands for more graphics support using 
metapost. Alan and I are on-and-off working on some extensions and one 
of the things we discuss is visualization of data. The question is of 
course what should be done in the lua/mp/tex combination and what 
externally but the combination has some advantages. There has been 
presentations and discussions at the last meeting and graphics is always 
a nice topic, and also kind of rewarding in terms of development.


Of course other demands can be formulated too, but these then need to 
come with well defined descriptions (or mockup examples).


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
___

[NTG-context] Graphics gets extra indent if hanging in list

2018-06-11 Thread Mikael P. Sundqvist
Hi!

Please look at the example below. I wish the red rectangle to be located as
the green one aligned with text to the right, but it gets pushed a bit (the
space to the left in the list?). Am I doing things wrongly? Is it possible
to fix easily?

/Mikael

\setuppapersize[A6]

\starttext

\starthanging[location=right]{\blackrule[color=darkgreen,width=1in,height=0.5in]}
\input ward
\stophanging

\startitemize[n]
\item
\starthanging[location=right]{\blackrule[color=darkred,width=1in,height=0.5in]}
\input ward
\stophanging
\stopitemize

\stoptext


hang.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Graphics not being aligned correctly in natural tables

2016-05-17 Thread Wolfgang Schuster

L.S.-Soc 
17. Mai 2016 um 22:22
ah ok! I am sorry Luigi, I didn't expect that. :D

code is below; I also packed a ZIP file with this mail, with the 
correct graphics folder, *.tex and precompiled *.pdf, in case that the 
code isn't enough.
but i checked the graphics, they are perfectly aligned on the canvas, 
so they shouldn't be the problem.

Add

\setupTABLE[c][4][strut=no]

at the begin of your table.

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Graphics not being aligned correctly in natural tables

2016-05-17 Thread luigi scarso
On Tue, May 17, 2016 at 9:44 PM, L.S.-Soc  wrote:

> Hi Luigi,
>
> I am afraid that "mwe..." doesn't help.
>

a minimal working example (a.k.a mwe) that show your  problem.



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

Re: [NTG-context] Graphics not being aligned correctly in natural tables

2016-05-17 Thread L.S.-Soc

Hi Luigi,

I am afraid that "mwe..." doesn't help.

Thanks tho bro,

Sebastian




Am 17.05.2016 um 18:55 schrieb luigi scarso:



On Tue, May 17, 2016 at 6:47 PM, cryo shock > wrote:


Hello fellow ConTeXt lovers,

I am having trouble with placing graphics in between \bTD and
\eTD. I am using the \externalfigure to do so which works great.
The problem is that they aren't being aligned at all when i use
\setupTABLE[align={middle,lohi}] whereas text is being aligned
perfectly in the middle of each cell.
I found out that one can use \dontleavehmode\externalfigure to
force alignment, which als works. But when I use \dontleave... the
graphic isn't being placed perfectly in the middle but slightly a
little bit more to the top of the cell.
It's not a real problem for me but since everything looks great in
the document, the slightly to the top moved graphics bother me
somehow.
Does anybody know a workaround maybe?

Greets, Sebastian

mwe...


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


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Graphics not being aligned correctly in natural tables

2016-05-17 Thread luigi scarso
On Tue, May 17, 2016 at 6:47 PM, cryo shock  wrote:

> Hello fellow ConTeXt lovers,
>
> I am having trouble with placing graphics in between \bTD and \eTD. I am
> using the \externalfigure to do so which works great. The problem is that
> they aren't being aligned at all when i use
> \setupTABLE[align={middle,lohi}] whereas text is being aligned perfectly in
> the middle of each cell.
> I found out that one can use \dontleavehmode\externalfigure to force
> alignment, which als works. But when I use \dontleave... the graphic isn't
> being placed perfectly in the middle but slightly a little bit more to the
> top of the cell.
> It's not a real problem for me but since everything looks great in the
> document, the slightly to the top moved graphics bother me somehow.
> Does anybody know a workaround maybe?
>
> Greets, Sebastian
>
mwe...


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

[NTG-context] Graphics not being aligned correctly in natural tables

2016-05-17 Thread cryo shock
Hello fellow ConTeXt lovers,

I am having trouble with placing graphics in between \bTD and \eTD. I am
using the \externalfigure to do so which works great. The problem is that
they aren't being aligned at all when i use
\setupTABLE[align={middle,lohi}] whereas text is being aligned perfectly in
the middle of each cell.
I found out that one can use \dontleavehmode\externalfigure to force
alignment, which als works. But when I use \dontleave... the graphic isn't
being placed perfectly in the middle but slightly a little bit more to the
top of the cell.
It's not a real problem for me but since everything looks great in the
document, the slightly to the top moved graphics bother me somehow.
Does anybody know a workaround maybe?

Greets, Sebastian
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] graphics: figure combination and single figure side by side

2013-04-09 Thread Xenia
On 09.04.2013 00:29, Wolfgang Schuster wrote:
 
 Am 08.04.2013 um 19:46 schrieb Xenia yor...@googlemail.com:
 
 Hi context list,

 I want to place three figures in a row, but two of them as part of a
 combination with a common caption.
 I tried this with columns, but did not manage it, because I only read
 how to span 2 columns with single figures.

 How can this be done properly?
 
 You can use a table.

Thanks for this tip. But using this with placefigure and a combination
it starts counting with Figure 7.


(/home/maja/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2013.03.24 15:11 MKIV  fmt: 2013.3.24  int: english/english

system   'cont-new.mkiv' loaded
(/home/maja/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system   beware: some patches loaded from cont-new.mkiv
)
system   files  jobname 'combination_in_table', input 'combination_in_table', result 'combination_in_table'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
(combination_in_table.tex{/home/maja/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
fontstypescripts  unknown library 'loc'
{/home/maja/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/home/maja/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts'fallback modern rm 12pt' is loaded
floatblocks  '1' placed
floatblocks  '2' placed
floatblocks  '3' placed
floatblocks  '4' placed
floatblocks  '5' placed
floatblocks  '6' placed
floatblocks  '7' placed
floatblocks  '8' placed
backend  xmp  using file '/home/maja/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
 /home/maja/context/tex/texmf-context/tex/context/sample/cow.pdf /home/maja/context/tex/texmf-context/tex/context/sample/mill.png /home/maja/context/tex/texmf-context/tex/context/sample/hacker.jpg
pagesflushing realpage 1, userpage 1
 ) )/home/maja/context/tex/texmf/fonts/opentype/public/lm/lmroman12-bold.otf/home/maja/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf

system   files  start used files

used files  1: filename=cont-yes.mkiv filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/base/cont-yes.mkiv usedmethod=database
used files  2: filename=cont-new.mkiv filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/base/cont-new.mkiv usedmethod=database
used files  3: filename=lang-us.lua filetype=lua foundname=/home/maja/context/tex/texmf-context/tex/context/patterns/lang-us.lua usedmethod=database
used files  4: filename=combination_in_table.tex foundname=combination_in_table.tex usedmethod=direct
used files  5: filename=mkiv-base.map filetype=map format=map foundname=/home/maja/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map usedmethod=database
used files  6: filename=lm.lfg filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/fonts/lm.lfg usedmethod=database
used files  7: filename=lm-math.lfg filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/fonts/lm-math.lfg usedmethod=database
used files  8: filename=lm-math.map filetype=map format=map foundname=/home/maja/context/tex/texmf/fonts/map/dvips/lm/lm-math.map usedmethod=database
used files  9: filename=lm-rm.map filetype=map format=map foundname=/home/maja/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map usedmethod=database
used files 10: filename=lmroman12-regular filetype=otf format=otf foundname=/home/maja/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=database
used files 11: filename=latinmodern-math.otf filetype=opentypefonts foundname=/home/maja/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database
used files 12: filename=latinmodern-math.otf filetype=otf format=otf foundname=/home/maja/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database
used files 13: filename=cow.pdf filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/sample/cow.pdf usedmethod=database
used files 14: filename=mill.png filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/sample/mill.png usedmethod=database
used files 15: filename=lmroman12-bold filetype=otf format=otf foundname=/home/maja/context/tex/texmf/fonts/opentype/public/lm/lmroman12-bold.otf usedmethod=database
used files 16: filename=hacker.jpg filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/sample/hacker.jpg usedmethod=database
used files 17: filename=lpdf-pdx.xml filetype=tex foundname=/home/maja/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml usedmethod=database

system   files  stop used files


system   structure  start used structure


[NTG-context] graphics: figure combination and single figure side by side

2013-04-08 Thread Xenia
Hi context list,

I want to place three figures in a row, but two of them as part of a
combination with a common caption.
I tried this with columns, but did not manage it, because I only read
how to span 2 columns with single figures.

How can this be done properly?

Thanks,
Xenia
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] graphics: figure combination and single figure side by side

2013-04-08 Thread Wolfgang Schuster

Am 08.04.2013 um 19:46 schrieb Xenia yor...@googlemail.com:

 Hi context list,
 
 I want to place three figures in a row, but two of them as part of a
 combination with a common caption.
 I tried this with columns, but did not manage it, because I only read
 how to span 2 columns with single figures.
 
 How can this be done properly?

You can use a table.

\setupexternalfigures[location=default]

\starttext

\bTABLE[frame=off,align=middle]
  \bTR
\bTD \externalfigure[cow]   [height=5\lineheight] \eTD
\bTD \externalfigure[mill]  [height=5\lineheight] \eTD
\bTD \externalfigure[hacker][height=5\lineheight] \eTD
  \eTR
  \bTR
\bTD Figure 1\eTD
\bTD[nx=2] Figure 2 and 3 \eTD
  \eTR
\eTABLE

\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Graphics positioning problems in current/recent betas

2012-02-04 Thread Peter Park Nelson
I have been studying the Details manual and have found that many of
the examples presented there do not work correctly with the current or
recent betas. The ones I have tested work correctly on texshow and
with the Texlive 2011 (MkIV Luatex) version.

1. In the first example below (based on Details p. 25), note that the
graphic is positioned very high relative to the paragraph, although
vertical space appears to be reserved correctly:

%% start --%%

\starttext

\setupfloat[figure]
[sidespacebefore=none,sidespaceafter=none,sidealign=depth]

\input tufte\par

\placefigure[inner,none]{caption}{\framed[height=3cm]{graphic}}

\input tufte\par
\stoptext

%% stop ---%%


2. Figure position in the second example below (Details p.65) is
similar, but an empty box is placed instead of the figure:

%% -- start - %%
\starttext
\showboxes

\definelayer[text-1][position=yes]
\defineanchor[rightbottom][text-1][location=lt,hoffset=max,voffset=max]
\definefloat[myfigure][figure]
\setupfloat[myfigure][sidespaceafter=,sidespacebefore=]
\defineanchor[rightbottom][text-1][location=lt,hoffset=max,voffset=max]

\input tufte\par

\placemyfigure
[left,none]
{}
{\anchor[rightbottom]
{\externalfigure[dummy][width=5cm,frame=on]}}

\input tufte\par

\stoptext

%% - stop --%%

-- 
Peter Park Nelson
peter.park.nel...@gmail.com
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Graphics in text-line

2011-11-27 Thread Robert Blackstone
Dear list,

Would it be possible to insert a tiny graphic, not larger than a capital M, 
into a textline?

I am presently making a bilingual version of a sixteenth century French musical 
treatise, and I would like to copy as much as possible the typographic features 
of the original in the modern version, both French and a  translation. 
In the original French edition some text lines contain musical symbols, not 
only the sharp, flat and natural characters but also some others, of which I 
can make graphics (png or pdf).
I can place these praphics in the margin and even in a footnote (although with 
rather too much space above it) but I would prefer to have them in their text 
line.
Is that doable?

Thanks in advance.

Best regards,

Robert Blackstone

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Graphics in text-line

2011-11-27 Thread Wolfgang Schuster

Am 27.11.2011 um 18:20 schrieb Robert Blackstone:

 Dear list,
 
 Would it be possible to insert a tiny graphic, not larger than a capital M, 
 into a textline?
 
 I am presently making a bilingual version of a sixteenth century French 
 musical treatise, and I would like to copy as much as possible the 
 typographic features of the original in the modern version, both French and a 
  translation. 
 In the original French edition some text lines contain musical symbols, not 
 only the sharp, flat and natural characters but also some others, of which I 
 can make graphics (png or pdf).
 I can place these praphics in the margin and even in a footnote (although 
 with rather too much space above it) but I would prefer to have them in their 
 text line.
 Is that doable?

\starttext
This is a cow \figuresymbol[cow].
\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Graphics in text-line

2011-11-27 Thread Wolfgang Schuster

Am 27.11.2011 um 18:26 schrieb Wolfgang Schuster:

 Am 27.11.2011 um 18:20 schrieb Robert Blackstone:
 
 Dear list,
 
 Would it be possible to insert a tiny graphic, not larger than a capital M, 
 into a textline?
 
 I am presently making a bilingual version of a sixteenth century French 
 musical treatise, and I would like to copy as much as possible the 
 typographic features of the original in the modern version, both French and 
 a  translation. 
 In the original French edition some text lines contain musical symbols, not 
 only the sharp, flat and natural characters but also some others, of which I 
 can make graphics (png or pdf).
 I can place these praphics in the margin and even in a footnote (although 
 with rather too much space above it) but I would prefer to have them in 
 their text line.
 Is that doable?
 
 \starttext
 This is a cow \figuresymbol[cow].
 \stoptext


More control about the height gives you this method:

\defineexternalfigure[inline][height=1.8ex]

\starttext
This is a cow \externalfigure[cow][inline].
\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Graphics in text-line

2011-11-27 Thread Robert Blackstone

 Am 27.11.2011 um 18:26 schrieb Wolfgang Schuster:
 
 Am 27.11.2011 um 18:20 schrieb Robert Blackstone:
 
 Dear list,
 
 Would it be possible to insert a tiny graphic, not larger than a capital M, 
 into a textline?
 
 
 \starttext
 This is a cow \figuresymbol[cow].
 \stoptext

 Wolfgang
 
 
 More control about the height gives you this method:
 
 \defineexternalfigure[inline][height=1.8ex]
 
 \starttext
 This is a cow \externalfigure[cow][inline].
 \stoptext
 
 Wolfgang

This, especially the second method, is exactly what I wanted. Thank you very 
much Wolfgang.

Best regards,

Robert Blackstone

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Graphics in text-line

2011-11-27 Thread Wolfgang Schuster

Am 27.11.2011 um 18:26 schrieb Wolfgang Schuster:

 Am 27.11.2011 um 18:20 schrieb Robert Blackstone:
 
 Dear list,
 
 Would it be possible to insert a tiny graphic, not larger than a capital M, 
 into a textline?
 
 I am presently making a bilingual version of a sixteenth century French 
 musical treatise, and I would like to copy as much as possible the 
 typographic features of the original in the modern version, both French and 
 a  translation. 
 In the original French edition some text lines contain musical symbols, not 
 only the sharp, flat and natural characters but also some others, of which I 
 can make graphics (png or pdf).
 I can place these praphics in the margin and even in a footnote (although 
 with rather too much space above it) but I would prefer to have them in 
 their text line.
 Is that doable?
 
 \starttext
 This is a cow \figuresymbol[cow].
 \stoptext


More control about the height gives you this method:

\defineexternalfigure[inline][height=1.8ex]

\starttext
This is a cow \externalfigure[cow][inline].
\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] graphics styles

2010-08-23 Thread Yury G. Kudryashov
Hi!

In tikz I can say
\draw[help lines] (0, 0) circle (1cm);
and setup what does help lines mean (color, linewidth etc.) in the 
environment file with \tikzset{help lines/.style={...}}.

Is there any way to do something similar with ConTeXt+MetaPost? Should I add 
drawoptions(\MPvar{another-style-name}) before each draw/fill command, and 
drawoptions() after it?

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] graphics styles

2010-08-23 Thread Aditya Mahajan

On Tue, 24 Aug 2010, Yury G. Kudryashov wrote:


Hi!

In tikz I can say
\draw[help lines] (0, 0) circle (1cm);
and setup what does help lines mean (color, linewidth etc.) in the
environment file with \tikzset{help lines/.style={...}}.

Is there any way to do something similar with ConTeXt+MetaPost?


Currently, no.


Should I add
drawoptions(\MPvar{another-style-name}) before each draw/fill command, and
drawoptions() after it?


One option is to define two macros: definestyle (or perhaps newstyle, 
which is more in line with metapost naming conventions) and withstyle so 
that you can say


definestyle(helplines, withpen pencircle scaled 1bp withcolor 0.5white) ;

and then

draw fullcircle xyscaled 1cm withstyle helplines ;

It should be possible to do this in metapost, but if not (I am really bad 
at metapost programming), then it is straightforward to do this in TeX 
so that you write


\startMPcode
\defineMPstyle[helplines][withpen pencircle scaled 1bp withcolor 0.5white]

draw fullcircle xyscaled 1cm \withstyle{helplines} ;
\stopMPcode

but the first solution will be more cleaner.

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


Re: [NTG-context] graphics paths

2005-11-02 Thread Taco Hoekwater


Hi Michael,

This is an intentional change in behaviour, introduced by the may 25
release. From the release notes:

 * External figures are no longer searched for in the main texmf tree.
   Use \setupexternalfigures[location={local,global,default}] if you
   want the old behaviour back.

Cheers, Taco

M.guravage wrote:

Hello,

I keep a few pieces of code and pdf graphics in a private TEXMF tree from
where I include them in various documents. I reference a graphic by its
filename sans the suffix, e.g. \externalfigure[logo].  A glance at the log
reveals that the filename resolves to the exhaustive pathname of the graphic
in my private TEXMF tree, and the graphic appears in the document - until
today that is.

I revisited this document today which I last typeset with context version
2005.02.15. Today I used the version from 2005.08.31, and the graphics are
missing. The log, not surprisingly, says, 'figures: figure logo can not be
found.' A simple work around is to copy the graphic into the same directory
as the document, which suggests it is a path problem.  Has anyone else
experienced this behavior and can suggest a more elegant solution.

With kind regards,

Michael Guravage

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] graphics paths

2005-11-02 Thread M.guravage
Hello,

I keep a few pieces of code and pdf graphics in a private TEXMF tree from
where I include them in various documents. I reference a graphic by its
filename sans the suffix, e.g. \externalfigure[logo].  A glance at the log
reveals that the filename resolves to the exhaustive pathname of the graphic
in my private TEXMF tree, and the graphic appears in the document - until
today that is.

I revisited this document today which I last typeset with context version
2005.02.15. Today I used the version from 2005.08.31, and the graphics are
missing. The log, not surprisingly, says, 'figures: figure logo can not be
found.' A simple work around is to copy the graphic into the same directory
as the document, which suggests it is a path problem.  Has anyone else
experienced this behavior and can suggest a more elegant solution.

With kind regards,

Michael Guravage

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context