Giter Site home page Giter Site logo

tbfisher / sublimetext-pandoc Goto Github PK

View Code? Open in Web Editor NEW
137.0 10.0 26.0 77 KB

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.

License: MIT License

Python 100.00%

sublimetext-pandoc's Introduction

Pandoc Plugin for Sublime Text

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, TWiki markup, OPML, Emacs Org-Mode, Txt2Tags, Microsoft Word docx, LibreOffice ODT, EPUB, 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, TEI Simple, GNU TexInfo, Groff man pages, Haddock markup, InDesign ICML, OPML, LaTeX, ConTeXt, LaTeX Beamer slides, PDF via LaTeX, Markdown (including CommonMark), reStructuredText, AsciiDoc, MediaWiki markup, DokuWiki markup, Emacs Org-Mode, Textile, or custom writers can be written in lua.

Looking for Maintainers

If you use this and have any interest in helping to maintain it, please get in touch.

Installation

You need to install Pandoc, and this module:

For Sublime Text 2, use the 1.x branch.

Usage

The input format is specified by setting the syntax of the document.

Run Pandoc on the current document via the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows) by selecting "Pandoc". You will be presented with output formats to choose from.

Configure

You can fully configure the available formats, and configure the Pandoc options to customize transformation, via the plugin settings file. Via the application menu, go to "Preferences" -> "Package Settings" -> "Pandoc".

There are 2 possible top level settings keys, "user" and "default". If you use "default" in your user settings file, the default settings will be overwritten, but if you use "user" your settings will be merged into the default settings.

sublimetext-pandoc's People

Contributors

acheronfail avatar andy-5 avatar bryanlammon avatar codeman38 avatar cranej avatar dozed avatar fichtefoll avatar hugomallinson avatar jacobmovingfwd avatar jhultgre avatar jsadeli avatar k1th avatar markgrovs avatar mpvharmelen avatar neilbryant avatar philoserf avatar py avatar robinrosenstock avatar tbfisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublimetext-pandoc's Issues

assign key to a transformation

is it possible to bind a key to a specific transformation i.e. HTML. I know how to assign shortkey to a command in sublime text but don't know to assign it to a prompt (pandoc_prompt)

Error when running pandoc

I have been receiving this error when I run pandoc in Sublime Text 3 (on Windows 7 64 bit, if relevant):

tmlanguage error pandoc

I have installed pandoc 1.13.2 via the MSI windows installer. I have also added the MarkdownEditing package.

Pandoc --parse-raw

Trying to export markdown as pdf with TOC results in error:

Error when running:

[...]\AppData\Local\Pandoc\pandoc.exe -f markdown -V geometry:margin=1.25in -s --toc --number-sections --parse-raw -o [...]\appdata\local\temp\tmp38nn6v.pdf

--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.


Try pandoc.exe --help for more information.
  • happens only with PDF TOC or PDF TOC (Narrow Margins)
  • pandoc version used: pandoc 2.0.5

ST2 cannot seem to read Pandoc.sublime-settings

I'm using ST2 and manually obtained the 1.x branch with the following:

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone -b 1.x https://github.com/tbfisher/sublimetext-Pandoc

Then restarted ST2.

Verified I have the correct branch by viewing the readme: # Pandoc Plugin for Sublime Text 2

My user settings file looks like the following:

{
    "user": {
        "pandoc-path": "/usr/local/bin/pandoc"
    }
}

When I try to execute pandoc through the Command Pallete to convert orgmode to markdown, plaintext, anything, the console shows:

Traceback (most recent call last):
  File "./Pandoc.py", line 53, in transform
  File "./Pandoc.py", line 138, in _src_format
  File "./Pandoc.py", line 155, in _format_conf
KeyError: None

When I try to view the default package settings, the console shows:

Unable to open ~/Library/Application Support/Sublime Text 2/Packages/Pandoc/Pandoc.sublime-settings

I tried to work around this by adding the settings found in the defaults file to the user file, but I am getting the same stack trace in the console.

trouble with adding further pdf variables

