phiresky / pandoc-url2cite

Effortlessly and transparently add correctly styled citations to your markdown paper given only a URL
Other
122 stars 9 forks source link

bug(first_usage): Error running filter pandoc-url2cite: Could not find executable pandoc-url2cite #6

Closed Kristinita closed 3 years ago

Kristinita commented 3 years ago

1. Summary

I can’t begin to use pandoc-url2cite on my Windows. I get the error:

D:\SashaDebugging>pandoc --filter=pandoc-url2cite --citeproc minimal.md -o minimal.pdf
Error running filter pandoc-url2cite:
Could not find executable pandoc-url2cite

2. Data

2.1. Markdown file

# Introduction

The GAN was first introduced in [@gan].

# References

[@gan]: https://papers.nips.cc/paper/5423-generative-adversarial-nets

2.2. pandoc-url2cite path

D:\SashaDebugging>where pandoc-url2cite
C:\Users\SashaChernykh\AppData\Roaming\npm\pandoc-url2cite
C:\Users\SashaChernykh\AppData\Roaming\npm\pandoc-url2cite.cmd

D:\SashaDebugging>pandoc-url2cite
pandoc-url2cite v0.6.6
Don't run this directly, use it as a pandoc --filter=. Usage: https://github.com/phiresky/pandoc-url2cite

3. Environment

  1. Windows 10.0.19041.508 Pro N for Workstations 64-bit EN
  2. Node.js 15.5.1
  3. pandoc 2.11.3.2
  4. pandoc-url2cite 0.6.6

Thanks.

phiresky commented 3 years ago

Uh to be honest i don't know how windows path lookups work exactly. what happens if you try using --filter=C:\Users\SashaChernykh\AppData\Roaming\npm\pandoc-url2cite?

Kristinita commented 3 years ago

Status: Partially fixed :moon:

This command:

pandoc --filter=C:\Users\SashaChernykh\AppData\Roaming\npm\pandoc-url2cite.cmd --citeproc minimal.md -o minimal.pdf

But I think that it would be nice to use pandoc-url2cite without full path declaring.

1. Bibliographic information

citation-cache.json successfully generated for me:

{
    "_info": "Auto-generated by pandoc-url2cite. Feel free to modify, keys will never be overwritten.",
    "urls": {
        "https://papers.nips.cc/paper/5423-generative-adversarial-nets": {
            "fetched": "2021-01-20T04:18:03.022Z",
            "bibtex": [
                "",
                "@inproceedings{baum_supervised_1988,",
                "   title = {Supervised {Learning} of {Probability} {Distributions} by {Neural} {Networks}},",
                "   url = {https://proceedings.neurips.cc/paper/1987/file/eccbc87e4b5ce2fe28308fd9f2a7baf3-Paper.pdf},",
                "   urldate = {2021-01-20},",
                "   booktitle = {Neural {Information} {Processing} {Systems}},",
                "   publisher = {American Institute of Physics},",
                "   author = {Baum, Eric and Wilczek, Frank},",
                "   editor = {Anderson, D.},",
                "   year = {1988},",
                "   pages = {52--61},",
                "}",
                ""
            ],
            "csl": {
                "URL": "https://proceedings.neurips.cc/paper/1987/file/eccbc87e4b5ce2fe28308fd9f2a7baf3-Paper.pdf",
                "accessed": {
                    "date-parts": [
                        [
                            2021,
                            1,
                            20
                        ]
                    ]
                },
                "author": [
                    {
                        "family": "Baum",
                        "given": "Eric"
                    },
                    {
                        "family": "Wilczek",
                        "given": "Frank"
                    }
                ],
                "container-title": "Neural Information Processing Systems",
                "editor": [
                    {
                        "family": "Anderson",
                        "given": "D."
                    }
                ],
                "id": "https://papers.nips.cc/paper/5423-generative-adversarial-nets",
                "issued": {
                    "date-parts": [
                        [
                            1988
                        ]
                    ]
                },
                "page": "52-61",
                "publisher": "American Institute of Physics",
                "title": "Supervised Learning of Probability Distributions by Neural Networks",
                "type": "paper-conference"
            }
        }
    }
}

2. PDF

But PDF not generated:

D:\SashaDebugging\KiraManubot>pandoc --filter=C:\Users\SashaChernykh\AppData\Roaming\npm\pandoc-url2cite.cmd --citeproc minimal.md -o minimal.pdf
got all 1 citations from URLs
pdflatex not found. Please select a different --pdf-engine or install pdflatex

I installed TeX Live for Windows via Chocolatey. Now:

D:\SashaDebugging\KiraManubot>pandoc --filter=C:\Users\SashaChernykh\AppData\Roaming\npm\pandoc-url2cite.cmd --citeproc minimal.md -o minfetching citation from url https://papers.nips.cc/paper/5423-generative-adversarial-nets
got all 1 citations from URLs
Error producing PDF.
! LaTeX Error: File `xcolor.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

<kbd>Enter</kbd> file name:
! Emergency stop.
<read *>

l.36 \IfFileExists

Thanks.

phiresky commented 3 years ago

But I think that it would be nice to use pandoc-url2cite without full path declaring.

Yep. But then I don't think this is related to pandoc-url2cite. You can try running a different pandoc filter from here: https://github.com/jgm/pandoc/wiki/Pandoc-Filters

It should have the same issue for those. Then probably open an issue in https://github.com/jgm/pandoc instead.

Your second problem also looks unrelated to pandoc-url2cite but rather to the Tex installation (Tex on windows is weird I know but I can't really help you there). Try just pandoc test.md -o test.pdf without url2cite and you should get the same error. Tex has its own internal package manager, so you're probably missing the packag econtaining xcolor. Try installing miktex instead of texlive or figure out how to install the extra packages with texlive on windows. On Linux it's usually just apt install texlive-extra

phiresky commented 3 years ago

Closing this since I don't think it's related to pandoc-url2cite specifically and more about some Windows minutiae