jgm/pandocfilters

graphviz image differs when ran through plain "dot" vs through pandocfilter-graphviz

matthiasbeyer opened this issue · 9 comments

The image which showes up in my example differs from the one I get when running the exact same dot source through the dot-tool.

Why is that?

jgm commented

How does it differ?

+++ Matthias Beyer [Jan 14 16 14:10 ]:

The image which showes up in my example differs from the one I get when
running the exact same dot source through the dot-tool.

Why is that?


Reply to this email directly or [1]view it on GitHub.

References

  1. #33

Completely.

That's a screenshot from my paper:

2016-01-15-093019_576x739_scrot

Which is the example from the graphviz page:

example from graphviz.org

The source of the image is here.

I recompiled the source of the image with the plain dot program and it yielded the correct result, though when ran through pandoc it yields the upper image.

jgm commented

Note: these are just examples, meant for you to study
in making your own filters. So, take a look at the source.
You'll see it uses the pygraphviz library.
Documentation here:
http://pygraphviz.github.io/documentation/pygraphviz-1.3rc1/tutorial.html#graphs

And it's clear what's happening. By default, pygraphviz
uses 'neato' to layout the diagrams. You want 'dot'.
So you need to change the line

G.layout()

to

G.layout(prog='dot')

If you'd like to modify the filter, it would be worth making
it sensitive to a layout attribute.

``` graphviz layout=dot

or

``` graphviz layout=neato

okay, this makes sense.

Now it tells me:

pandoc: Error in $[48][0][0]: expected Object, encountered Array

I can produce this error with your graphviz example as well...

jgm commented

It worked for me. What version of pandoc are you using
(and of pandoc-citeproc)?

+++ Matthias Beyer [Jan 15 16 14:33 ]:

okay, this makes sense.

Now it tells me:
pandoc: Error in $[48][0][0]: expected Object, encountered Array

I can produce this error with your graphviz example as well...


Reply to this email directly or [1]view it on GitHub.

References

  1. #33 (comment)

pandoc 1.15.2.1
pandoc-citeproc 0.8.1.3

jgm commented

The example filters in pandocfilters have been updated to
work with pandoc 1.16.x. You can search through git history
to see how to downgrade so they'll work with 1.15.x.

+++ Matthias Beyer [Jan 15 16 14:42 ]:

pandoc 1.15.2.1
pandoc-citeproc 0.8.1.3


Reply to this email directly or [1]view it on GitHub.

References

  1. #33 (comment)

Fixed that issie for me. Thanks a lot for your help!