SublimeText3 Build System for Pandoc - sublimetext3

I am trying to create a build system to run pandoc and save as pdf using pdflatex:
{
"selector": "text.html.markdown",
"working_dir": "$file_path",
"cmd": [
"C:\\Users\\Administrator\\AppData\\Local\\Pandoc",
"-f", "markdown",
"-t", "latex",
"--pdf-engine=pdflatex",
"-s",
"-o",
"C:\\Users\\Administrator\\Desktop\\output.pdf",
"$file"
]
}
I get an "Access is denied" error and cannot figure out what's wrong:
[WinError 5] Access is denied
[cmd: ['C:\\Users\\Administrator\\AppData\\Local\\Pandoc', '-f', 'markdown', '-t', 'latex', '--pdf-engine=pdflatex', '-s', '-o', 'C:\\Users\\Administrator\\Desktop\\output.pdf', 'C:\\Users\\Administrator\\Desktop\\CP10328R-TEST.md']]
[dir: C:\Users\Administrator\Desktop]
I have confirmed that I can write a file to the desktop without any issues, so the "access is denied" error must be related to something other than the output file. I have also tested using pdflatex as the engine and I can create PDFs from LaTex without any errors using an install of Texworks on the same machine, so the issue cannot be with LaTex. Finally, I have confirmed the path to pandoc is correct.

Related

Sublime3 - cannot find file specified when executing python script in Windows

I am trying to setup Sublime3 on Windows 10 Enterprise edition to execute a python script using Tools>Build.
Its a simple hello_world.py script.
Here's my output:
[WinError 2] The system cannot find the file specified
[cmd: ['python3', '-u', 'C:\\Users\\PBC9390\\Desktop\\python_work\\hello_world.py']]
[dir: C:\Users\PBC9390\Desktop\python_work]
[path: C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files\Git\bin;C:\Program Files\Git\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\IBM\EHLLAPI\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\1E\NomadBranch\;C:\Program Files (x86)\Common Files\Hitachi ID\;C:\Program Files\Common Files\Hitachi ID\;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Program Files\PuTTY\;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Amazon\AWSCLI\bin\;;C:\hashiCorp\Terraform;C:\Program Files (x86)\Webex\Webex\Applications;C:\HashiCorp\Vagrant\bin;C:\Users\PBC9390\AppData\Local\Microsoft\WindowsApps;C:\Users\PBC9390\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin]
Here's my Python3.sublime-build file:
{
"cmd": ["python3", "-u", "$file"],
}
Is this the problem? I'm not sure how its being converted with double backslash "\":
'C:\\Users\\PBC9390\\Desktop\\python_work\\hello_world.py'

execute a deletion command in sublime text's build command?

So I am using sublime text 3 and I have the following build system to remove the existing executable then build then run, but it seems deletion command is not working. So is there a way to actually do this command in the build system?
{
"cmd": ["del", "${file_base_name}","&", "g++", "${file}", "-std=c++11", "-o", "${file_path}/${file_base_name}", "&", "start", "cmd", "/c", "${file_base_name} & echo. & pause"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"encoding":"utf-8",
}
I found the problem by myself. In win32 you should delete "${file_base_name}.exe rather than "${file_base_name}.
hope this can help others.

Install lisp kernel in IPython

I'm trying to install cl-jupyter. (Debian)
I've done the following steps:
install gcl (apt-get install gcl)
install sbcl (apt-get install sbcl)
run command python3 ./install-cl-jupyter.py
try to run command sbcl --load ./cl-jupyter.lisp but I get the following and don't know what to do. I've tried to choose all option, but nothing happend.
Output:
This is SBCL 1.2.4.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
debugger invoked on a SB-C::INPUT-ERROR-IN-LOAD in thread
#<THREAD "main thread" RUNNING {10039CE993}>:
READ error during LOAD:
Package ASDF does not exist.
Line: 3, Column: 29, File-Position: 150
Stream: #<SB-SYS:FD-STREAM
for "file /home/ivan/all/language_packages/cl-jupyter-master/cl-jupyter.lisp"
{10039D64A3}>
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT ] Abort loading file "/home/ivan/all/language_packages/cl-jupyter-master/./cl-jupyter.lisp".
1: [CONTINUE] Ignore runtime option --load "./cl-jupyter.lisp".
2: Skip rest of --eval and --load options.
3: Skip to toplevel READ/EVAL/PRINT loop.
4: [EXIT ] Exit SBCL (calling #'EXIT, killing the process).
(SB-C:COMPILER-ERROR SB-C::INPUT-ERROR-IN-LOAD :CONDITION #<SB-INT:SIMPLE-READER-PACKAGE-ERROR "Package ~A does not exist." {10039D9E83}> :STREAM #<SB-SYS:FD-STREAM for "file /home/ivan/all/language_packages/cl-jupyter-master/cl-jupyter.lisp" {10039D64A3}>)
update file ipython/your_kernel_name/kernel.json
from
{"language": "lisp", "display_name": "SBCL Lisp", "argv": ["sbcl", "--non-interactive", "--load", "/home/ivan/all/language_packages/cl-jupyter-master/cl-jupyter.lisp", "/home/ivan/all/language_packages/cl-jupyter-master/src", "/home/ivan/all/language_packages/cl-jupyter-master", "{connection_file}"]}
to
{
"argv": [
"sbcl","--non-interactive", "--load",
"/path/to/cl-jupyter/cl-jupyter.lisp",
"/path/to/cl-jupyter/src",
"/path/to/cl-jupyter",
"{connection_file}"
],
"display_name": "SBCL Lisp",
"language": "lisp"
}
(information from here)
Now I can see the SBCL Lisp kernel in jupyter but it doesn't work and breaks all the time when I try to write and run smth.
Please, help
I've done it! Now it works fine.
1)I forgot to install quicklisp
2) here i just put right paths to cl-jupyter.lisp, /src, /cl-jupyter:
{
"argv": [
"sbcl","--non-interactive", "--load",
"/path/to/cl-jupyter/cl-jupyter.lisp",
"/path/to/cl-jupyter/src",
"/path/to/cl-jupyter",
"{connection_file}"
],
"display_name": "SBCL Lisp",
"language": "lisp"
}

SublimeHaskell cannot build

I am using Sublime Text 3 on mac el capitan, and when I try to build a haskell file, I receive the following error message:
[Errno 2] No such file or directory: 'runhaskell'
[cmd: ['runhaskell', 'path_to_my_file']]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]
The SublimeHaskell User settings is as follows:
{
"add_to_PATH":
[
"/Users/durand/Library/Haskell/bin/",
"/usr/local/bin/"
],
"enable_ghc_mod": false,
"enable_hdevtools": false,
"enable_hsdev": false,
}
I don't know why the path in error message does not include the path I specified in the User setting, and am not sure if this causes the problem. But using SublimeHaskellREPL: ghci currentfile works fine.
Also, the runhaskell is located in /usr/local/bin/ but for some reason I cannot make this directory seen by SublimeHaskell. In addition, both the echo "$PATH" and /etc/paths tell me that the /usr/local/bin/ is in the path variable, which confuses me even further.
Any help is appreciated. Thanks in advance.

Fix substitution of “shell_cmd” on Mac OSX in Sublime Text 3

I have a problem with my build system specified in project settings. Currently my project settings look like this
{
"build_systems":
[
{
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"name": "Anaconda Python Builder",
"selector": "source.python",
"shell_cmd": "$project_path/bin/python -u $file"
}
],
"folders":
[
{
"file_exclude_patterns":
[
"pip-selfcheck.json",
"pyvenv.cfg"
],
"folder_exclude_patterns":
[
"lib",
"include",
"bin"
],
"follow_symlinks": true,
"path": "."
}
],
"settings":
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
"*.ico",
"*.eot",
"*.pdf",
"*.swf",
"*.jar",
"*.zip",
"client/node_modules/**",
"data/**"
]
}
}
The actual problem problem is in the line:
"shell_cmd": "$project_path/bin/python -u $file"
Every time I close sublime and reopen it my shell_cmd gets substituted with this
"shell_cmd": "\"python\" -u \"$file\""
Which fails my build. Is there a way to fix this problem? What do I do to disable this automatic substitution?
Mac OS X 10.11.3
Sublime Text 3103
I already answered this question in the Anaconda's issues tracker but I will do it here for any other user that lands in this question with a similar problem.
That specific build system is used by Anaconda itself and that is why it is called "Anaconda Python Builder", it will update the "shell_cmd" with anything that you used as configuration for your "python_interpreter" setting into your anaconda's settings file (general, user or per project).
If you have specific needs for your build system, you should create a new build entry with your own options and stick to that one. Anaconda's build system is a convenience for users that need to use their configured Python interpreter instead of the embedded ST3 one.
I solved this issue without a custom build system by adding python_interpreter: 'full/path/to/python' to the settings dictionary. python part in the Anaconda Python Builder shell_cmd gets replaced with it.

Resources