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
136 stars 26 forks source link

Beamer config #16

Open py opened 10 years ago

py commented 10 years ago

I created a new format to create Beamer pdf slides:

"Beamer Slides": {
        "scope": {
          "text.html": "html",
          "text.html.markdown": "markdown",
        },
        "pandoc-arguments": [
          "-t", "beamer",
          "--latex-engine=C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe"
        ]
      }

I also added beamer to the pandoc-format-file list of extensions, which I believe makes it output a file instead of new buffer.

With the config above, I can generate a latex beamer document, but the ideal case is to create a beamer PDF directly from this command.

The example the pandoc command docs give for creating a beamer pdf:

pandoc -t beamer habits.txt -o habits.pdf

To solve this, there is a need to independently define the file extension in addition to the -t parameter. Some ideas:

  1. -t case logic in pandoc.py. If we know all the combos of to formats and desired extensions, we can add some logic in pandoc.py to solve this, e.g. IF t == "beamer", file-ext = "pdf". This would require more specificity within the pandoc-arguments format config file.
  2. New config parameter for file extension In addition to the pandoc-arguments parameters, add file-ext to define the extension to stick onto the end of the pandoc command. I think pandoc.py lines 117 to 123 would need to be modified to accommodate this.
tbfisher commented 10 years ago

Excellent, thanks for this. And I see now the need for defaults across transformation definitions as you commented on earlier. I'll work on merging this pull request and add a defaults feature.

py commented 9 years ago

@tbfisher Brian - first of all, thank you for creating this wonderful package. I'm starting to use it again frequently. I imagine you are busy with other things. Is there something I can do to help merge some of these old pull requests and put out a new release? Happy to help.