From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: strange output when executing matlab using babel, strange , Date: Fri, 31 May 2019 09:57:53 -0400 Message-ID: References: <875zpqydo0.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003c0033058a2f5d12" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:37417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWi0C-0008AP-Uo for emacs-orgmode@gnu.org; Fri, 31 May 2019 09:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWi09-0002HF-8A for emacs-orgmode@gnu.org; Fri, 31 May 2019 09:55:23 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:40287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWi07-0002DS-BK for emacs-orgmode@gnu.org; Fri, 31 May 2019 09:55:19 -0400 Received: by mail-wr1-x434.google.com with SMTP id p11so1765807wre.7 for ; Fri, 31 May 2019 06:55:17 -0700 (PDT) In-Reply-To: <875zpqydo0.fsf@mat.ucm.es> 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" To: org-mode-email --0000000000003c0033058a2f5d12 Content-Type: text/plain; charset="UTF-8" I believe you are seeing org's escaping at play. It puts a comma in front of the leading *. It must think that it is a heading in org-syntax, and so it escapes it to avoid some issues. I think here it is a bug since that is not a heading. can you use some other leading character? I don't think the * have any significance in latex. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Fri, May 31, 2019 at 9:11 AM Uwe Brauer wrote: > > > Hi > > I am running Ubuntu 16.06, matlab 2018b and I am using the python > kernel to use matlab from within org mode > > > Thanks to John Kitchin, I have the following setting > > * Lisp setting > #+BEGIN_SRC emacs-lisp > (setq org-confirm-babel-evaluate nil) ;don't prompt me to confirm > everytime I want to evaluate a block > > ;;; display/update images in the buffer after I evaluate > (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append) > > > (add-to-list 'org-src-lang-modes '("matlab" . matlab)) > (setq python-shell-interpreter "python3") > > ;; set default headers for convenience > (setq org-babel-default-header-args:matlab > '((:results . "output replace") > (:session . "matlab") > (:kernel . "matlab") > (:exports . "code") > (:cache . "no") > (:noweb . "no") > (:hlines . "no") > (:tangle . "no"))) > > (defalias 'org-babel-execute:matlab 'org-babel-execute:ipython) > (defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython) > (defalias 'org-babel-matlab-initiate-session > 'org-babel-ipython-initiate-session) > #+END_SRC > > > * The problem > > When I run > > #+begin_src matlab :results output latex :exports results :eval > never-export > disp('*Step 3:*') > disp('*Step 3:* Calculate this') > #+end_src > > > On obtain > #+RESULTS: > #+begin_export latex > ,*Step 3:* > ,*Step 3:* Calculate this > #+end_export > > > Instead of > > #+begin_export latex > *Step 3:* > *Step 3:* Calculate this > #+end_export > > > Does anybody have an idea what is wrong there? > > Uwe Brauer > > > --0000000000003c0033058a2f5d12 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I believe you are seeing org's escaping at play. It pu= ts a comma in front of the leading *. It must think that it is a heading in= org-syntax, and so it escapes it to avoid some issues.

= I think here it is a bug since that is not a heading. can you use some othe= r leading character? I don't think the * have any significance in latex= .

John

-----------------------------------
Professor John Kitchin= =C2=A0
Doherty Hall A207F
Department of Chemical Engineering
Carne= gie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Fri, May 31, 2019 at 9:11 AM Uwe Brauer <oub@mat.ucm.es> wrote:


Hi

I am running Ubuntu 16.06, matlab 2018b and=C2=A0 I am using the python
kernel to use matlab from within org mode


Thanks to John Kitchin, I have the following setting

* Lisp setting
#+BEGIN_SRC emacs-lisp
(setq org-confirm-babel-evaluate nil)=C2=A0 =C2=A0;don't prompt me to c= onfirm everytime I want to evaluate a block

;;; display/update images in the buffer after I evaluate
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images = 'append)


(add-to-list 'org-src-lang-modes '("matlab" . matlab)) (setq python-shell-interpreter "python3")

;; set default headers for convenience
(setq org-babel-default-header-args:matlab
=C2=A0 =C2=A0 =C2=A0 '((:results . "output replace")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:session . "matlab")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:kernel . "matlab")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:exports . "code")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:cache .=C2=A0 =C2=A0"no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:noweb . "no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:hlines . "no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (:tangle . "no")))

(defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
(defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ip= ython)
(defalias 'org-babel-matlab-initiate-session 'org-babel-ipython-ini= tiate-session)
#+END_SRC


* The problem

When I run

#+begin_src matlab :results output latex :exports results=C2=A0 :eval never= -export
disp('*Step 3:*')
disp('*Step 3:*=C2=A0 Calculate this')
#+end_src


On obtain
#+RESULTS:
#+begin_export latex
,*Step 3:*
,*Step 3:*=C2=A0 Calculate this
#+end_export


Instead of

#+begin_export latex
*Step 3:*
*Step 3:*=C2=A0 Calculate this
#+end_export


Does anybody have an idea what is wrong there?

Uwe Brauer


--0000000000003c0033058a2f5d12--