emacs-orgmode
[Top][All Lists]
Advanced

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

[O] exporting org to latex, execute matlab before exporting


From: Uwe Brauer
Subject: [O] exporting org to latex, execute matlab before exporting
Date: Wed, 02 Aug 2017 12:08:16 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hello

Take the following example

* Test section

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

Which is what I want. When I convert the org file to latex I am again
asked to execute the src block, which I don't want since it is already
executed. How can I avoid this question, without deleting the src block.
This is important if I have a lot of blocks which I already have
executed, and want to export the file without denying is executing every
time I am asked.

Thanks

Uwe Brauer 




reply via email to

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