From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id a5W8G9aZhV9BSAAA0tVLHw (envelope-from ) for ; Tue, 13 Oct 2020 12:13:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id QJ8xF9aZhV+segAAbx9fmQ (envelope-from ) for ; Tue, 13 Oct 2020 12:13:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B919F9402C2 for ; Tue, 13 Oct 2020 12:13:08 +0000 (UTC) Received: from localhost ([::1]:45606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSJAx-0003Gi-B0 for larch@yhetil.org; Tue, 13 Oct 2020 08:13:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSJ9L-0003GW-KX for emacs-orgmode@gnu.org; Tue, 13 Oct 2020 08:11:27 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:40558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSJ9J-0007zg-Om for emacs-orgmode@gnu.org; Tue, 13 Oct 2020 08:11:27 -0400 Received: by mail-ed1-x52d.google.com with SMTP id p13so20657714edi.7 for ; Tue, 13 Oct 2020 05:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zzamboni-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=wkFPzyZwVnnhpDnnzvWarITe6jaSK4hKu2BKCLxJEDs=; b=S7DP2E/7iGJhYwwpAgq3vSDBk1WP1U4Eu1CnlKZzrLMrBuFUaQu0rBOOw7nzq/9cNt V2tw63WasRePTacNYtQ34eU1F58cPRSy2KS0v+SLXgfOjKHuxTN1JoqKYmAk036/Omhu FHYFaMD8XBoesbtB8F7v18Umy5wvZSMD1iaqnGukummXIyLNHReAgB1y+Xf/MpFR4Wvh JKCjLrwy4OmHVcHX4fV2O9hHqmUfkt/99UPc2XHHHv90OjuE7HiBkcze6SxDmrWmr1Sk Lq6CwZs8VS3u7iEvH5mzCiotR8oGrhYSAo1O4JcwXOwQczJg9jgY9DNceb9s9JloK54f h9Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=wkFPzyZwVnnhpDnnzvWarITe6jaSK4hKu2BKCLxJEDs=; b=BhLhP7raqWZ5u8zVGYLmiE6TnAz/c+kRWkJJmPGAotW/ipqAjRD8lTf7DnynMVfa0b blvtENIHUaguiNC6MvC6RP1MupuZUcanTit0PfjibsQM5zWZ/lx7OY3iKoWaGsGYuXxg DMnzqg981dWyQLkWlowTPrkRVq0M4jJfds+t52xQzmIt0BrACdG8kYyVP+xOanYrjF0A S+mMg78zth2c/FI0+QKGwZhIuCbSgyAsrqSB+21NrkMQZn8FnfXCRduTScZ/T6ySoWTv nNgH4X3WGYH0RAA/3ZWiWXszEsNbn3Lp08uhh/OQo2QsBG2/sBBe+tT7iT7YHTt0nbPu utAQ== X-Gm-Message-State: AOAM533046jHnbF0fsAUGBZ5mMxamrABoLQyz3YTSibT7mcUb2uP3lqZ DSf3+V0shsBLQUiXtUZPgwIbmmXPXHumCZYTeNeHl4hdd871QA== X-Google-Smtp-Source: ABdhPJyV6KI/K88M5j4wpQmTxjat9v1d2zC3OCS3RSuQeXB70f8XyUgaNg64Cv2GJ9/tXoYKdeavxQJOUVfOgWxNqXM= X-Received: by 2002:aa7:ccd9:: with SMTP id y25mr19261625edt.375.1602591083763; Tue, 13 Oct 2020 05:11:23 -0700 (PDT) MIME-Version: 1.0 References: <87mu0qzli4.fsf@mat.ucm.es> <87362iziwl.fsf_-_@mat.ucm.es> <87pn5mzfa9.fsf@web.de> <874kmy5phz.fsf@mat.ucm.es> In-Reply-To: <874kmy5phz.fsf@mat.ucm.es> From: Diego Zamboni Date: Tue, 13 Oct 2020 14:11:12 +0200 Message-ID: Subject: Re: [matlab src is always exported to latex!!] To: Org-mode Content-Type: multipart/alternative; boundary="00000000000044b30305b18c50b6" Received-SPF: none client-ip=2a00:1450:4864:20::52d; envelope-from=diego@zzamboni.org; helo=mail-ed1-x52d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=zzamboni-org.20150623.gappssmtp.com header.s=20150623 header.b=S7DP2E/7; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: HRp7y4m6IPhc --00000000000044b30305b18c50b6 Content-Type: text/plain; charset="UTF-8" Uwe, In my testing (using octave since I don't have matlab, but I hope it's similar), using = :exports none :results output raw= seems to produce the desired output: #+begin_src octave :exports results :results output raw 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*} Which renders the matrix correctly. I first tried with =:exports results=, but that for some reason results in the results being included twice in the LaTeX output. I'm not sure why. Hope this helps, --Diego On Tue, Oct 13, 2020 at 1:36 PM Uwe Brauer wrote: > >>> "AB" == Arne Babenhauserheide writes: > > > 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 > > See my answer to Eric > > It does not do want I want > #+begin_src matlab :exports results > 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 > > Leads to > > \begin{verbatim} > \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*} > \end{verbatim} > > So at the moment the only solution I can think of is to use the code I > posted > > (defun my-latex-filter-src-blocks (text backend info) > "Remove source blocks from latex export." > (when (org-export-derived-backend-p backend 'latex) > "%% [removed source block]\n")) > > (add-to-list 'org-export-filter-src-block-functions > 'my-latex-filter-src-blocks) > --00000000000044b30305b18c50b6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Uwe,

In my testing (using octave since = I don't have matlab, but I hope it's similar), using =3D=C2=A0:expo= rts none :results output raw=3D seems to produce the desired output:
<= div>
#+begin_src octave :exports results :results output raw<= br>close all
N =3D 3; % number of chebyshev nodes
n =3D 1; % polytrop= ic index
iters =3D 1; % iterations
j=3D[0 1 2 3];
z=3Dcos((pi*j)/3= );
y=3D1-(0.5*(z+1)).^2;
a=3Dn*(8);
a2=3Deye(3+1)*a;
disp('= \begin{align*}')
disp('A_{1,k-1}&=3D')
disp('\beg= in{pmatrix}')
fprintf('%g &%g &%g &%g\\\\\n',a2&= #39;)
disp('\end{pmatrix}=3DOK\\')
disp('\end{align*}'= ;)
#+end_src

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

Which renders the matrix co= rrectly. I first tried with =3D:exports results=3D, but that for some reaso= n results in the results being included twice in the LaTeX output. I'm = not sure why.

Hope this helps,
--Diego


On Tue, Oct 13, 2020 at 1:36 PM Uwe Brauer <oub@mat.ucm.es> wrote:
>>> "AB" =3D=3D= Arne Babenhauserheide <arne_bab@web.de> writes:

> Uwe Brauer <oub= @mat.ucm.es> writes:

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

> Do you use :exports results?

> :results output switches to show what is printed to stdout

See my answer to Eric

It does not do want I want
#+begin_src matlab :exports results
close all
N =3D 3; % number of chebyshev nodes
n =3D 1; % polytropic index
iters =3D 1; % iterations
j=3D[0 1 2 3];
z=3Dcos((pi*j)/3);
y=3D1-(0.5*(z+1)).^2;
a=3Dn*(8);
a2=3Deye(3+1)*a;
disp('\begin{align*}')
disp('A_{1,k-1}&=3D')
disp('\begin{pmatrix}')
fprintf('%g &%g &%g &%g\\\\\n',a2')
disp('\end{pmatrix}=3DOK\\')
disp('\end{align*}')
#+end_src

Leads to

\begin{verbatim}
\begin{align*}
A_{1,k-1}&=3D
\begin{pmatrix}
8 &0 &0 &0\\
0 &8 &0 &0\\
0 &0 &8 &0\\
0 &0 &0 &8\\
\end{pmatrix}=3DOK\\
\end{align*}
\end{verbatim}

So at the moment the only solution I can think of is to use the code I
posted

(defun my-latex-filter-src-blocks (text backend info)
=C2=A0 "Remove source blocks from latex export."
=C2=A0 (when (org-export-derived-backend-p backend 'latex)
=C2=A0 =C2=A0 "%% [removed source block]\n"))

(add-to-list 'org-export-filter-src-block-functions
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'my-latex-filter-src-blocks)
--00000000000044b30305b18c50b6--