[NTG-context] graphics

Henri Menke henrimenke at gmail.com
Thu Dec 13 21:33:40 CET 2018


On 14/12/18 5:07 AM, luigi scarso wrote:
> On Thu, Dec 13, 2018 at 4:45 PM Alan Braslau <braslau.list at comcast.net>
> 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 at 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
> ___________________________________________________________________________________
> 



More information about the ntg-context mailing list