emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org file: export matlab to latex, then to html


From: John Kitchin
Subject: Re: [O] org file: export matlab to latex, then to html
Date: Fri, 25 May 2018 08:20:32 -0700

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

On Fri, May 25, 2018 at 6:15 AM, Uwe Brauer <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]