Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Error in $: Failed reading: not a valid json value #2

Closed
Tharre opened this issue May 12, 2019 · 3 comments
Closed

Error in $: Failed reading: not a valid json value #2

Tharre opened this issue May 12, 2019 · 3 comments

Comments

@Tharre
Copy link

Tharre commented May 12, 2019

Hey there,

I've been trying to run the example from usage, but it's throwing an error:

$ pandoc --filter pandoc-pyplot input.md --output output.pdf
Error running filter pandoc-pyplot:
Error in $: Failed reading: not a valid json value

Any idea what might cause this?

My system is x86_64 Arch Linux with pandoc version 2.7.2. I've installed pandoc-pyplot via stack.

Thanks in advance.

@LaurentRDC
Copy link
Owner

Hi Tharre,

The way pandoc-pyplot and pandoc communicate is via JSON. As you can see, somewhere this communication is breaking down. I can see two potential problems:

  1. I have not tried pandoc-pyplot and pandoc 2.7 together. This interaction might be different than with pandoc 2.5 (which I use for testing), although I can't see why that would be the case.
  2. There is a character in your input.md that trips pandoc-pyplot for some reason. Are you using the README example?
    ```{.pyplot}
    import matplotlib.pyplot as plt

    plt.figure()
    plt.plot([0,1,2,3,4], [1,2,3,4,5])
    plt.title('This is an example figure')
    ```

I will try the above example with pandoc 2.7.2

@LaurentRDC
Copy link
Owner

LaurentRDC commented May 12, 2019

It is due to pandoc-pyplot's input arguments. Pandoc-pyplot was getting confused between inputs from pandoc and invalid flags.

This behavior is not present in pandoc-pyplot v2.1.0.1. You should be able to use it without problems. I will release an update to fix it this morning (v2.1.1.1).

Edit: a new version with the appropriate fix has been released. Give it a try and let me know if this is fixed.

Forgive me for the inconvenience!

@Tharre
Copy link
Author

Tharre commented May 12, 2019

Can confirm that it works.

Thanks!

@Tharre Tharre closed this as completed May 12, 2019
LaurentRDC added a commit that referenced this issue Aug 8, 2019
LaurentRDC added a commit that referenced this issue Jan 9, 2020
LaurentRDC added a commit that referenced this issue Jan 9, 2020
Former-commit-id: 9c4cfb5 [formerly 6efc083]
Former-commit-id: 85d6122
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants