compile fortran code from sublime Text - sublimetext2

In order to produce the .o file for a fortran program I write the following command in my command prompt in windows.
gfortran -c test.for
What I would like to do is either to access cmd from Sublime Text 2 directly or to link the previous command to a shortcut in sublime and get the output in the sublime command line.
In other discussions it is stated that you can do that for the Intel Fortran Compiler.

See this article about build systems in Sublime Text: https://docs.sublimetext.io/guide/usage/build-systems.html
Basically, you can configure Sublime so that it runs a specified command when you select the build type and press F7. The simplest type of build configuration would be a file called fortran.sublime-build with the following contents:
{
"cmd": ["gfortran", "-c", "$file"]
}
The output of the program will appear in the Sublime Console (View -> Show Console).

Related

Jupyter Notebook print to PDF prints unexpected text

I have been having issue downloading a Jupyter Notebook to PDF. My original error was
Solving "500: Internal Server Error, nbconvert failed: xelatex not found in PATH".
For this I ran from Anaconda Prompt:
conda install -c conda-forge miktex
To solve this I ran from Python Command Prompt:
jupyter nbconvert --to pdf C:\Users\myProfile\myFile.ipynb
I then got an error about Pandoc missing and so to solve this I ran from Anaconda Prompt:
conda install -c conda-forge pandoc
I'm now able to create a pdf but it has one page of gibberish and the actual text is not formatted.
The following in a markdown cell:
<h1>Test Presentation</h1>
<h2>Today's Date</h2>
<h3>Author</h3>
produces:
I also have MikTex and Pandoc installed on my computer and have added their paths to my System Properties Environment Variables. I get no error messages but this gibberish of a PDF.
try the following steps:
from your command prompt install notebook-as-pdf (here are snyk and deps scurity analysis*)
pip install -U notebook-as-pdf
you also need an additional setup for chromium (performs HTML to PDF conversion - snyk, deps)
pyppeteer-install
open the notebook you wish to convernt, click on file -> Download As -> PDF via HTML,
if you prefer you can run it from your command prompt:
jupyter-nbconvert --to PDFviaHTML example.ipynb
note that it has a mid-low score because the last commit was on april, on the other hand it has no dependencies so from that angle you are good

Hart'ls Ruby Tutorial - Subl Gemfile not recognized

I'm brand new to Ruby and Rails, so sorry if this is a totally ridiculous question. The tutorial book that I'm reading says that I should be able to launch a Gemfile in Sublime Text directly from the command prompt using the subl Gemfile command. When I try this, I get an error that says "subl is not recognized as an internal or external command, operable program, or batch file".
I am in the right directory where the Gemfile is located.
Ruby is definitely installed and I am using the command prompt with Ruby and Rails.
i have the sublime text 2 and i added the path as i found,but no solution.i even tried :sublime_text Gemfile
i have tried so many different solutions but no result.
i'm using windows
Thank you in advance
the reason it isn't working isn't a rails question, it is because you haven't set up sublime to work using the command "subl" in your terminal. Try these commands. If you wish to understand the error better, just type in any gibberish into the terminal. It will tell you a similar thing.
sudomkdir /usr/local
sudomkdir /usr/local/bin
sudo ln-s/Applications/Sublime\Text\2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
EDIT
Sublime Text from Command Line (Win7)
https://teamtreehouse.com/forum/sublime-text-command-line-shortcut-windows
https://teamtreehouse.com/forum/ruby-on-rails-subl-command-not-found
Otherwise, you can refer to this
subl is Mac only.
For Windows, you need to add C:\Program Files (x86)\Sublime Text 2 to your Environment path,
This will work on Windows 7:
Right click My Computer, Properties, then Advanced System Settings, then Environment Variables.. Go down to System Variables, and edit PATH, you'll need to add the Path to Sublime.
Then you should be able to run sublime_text my-file from the command line. (Since the .exe is called sublime_text.exe

Run linux command within sublime plugin

I am currently writing a simple plugin for Sublime Text 2 to make a shortcut, running pdflatex program with my opened file as an option.
So there is a question: is there any way to run linux command from sublime? I haven't found appropriate function in Plugin API Reference.

Sublime Text 2 build command ignores the shebang

The Sublime text 2.0.1 (Mac OSX) build command ignores the shebang line a the top of my python file.
The shebang line has the full path to my python 3.2 installation :
#!/usr/local/bin/python3
However the python version being used is always 2.7.2. I'm maintaining code for both 2.7 and 3.2 and so must rely on the shebang line to be used.
Is there a way to configure the Sublime text 2 build system to look at the shebang?
Sublime does not use the shebang to determine the execution, it uses your build rule. You could customize the Python build rule to add variants for python2 and python3.
Official instructions for adding build variants.
Simplified example of build variants from another SO question.
Note that with build variants, the default is run by Command+B (Mac) or Control+B (Windows and Linux). The second variant can be run Command+Shift+B (Mac) or Control+Shift+B (Windows and Linux).
Have a look at Sublime Text Shebang plugin.
It adds a few commands that allow to run scripts, based on the shebang line, but the output will be placed on a new buffer, not in the console.

Send Text to REPL Using SublimeREPL and Sublime Text 2

I'm having trouble getting started with SublimeREPL. I have a python program, and can start a python interpreter inside of SublimeText2.
However, I would like to use either the Eval In Repl and Transfer to Repl features, but they don't seem to do anything. How do I associate a repl with my file in sublime text 2 so these will work?
History
To be honest eval for python never worked reliably. It was plagued with strange compilation errors (mainly caused by whitespace/blank lines) and dozens of unnecessary ">>> " prompts showing up during evaluation.
My attempt to fix it using temporary files was only moderately successful and broke down completely with the ability to run remote Pythons over ssh: http://www.youtube.com/watch?v=zodAqBvKQm0
Now
However it seems that I've finally cracked it :) (with a surprisingly short solution that feels hacky but AFAICT should be orders of magnitude more reliable than the previous one, link for the curious: https://github.com/wuub/SublimeREPL/blob/master/text_transfer.py#L43)
Howto
Install SublimeREPL 1.2.0 (released +- 10 minutes ago)
Run Python REPL (any one you wish, w/ or w/o virtualenv)
Focus a file you wish to evaluate
Tools -> SublimeREPL -> Eval in REPL -> File or [Ctrl+, f]
Play with other options (line evaluation should be useful, you only need one cursor in each line you wish to eval, try [Ctrl+Alt+<down-arrow>])
...
Profit! :)
I had the same problem, namely SublimeREPL wouldn't evaluate a file or selected lines. Amazingly this worked:
Remove REPL (Preferences-> Package Control -> Remove package)
Quit and restart Sublime Text
Install REPL (Preferences-> Package Control -> Install package)
Quit and restart Sublime Text
Voila!