tbfisher / sublimetext-Pandoc

A Sublime Text plugin that uses Pandoc to convert text from one markup format into another. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, OPML, or Haddock markup to XHTML, HTML5, HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides, Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML, EPUB version 2 or 3, FictionBook2, DocBook, GNU TexInfo, Groff man pages, Haddock markup, OPML, LaTeX, ConTeXt, LaTeX Beamer slides, PDF via LaTeX, Markdown, reStructuredText, AsciiDoc, MediaWiki markup, Emacs Org-Mode, Textile, or custom writers can be written in lua.
MIT License
137 stars 26 forks source link

Citations not working #25

Closed donlelek closed 9 years ago

donlelek commented 9 years ago

Hi, thanks for your extension, I use it every day now. But, when I try to add references it just doesn't work.

I've modified the "Pandoc.sublime-settings" as follows (top level "default")

      "Microsoft Word": {
        "scope": {
          "text.html": "html",
          "text.html.markdown": "markdown"
        },
        "pandoc-arguments": [
          "-t", "docx", "--mathjax", "--filter", "pandoc-citeproc"
          // also tried  "--filter pandoc-citeproc"
        ]
      }

this results in the error: pandoc: Filter pandoc-citeproc not found

same error if I add it to the PDF settings.

If i do it from the terminal using pandoc -o doc.docx doc.md --filter pandoc-citeproc --mathjax it works. What am I doing wrong?

Help please

donlelek commented 9 years ago

Hi @tbfisher, I tried "--filter", "/usr/local/bin/pandoc-citeproc" which seems to find the filter but now I get another error: pandoc-citeproc: Could not find bibliography.bibtex, even if I add the full path to the bibliography in the YAML header.

donlelek commented 9 years ago

Hi @tbfisher , I found a couple ways to make it work. If you add the line "--filter", "/usr/local/bin/pandoc-citeproc" pandoc-citeproc works but it can't find the bibtex source file, a workaround is to include the references within the document using citeproc YAML headers, i.e.:

---
references:
- title: One-click science marketing
  volume: '11'
  URL: http://dx.doi.org/10.1038/nmat3283
  DOI: 10.1038/nmat3283
  issue: '4'
  container-title: Nature Materials
  publisher: Nature Publishing Group
  author:
  - family: Fenner
    given: Martin
    orcid: 0000-0003-1419-2405
  page: 261-263
  id: fenner2012a
  type: article-journal
  issued:
    date-parts:
      - 2012
      - 3
---

This has some advantages if you are collaborating with someone and want to share the bibliography sources.

Another way, if you have only one bibtex file for all your references, is to reference that file by adding the line --bibliography=/path/to/your/bibliography.bib.

Note that for both options you don't have to specify your bib file within the document. Sorry for bothering you but I think that this is a great extension and I could not figure out how to make it work. Feature request: find a way to make this work just by adding your bib file in the YAML header.

abunavas commented 4 years ago

@donlelek Sorry to resurrect old threat, but can you explain for n00b how you produce citations, I try with user settings but haven't success.

donlelek commented 4 years ago

Hey @abunavas, I'm sorry, but I no longer use this extension. I mostly use R so I am using Rstudio and RMarkdown. Check this out if you are interested.