hertogp / imagine

A pandoc-filter for images
MIT License
82 stars 11 forks source link

Request: Add Wolfram Language/Mathematica #12

Closed Synthetica9 closed 3 years ago

Synthetica9 commented 5 years ago

Wolfram Language/Mathematica integration would be a nice-to-have feature. Many output formats are supported: https://reference.wolfram.com/language/guide/ListingOfAllFormats.html For command line options, see here: https://reference.wolfram.com/language/ref/program/wolframscript.html

I would love to help develop this, but I'm not 100% on how I should implement a new language.

hertogp commented 4 years ago

With the shebang class you can do (on linux anyway):

   ```shebang
   #!/usr/bin/env wolframscript
   Export[$ScriptCommandLine[[2]],
      GraphPlot3D[
      SimpleGraph[Table[i \[UndirectedEdge] Mod[i^2, 75], {i, 75}]],
     EdgeShapeFunction -> ({Cylinder[#1, 0.1]} &),
     VertexShapeFunction -> ({Sphere[#, 0.3]} &)]
   ]
   ```

That would generate a png-image. If you want svg use {.shebang im_fmt=svg} as a class. Some examples are attached. I added the wolfram.md to the examples subdirectory as well.

Does that suit your needs? wolfram.pdf

hertogp commented 3 years ago

I guess it does ...