First of all, thanks for making this. I'm having trouble adding additional variables to pdf creation. So while this works fine:

    "pandoc-arguments": [
      "-t", "pdf", "--latex-engine=xelatex"

This does not:

    "pandoc-arguments": [
      "-t", "pdf", "--latex-engine=xelatex", "--variable fontsize=12"

I've tried many permutations here but can't get this to pass additional variables on to Pandoc. Any ideas? Thanks!

Beamer config

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.

Markdown to Docx fails to render links correctly for complicated URLS

Issue noticed on: Sublime Text 3.0 Build 3143

When I use Pandoc to convert a Markdown file to a DocX, I'm finding that hyperlinks with complicated URLs like, for example, Jira comment permalinks, fail to render correctly.

Markdown example:

[link to the comment](https://jira.atlassian.com/browse/TRANS-2476?focusedCommentId=1627205&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1627205)

This renders in DocX as:

[link to the comment](https://jira.atlassian.com/browse/TRANS-2476?focusedCommentId=1627205&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1627205)

Otherwise, the DocX is rendering correctly, and other, less complicated hyperlinks render correctly. No errors are shown in the Sublime Text console. The same markdown file renders correctly with a HTML output.

Cannot open sublimetext-Pandoc

I am using archlinux

my user setting for pandoc : Pandoc.sublime-settings

{
// Sets the path to the pandoc binary.
"pandoc-path": "/usr/bin/pandoc",

// Opens output in new buffer (instead of replacing input in same)
"new-buffer": 1
}

Traceback (most recent call last):
File "/opt/sublime_text_3/sublime_plugin.py", line 526, in run_
return self.run()
File "/home/user/.config/sublime-text-3/Packages/Pandoc/Pandoc.py", line 35, in run
self._setting('formats').keys(), self.transform)
File "/opt/sublime_text_3/sublime.py", line 341, in show_quick_panel
if len(items) > 0 and isinstance(items[0], list):
TypeError: 'dict_keys' object does not support indexing

Custom format configuration to render html with table of contents

I am attempting to recreate this pandoc command:

pandoc -i input.md -s --toc -o output.html

by editing the Pandoc.sublime-settings, and I cannot get it to work. Ideally, I would like to create a new output format (html_toc), but have not been able to successfully generate the html with toc.

I tried this, to no avail:

  "format_html": {
    "scope": "text.html",
    "syntax_file": "Packages/HTML/HTML.tmLanguage",
    "to": ["-s", "--toc", "-o"]
  }

Any suggestions? Thank you for this plugin - I use it daily.

Not loading user settings

can't locate pandoc even when "pandoc-path" was set in user settings, seems the user setting is not loaded correctly, works fine when default setting is correct.

Settings per-project

A local settings file would turn this package into a more flexible one. We could have different settings for each "project". For example, the package could traverse the folders (from current to root folder) to find a pandoc-sublime.config file. So, most of the problems here could be solved in this way: setting input/output folder, output format, arguments for pandoc, etc...

Error when compiling using PDF TOC on linux

Error when running:

/usr/bin/pandoc -f markdown -s --toc --number-sections --parse-raw --latex-engine=C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe -o /tmp/tmpuwmaes.pdf

pandoc: C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe not found. C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe is needed for pdf output

It's because you use direct path to latex engine in Pandoc.sublime-settings
in lines 99, 111, 137, 148 and 159:

"--latex-engine=C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe"

It's working without any problems when I overwrite these in user settings.

remove pandoc.py:109 cmd.extend(['-f', iformat]) line

pandoc.py:109 cmd.extend(['-f', iformat]) should be removed or optioned, since output options should be in .settings file, not in code. Now this cmd.extend(['-f', iformat]) results in -f markdown in my command line, where I want to set the -f params manually.

How to avoid the popup every use? Or set a hotkey?

Hello,

Right now I'm using this to convert markdown to PDF. This is the only way I'm using this.

Is there a way to avoid the dropdown option every time? As I want to convert to PDF every time I use this.

Also, is there a way I can link this into the build system? So I can just click Ctrl+B when editing markdown and auto generate the PDF?

Maybe I'm using this extension incorrectly or there's an alternative. I've had a quick look at the settings file and couldn't find an option.

I've tried setting up a hotkey:

{ "keys": ["ctrl+shift+b"], "command": "pandoc", "args": {"transformation": "PDF"}},

However this fails with:

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 812, in run_
    return self.run(edit, **args)
  File "Pandoc in /home/_/.config/sublime-text-3/Installed Packages/Pandoc.sublime-package", line 103, in run
TypeError: string indices must be integers

rst to pdf only st2 ,not st3 ?

I get the following error when trying to Render rst to pdf. I have already configured the tool and my pandoc path is :

"pandoc-path": "C:/Users/P70/AppData/Local/Pandoc/pandoc.exe"

"PDF": {
        "scope": {
          "text.html": "html",
          "text.html.markdown": "markdown"
        },
        "pandoc-arguments": [
          "-t", "pdf",
          "--latex-engine=xelatex",
         "--template=pm-template.latex"
        ]
      },

Fail to generate output.
_

error: No transformations configured for the syntax Packages/RestructuredText/reStructuredText.sublime-syntax
Traceback (most recent call last):
File "D:\md\Sublime Text Build 3126 x64\sublime_plugin.py", line 797, in run_
return self.run()
File "Pandoc in D:\md\Sublime Text Build 3126 x64\Data\Installed Packages\Pandoc.sublime-package", line 46, in run
File "D:\md\Sublime Text Build 3126 x64\sublime.py", line 448, in show_quick_panel
if len(items) > 0 and isinstance(items[0], list):
TypeError: object of type 'NoneType' has no len()

_

But, I do rst to pdf is successful with pandoc st2!

Assistance appreciated.

Platform:
Window 10
sublime 3

Assign key binding for specific output format.

Was wondering if it's possible to assign an arbitrary key binding to a specific Pandoc output format. For instance, when editing markdown files and want a PDF output, I don't want to open the Command Palette, type "Pandoc," and then "PDF." As far as I know, the output formats are not available as standalone individual commands. Is there a workaround?

Ability to create custom output formats

I would like to create custom output formats available from the Sublime Text command palette. For example, I want to define "Pandoc: PDF-TOC" with something like this:

  "format_pdf-toc": {
    // use --latex-engine=engine where engine is one of pdflatex|lualatex|xelatex
    // This may need to be specified with a full path (e.g. on a mac with
    // BasicTeX "/usr/texbin/pdflatex").
    "to": ["--latex-engine=pdflatex", "-s", "--toc", "--number-sections"]
  }

I've tried adding new formats and format configs to pandoc.sublime-settings, but have not yet had success. Does doing something like this require changes to pandoc.py?

Not reloading new overwritten settings after commenting them from inside user settings

Just like the title says.
To reproduce:

  1. Check behaviour of given setting
  2. Overwrite some settings via User settings
  3. Check if they affect sublime-pandoc behaviour,
  4. Delete your changes
  5. Check behaviour - for me it's working like in point 3., but it should work like in point 1.

My change: removing "--latex-engine=C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe" from "user">"transformations">"PDF TOC">"pandoc-arguments"

sublimetext-pandoc with pandock in docker container

hi,
i have installed pandoc in docker container.
on system i have alias
alias pandoc='docker run -ti --rm -v ${PWD}:/source --rm feferd/pandoc'
i can run pandoc from cli but from sublimetext with sublimetext-pandoc is not working

i also made bash script pandoc in ~/bin/ folder which executes
docker run -ti --rm -v ${PWD}:/source --rm feferd/pandoc
still not working

any sugestions how can i run with sublimetext-pandoc

thx
dusan

Fail to generate output. [Errno 20] Not a directory

Hello,

Thanks for the package, I get the following errors

Fail to generate output.
[Errno 20] Not a directory

And

The document “tmp4jll9b.pdf” could not be opened.

It always opens Skims and sometimes builds a pdf, sometimes not.

Any guidance would be great,

Thanks,

Can not output Chinese character in paragraphs that also contain English characters

modified the settings related with PDF to:

"PDF": {
            "scope": {
              "text.html": "html",
              "text.html.markdown": "markdown"
            },
            "pandoc-arguments": [
              "-t", "pdf",
              "--latex-engine=/Library/TeX/texbin/xelatex",
              "--filter", "/usr/local/bin/pandoc-citeproc",
              "-V", "mainfont=Kai"
            ]
 },

the output file still shows whitespaces where there are Chinese characters in paragraphs that also contain English characters.

I am using Sublime Text 3 with pandoc on a Mac with macOS Sierra.

Encoding error of result

I get an error with the result encoding under Windows:

Traceback (most recent call last):
  File ".\Pandoc.py", line 88, in transform
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 487: ordinal not in range(128)

The fix is to encode the result as UTF-8:

view.replace(edit, region, result.decode('utf8'))

Pandoc plugin not working

I'm on LDME 15 with ST3 and pandoc installed:

$ which pandoc 
/usr/bin/pandoc
$ pandoc -v
pandoc 1.9.4.2
Compiled with citeproc-hs 0.3.4, texmath 0.6.0.6, highlighting-kate 0.5.1.
Syntax highlighting is supported for the following languages:
    Actionscript, Ada, Alert, Alert_indent, Apache, Asn1, Asp, Awk, Bash,
    Bibtex, Boo, C, Changelog, Clojure, Cmake, Coffeescript, Coldfusion,
    Commonlisp, Cpp, Cs, Css, D, Diff, Djangotemplate, Doxygen, Dtd, Eiffel,
    Email, Erlang, Fortran, Fsharp, Gnuassembler, Go, Haskell, Haxe, Html, Ini,
    Java, Javadoc, Javascript, Json, Jsp, Latex, Lex, LiterateHaskell, Lua,
    Makefile, Mandoc, Matlab, Maxima, Metafont, Mips, Modula2, Modula3,
    Monobasic, Nasm, Noweb, Objectivec, Objectivecpp, Ocaml, Octave, Pascal,
    Perl, Php, Pike, Postscript, Prolog, Python, R, Relaxngcompact, Rhtml, Ruby,
    Scala, Scheme, Sci, Sed, Sgml, Sql, SqlMysql, SqlPostgresql, Tcl, Texinfo,
    Verilog, Vhdl, Xml, Xorg, Xslt, Xul, Yacc, Yaml
Copyright (C) 2006-2012 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.

But I got error when selecting "Pandoc" from the command palette:

SublimeLinter: annotations activated: <builtin> 
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 526, in run_
    return self.run()
  File "Pandoc in /home/kylee/.config/sublime-text-3/Installed Packages/Pandoc.sublime-package", line 35, in run
  File "/opt/sublime_text/sublime.py", line 341, in show_quick_panel
    if len(items) > 0 and isinstance(items[0], list):
TypeError: 'dict_keys' object does not support indexing

My user Pandoc.sublime-settings:

{
  // Sets the path to the pandoc binary.
  "pandoc-path": "/usr/bin/",
}

ODT generation failed if passing metadata yaml file

If you want to pass some metadata on this form It works:

"format_odt": {
"to": [ "--reference-odt=/path/to/Escriptori/odtref.odt",
"--template=/path/to/default.opendocument",
"--metadata=author:An author",
"--metadata=title:A Title"
]
},

But it doesn't work if you're using a yaml file:

"format_odt": { "to": [ "--reference-odt=/path/to/odtref.odt", "--template=/path/to/default.opendocument", "--metadata=/path/to/metadata.yaml" ] },

It renders only the metadata values but not the body of the document.

Save file and open in Latex at the same time. Create LaTeX output template or for HTML 5.

Create the below thing to output to latex but can I specify this to save to file as well as open the buffer or is that not possible?

I assume if I put latex in the file list at the end it will always save the file but I want it to save and open.

"LaTeX": {
        "new-buffer": 1,
        "scope": {
          "text.html.markdown": "markdown"
        },
        "syntax_file": "Packages/LaTeX/LaTeX.tmLanguage",
        "pandoc-arguments": [
          "-t", "latex",
          "--natbib",
          "--bibliography=/Users/big/Dropbox/Research/MyWork/Bibtex/library.bib",
          "--template=/Users/big/Dropbox/SyncedPrograms/pandoc/pandoc-templates/default.latex",
        ]
      },

User settings for different platforms (Windows, OSX, Linux)

Hi,
is there a way to define different pandoc-paths in user settings?
I'm using ST3 and am synching settings between different devices (Mac, Linux, Windows).
Therefore, pandoc will reside in different locations, based on OS used.

I'v tried to use syntax similar to ST3 build system:
{
"user": {
"windows": {
"pandoc-path": "C:/Users/dummy/AppData/Local/Pandoc/pandoc.exe",
},
"osx": {
"pandoc-path": "/usr/local/bin/pandoc",
},
}
}
but without success. Pandoc was not found (even paths are correct).

Any help would be appreciated - especially this plug is of great help!
Thanks!

Running Pandoc ST3 fails

I am running MacOS Sierra 10.12.3, Sublimetext 3 build 3126 and have install Pandoc plugin in order to convert markdown to PDF.

I have installed Pandoc .19.2.1 via Homebrew.

If I open Pandoc (using shift+CMD+P), typing 'pandoc' to select pandoc and then hit enter I get error message in console stating:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 797, in run_
    return self.run()
  File "Pandoc in /Users/cb/Library/Application Support/Sublime Text 3/Installed Packages/Pandoc.sublime-package", line 45, in run
  File "Pandoc in /Users/cb/Library/Application Support/Sublime Text 3/Installed Packages/Pandoc.sublime-package", line 54, in transformations
  File "Pandoc in /Users/cb/Library/Application Support/Sublime Text 3/Installed Packages/Pandoc.sublime-package", line 215, in _s
KeyError: 'transformations'

I am pretty sure I have had this running before.

Assistance appreciated.

Colin

Everytime a Command Prompt by Pandoc pops up on Windows

Everytime when sublimetext-pandoc is executed the command prompt from pandoc pops up and stays open as long as the pandoc is parsing on Windows, which is very annoying and Sublime loses focus from the text. One possible solution would be to set shell=True in the subprocess.Popen invocation.

save generated file in current folder

Is there a way to have this automatically save the generated file in same folder as the source file. And also to create it with the same name as the source file? This would make the process much smoother.

Latex Engine specification in default config breaks non-Windows platforms

specifically, in the default configs for beamer and s5, we have as one of the arguments

"--latex-engine=C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe"

which naturally breaks on linux etc. Please don't do this. In most sane configurations the latex engine should already be in $PATH. Alternatively, provide a way to let us specify a latex engine elsewhere that is used for any latex-based output format.

[WinError 2] The system cannot find the file specified

I get the following error when trying to Render Markdown to HTML. I have already configured the tool and my pandoc path is :

"pandoc-path": "C:/Users/Farid/AppData/Local/Pandoc/pandoc.exe"

Fail to generate output.
[WinError 2] The system cannot find the file specified

it is also worth noting that my settings work with windows 7 but not with windows 8.1!

Platform:
Window 8.1
sublime 3

Could you open converted output into new buffer (instead of current)?

Many thanks for making Pandoc available in ST2. I'm no Python coder, but would like to modify the package to open the converted output into a new buffer (instead of overriding the current one). Could that be added as an option?
Also could PDF be added as an output format for those of us who have Latex installed locally?

These would be very nice enhancements.

Thanks, --Mel.

Pandoc package fails to make pdf

I am trying SublimeText3 on OS X and have installed the Pandoc package.

I don't know if I have to do anything else to set this up and can't find any other instructions but when I select Pandoc I only get four options

PDF
Microsoft Word
HTML5
Markdown (Pandoc)

I tried PDF and got this error.

Error when running:

/usr/local/bin/pandoc -f markdown -o /var/folders/cr/4qc8w69d2v17nvgmt0phxxh80000gp/T/tmp25n8ls.pdf

pandoc: pdflatex not found. pdflatex is needed for pdf output.

I also tried Microsoft Word, but it seem to want to open Word, which I don't have on my Mac.

Where can I look for instructions on how to fix these problems?

Unable to create PDFs

Hello tbfisher,
This package is great! I'm using it on my Windows machine without any issues, but when I try to run pandoc on my Mac:

screen

I get this message:

Could not find pandoc executable on PATH

This was after installing pandoc via Homebrew:

homebrew

In the package user settings, I changed the User Settings to the location indicated in the terminal above.

  "default": {

    // path to the pandoc binary. Default locations per platform:
    // -  mac
    //    "pandoc-path": "/usr/local/Cellar/pandoc/",

I'm sure that I am just overlooking something simple, but I'd really appreciate some feedback.

-mjfrigaard

Citations not working

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

[Windows] Cannot find pandoc executable in PATH even pandoc.exe is in PATH

On Windows, this plugin always cannot find pandoc executable in PATH even pandoc.exe is in PATH environment. The only way I can make it work is set pandoc-path explicitly which is painful because I use sublime text in multiple machines and platforms.

I think it's a bug. In Pandoc.py line 95, _find_binary was called without extension name (.exe) as below:

_find_binary('pandoc', _s('pandoc-path'))

On windows, this function should be called as `_find_binary('pandoc.exe', _s('pandoc-path'))'.

Thanks,
Crane

Specifying "font_size" and other sublime settings in Pandoc.sublime-settings

I realise I am likely making a noob mistake - but is it possible to specify a font_size etc for any document open using the pandoc syntax within Pandoc.sublime-settings?
For example, within Python.sublime-settings I have:

{
"font_size": 10,
...
}

Which sets the font size for all .py documents to 10 and works the same within other Language.sublime-settings. However, including it or any other sublime setting in Pandoc.sublime-settings seems to have no effect.

Error when using relative images

I get an error when trying to convert my Markdown file with relative image pathes. In my oppinion the reason is that the current directory is net set to the docuemts directory before starting pandoc. This should be done in order to allow relative file imports in future versions.

error

Running Pandoc with your package results in output with [CR] displayed for line endings

Though the [CR] are annoying, the line spacing initially looks fine. Those [CR] are interpreted by SublimeText such that if I, say, run HTMLBeautify (which I want to do), I get a blank line following every [CR] in the reformatted text. If I use HTMLPrint the resulting HTML file displayed in a browser also has blank lines inserted. If, say, I use a modified Pandoc entry in your package to create a plaintext output file, I can copy the pandoc output from your package into a new window and the pasted text has extra lines. I've added some screen shots to show what I mean.

I cannot figure out what's going on. I chose your package for its ease of configuring. Pandown, using the same pandoc.exe binary, does not put the [CR] line endings, so it's something your package is doing.

Changing line endings using the Sublime-text menu from Windows to Unix and back changes nothing. If I save/name the output document, close it, then reopen it, the [CR] are gone. So it appears to be something in the buffered output that's removed when the file is saved by ST3. Very odd.

pandoc plain output 2015-03-02 14_25_22_sublime text
pandoc plain output copied to new document in st3 2015-03-02 14_25_22_sublime text

How to specify a outputfile based on the basefilename of the input file

Hi,

I am new to ST3 and your Pandoc package and as a non programmer I struggle to find the right option. I would like that the output file for pandoc should be based on the input filename.

Example:
input: document1.md
output: document1.docx

I tried to add the following in my pandoc user settings:

"pandoc-arguments": [
          "-t", "docx",
          "-o", "$file_base_name.docx",
          // if -o or --output missing, will write to a temporary file
          // "--output=~/Downloads/output.pdf"
        ]

But that generates unfortunately only a file called $file_base_name.docx.

How would I do that?

"pdflatex not found. Please select a different --pdf-engine or install pdflatex"

I am running MacOS High Sierra 10.13.4, Sublimetext 3 build 3176, MacTex 2018, and have installed Pandoc plugin in order to convert markdown to PDF. (I had been using this plugin for years with previous versions of these softwares).

I have installed pandoc 2.2.1 via Homebrew.

If I run the plugin for PDF output, it fails and I get in the console:

error: Error when running: /usr/local/bin/pandoc -f markdown --pdf-engine=/Library/TeX/texbin/pdflatex --output=/Users/sylvain/Desktop/output.pdf --filter=/usr/local/bin/pandoc-citeproc --bibliography=/Users/sylvain/Dropbox/My_Library/Library_Sylvain.bib pdf-engine /Library/TeX/texbin/pdflatex not known

I have tried to change the pdflatex path in the user Pandoc.sublime-settings to:

"--pdf-engine=pdflatex"

and

"--pdf-engine=/usr/local/texlive/2018/bin/x86_64-darwin/pdflatex"

but I get the same error message.

If I run pandoc -s worldliness.txt -o worldliness.pdf --pdf-engine=pdflatex --filter=/usr/local/bin/pandoc-citeproc --bibliography=/Users/sylvain/Dropbox/My_Library/Library_Sylvain.bib from the command line, I get a good PDF.

I would appreciate any help. This plugin was really central to my workflow. Not a computer person here, so apologies if my message is naive or poorly phrased.

Master release isn't directly installable via PackageControl

You specified two releases that point to the 1.x and 2.x branches respectively. So it isn't possible to install the latest master release via PackageControl.

Your 2.x branch for ST3 doesn't include the latest commits for output-local. Please change that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.