CDSoft / panda

Panda is a Pandoc Lua filter that works on internal Pandoc's AST. Panda is heavily inspired by [abp](http:/cdelord.fr/abp) reimplemented as a Pandoc Lua filter.
https://cdelord.fr/panda
GNU General Public License v3.0
43 stars 5 forks source link

gnuplot diagrams are not rendered #12

Closed lontivero closed 2 years ago

lontivero commented 2 years ago

While graphviz diagrams work well, gnuplot doesn't. I've tried with all possible ideas but nothing seems to work. This example is taken from the doc (with img and out modified). I have gnuplot installed

```{render="gnuplot -e 'set terminal svg' -e 'set output "%o.svg"' -c %i"
     img="../../src/images/panda_gnuplot_example"
     out="/home/lontivero/Documents/Wiki/src/images" }
set xrange [-pi:pi]
set yrange [-1.5:1.5]
plot sin(x) lw 4, cos(x) lw 4
```

This is the result (pandoc rendered html output): image

I don't know how to debug nor how to get more info to help understand what can be going wrong. Any idea?

CDSoft commented 2 years ago

This is a bug in the documentation. The inner quotes in the render attribute shall be escaped:

```{render="gnuplot -e 'set terminal svg' -e 'set output \"%o.svg\"' -c %i"
     img="../../src/images/panda_gnuplot_example"
     out="/home/lontivero/Documents/Wiki/src/images" }
set xrange [-pi:pi]
set yrange [-1.5:1.5]
plot sin(x) lw 4, cos(x) lw 4
```

You can also use predefined variables for some diagrams:

```{render="{{gnuplot}}"
     img="../../src/images/panda_gnuplot_example"
     out="/home/lontivero/Documents/Wiki/src/images" }
set xrange [-pi:pi]
set yrange [-1.5:1.5]
plot sin(x) lw 4, cos(x) lw 4
```
lontivero commented 2 years ago

Works! Thank you.