From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brady Trainor Subject: Re: Sagemath with org-babel? Date: Tue, 04 Nov 2014 14:26:07 -0800 Message-ID: <877fzaob5s.fsf@uw.edu> References: <50203b7f.a14dec0a.6450.ffffdea3@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlmYT-0007qo-Ig for emacs-orgmode@gnu.org; Tue, 04 Nov 2014 17:26:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlmYO-0005J7-PY for emacs-orgmode@gnu.org; Tue, 04 Nov 2014 17:26:25 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:53283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlmYO-0005Hd-JB for emacs-orgmode@gnu.org; Tue, 04 Nov 2014 17:26:20 -0500 Received: by mail-pd0-f182.google.com with SMTP id fp1so14568810pdb.13 for ; Tue, 04 Nov 2014 14:26:18 -0800 (PST) In-Reply-To: <50203b7f.a14dec0a.6450.ffffdea3@mx.google.com> (Darlan Cavalcante Moreira's message of "Mon, 06 Aug 2012 18:47:40 -0300") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Darlan Cavalcante Moreira writes: > I have done this in the past, I don't have the files anymore. However, as > Tom says it is very easy to modify the templates to make org work with > sage. I remember I only needed some search and replace to make it work. > > Also, you may want to have a look at sage-mode first if you haven't > already. > http://wiki.sagemath.org/sage-mode > > With sage mode installed its is a simple matter to make "C-c '" edit the > source code in sage-mode. > I have tried "C-c '", but it did not work. My attempt: As suggested at https://bitbucket.org/gvol/sage-mode/src, I try #+BEGIN_SRC sh sudo sage -f sage_mode #+END_SRC After running this, the end of message includes the suggestion to add #+BEGIN_SRC emacs-lisp (add-to-list 'load-path "/usr/lib/sagemath/local/share/emacs/site-lisp/sage-mode") (require 'sage "sage") (setq sage-command "/usr/lib/sagemath/sage") #+END_SRC But if I try =C-c '= in a block like #+BEGIN_SRC sage f(x) = x^2 integrate(f(x), 1, 3).n() #+END_SRC I get ,---- | org-edit-src-code: No such language mode: sage-mode `---- Also, I cannot publish to html in this way. _I tried copying ob-python.el to a file ob-sage.el and replacing all instances of "python" and "py" with "sage"._ I also tried #+BEGIN_SRC emacs-lisp (add-to-list 'org-src-lang-modes '("sage" . sage)) (org-babel-do-load-languages 'org-babel-load-languages '((sage . t) (emacs-lisp . t) (latex . t) (sh . t))) #+END_SRC But it still tells me "No such language mode: sage-mode". Thoughts? -- Brady > > -- > Darlan > > At Mon, 06 Aug 2012 11:33:47 -1000, > tsd@tsdye.com (Thomas S. Dye) wrote: >> >> Aloha Johan, >> >> Babel can be configured to support new languages, see >> http://orgmode.org/worg/org-contrib/babel/languages.html#develop >> >> Someone will need to write language specific functions to support code >> block evaluation in sage. There is a template for this. The functions >> written for other languages provide good examples of what the >> sage-specific functions might look like. >> >> hth, >> Tom >> >> >> >> Johan Ekh writes: >> >> > Hi all, >> > sage is not listed under languages that can be used with >> > org-babel. But it is based on >> > Python, is it possible to use it with org-babel? >> > >> > /Johan >> > >> > Sent from my iPad >> > >> >> -- >> Thomas S. Dye >> http://www.tsdye.com >>