Re: [matlab src is always exported to latex!!] (was: org mode with babel source: execute all source blocks, don't export them to latex)

2020-10-13 Thread Dr. Arne Babenhauserheide

Uwe Brauer  writes:

> That did not work: I tried
> #+begin_src matlab  :results output 
>
> But when I exported the org file to latex, the matlab code was also
> exported. Strange 

Do you use :exports results?

:results output switches to show what is printed to stdout

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken


signature.asc
Description: PGP signature


[matlab src is always exported to latex!!] (was: org mode with babel source: execute all source blocks, don't export them to latex)

2020-10-13 Thread Uwe Brauer

Hi Diego

Thanks for the quick answer
> Hi Uwe,
> 1. Is there any equivalent to org-update-all-dblocks for the source

> I think you want org-babel-execute-buffer:

Right, thanks!!!


> Documentation
> Call org-babel-execute-src-block on every source block in

> the current buffer.

>  2. I want to export the org file to latex, in the current setting

> Normally, =:results output= should be enough, but there might be some
> peculiarities with matlab blocks that change this behavior.


That did not work: I tried
#+begin_src matlab  :results output 

But when I exported the org file to latex, the matlab code was also
exported. Strange 

Anybody has an idea?


smime.p7s
Description: S/MIME cryptographic signature


Re: org mode with babel source: execute all source blocks, don't export them to latex

2020-10-13 Thread Diego Zamboni
Hi Uwe,

1. Is there any equivalent to org-update-all-dblocks for the source
> blocks?
>

I think you want org-babel-execute-buffer:


Documentation
Call org-babel-execute-src-block on every source block in

the current buffer.

 2. I want to export the org file to latex, in the current setting
>the source blocks are also exported. I tried
>#+begin_src matlab  :results output raw   :eval never-export
>but it did not help.
>

Normally, =:results output= should be enough, but there might be some
peculiarities with matlab blocks that change this behavior.

--Diego


org mode with babel source: execute all source blocks, don't export them to latex

2020-10-13 Thread Uwe Brauer



Hi 

I have a org file with has a lot source blocks of the form 

#+begin_src matlab  :results output raw :exports code  :eval never-export
close all
N = 3; % number of chebyshev nodes
n = 1; % polytropic index
iters = 1; % iterations
j=[0 1 2 3];
z=cos((pi*j)/3);
y=1-(0.5*(z+1)).^2;
a=n*(8);
a2=eye(3+1)*a;
disp('\begin{align*}')
disp('A_{1,k-1}&=')
disp('\begin{pmatrix}')
fprintf('%g &%g &%g &%g\n',a2')
disp('\end{pmatrix}=OK\\')
disp('\end{align*}')
#+end_src

#+RESULTS:
\begin{align*}
A_{1,k-1}&=
\begin{pmatrix}
8 &0 &0 &0\\
0 &8 &0 &0\\
0 &0 &8 &0\\
0 &0 &0 &8\\
\end{pmatrix}=OK\\
\end{align*}

Two questions. 

1. Is there any equivalent to org-update-all-dblocks for the source blocks?

2. I want to export the org file to latex, in the current setting
   the source blocks are also exported. I tried
   #+begin_src matlab  :results output raw   :eval never-export
   but it did not help. 

Thanks 

Uwe Brauer