From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org file: export matlab to latex, then to html Date: Fri, 25 May 2018 08:20:32 -0700 Message-ID: References: <87po1j3mi3.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001d9f27056d094fa7" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMEWC-00022X-IP for emacs-orgmode@gnu.org; Fri, 25 May 2018 11:20:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMEWB-00075b-5O for emacs-orgmode@gnu.org; Fri, 25 May 2018 11:20:36 -0400 Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:38057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMEWA-00074M-N1 for emacs-orgmode@gnu.org; Fri, 25 May 2018 11:20:35 -0400 Received: by mail-wr0-x22b.google.com with SMTP id 94-v6so9880141wrf.5 for ; Fri, 25 May 2018 08:20:34 -0700 (PDT) In-Reply-To: <87po1j3mi3.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 --0000000000001d9f27056d094fa7 Content-Type: text/plain; charset="UTF-8" what if you use :wrap latex in the header? That should wrap the output in a latex block, which seems to export to html for me. 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 25, 2018 at 6:15 AM, Uwe Brauer wrote: > > > Hello > > Please consider the following example > > > This is a test > #+begin_src matlab :results output latex :exports results > X=[1,2,3,4,5,6,7]; > p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; > E=X*p'; > x2=X.*X; > E2=x2*p'; > V=E2-E^2; > disp('\begin{align}') > fprintf('E[X]&=%g\\\\ \n', E) > fprintf('E^2[X]&=%g\\\\\n', E2) > fprintf('V[X]&=%g\n', V) > disp('\end{align}') > #+end_src > > Executing the src block leads > > #+RESULTS: > #+BEGIN_EXPORT latex > \begin{align} > E[X]&=4\\ > E^2[X]&=20\\ > V[X]&=4 > \end{align} > #+END_EXPORT > > But if I now want to export the org file to html, the latex constructs > are not exported. > > I have to remove the > #+BEGIN_EXPORT latex > #+END_EXPORT > > Manually which is cumbersome. > > So I need to modify the line > #+begin_src matlab :results output latex :exports results > > But whatever I tried either there was not result exported, or when when > it was the result was not converted to HTML. > > Any help is appreciated > > Regards > > Uwe Brauer > > > --0000000000001d9f27056d094fa7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
what if you use=C2=A0:wrap latex in the header? That shoul= d wrap the output in a latex block, which seems to export to html for me.
John<= br>
-----------------------------------
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 25, 2018 at 6:15 AM, Uwe Brauer = <o= ub@mat.ucm.es> wrote:


Hello

Please consider the following example


This is a test
#+begin_src matlab :results output latex :exports results
X=3D[1,2,3,4,5,6,7];
p=3D[1/7 1/7 1/7 1/7 1/7 1/7 1/7];
E=3DX*p';
x2=3DX.*X;
E2=3Dx2*p';
V=3DE2-E^2;
disp('\begin{align}')
fprintf('E[X]&=3D%g\\\\ \n', E)
fprintf('E^2[X]&=3D%g\\\\\n', E2)
fprintf('V[X]&=3D%g\n', V)
disp('\end{align}')
#+end_src

Executing the src block leads

#+RESULTS:
#+BEGIN_EXPORT latex
\begin{align}
E[X]&=3D4\\
E^2[X]&=3D20\\
V[X]&=3D4
\end{align}
#+END_EXPORT

But if I now want to export the org file to html, the latex constructs
are not exported.

I have to remove the
#+BEGIN_EXPORT latex
#+END_EXPORT

Manually which is cumbersome.

So I need to modify the line
#+begin_src matlab :results output latex :exports results

But whatever I tried either there was not result exported, or when when
it was the result was not converted to HTML.

Any help is appreciated

Regards
<= br> Uwe Brauer



--0000000000001d9f27056d094fa7--