From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QFVuAbIk4mBgSQAAgWs5BA (envelope-from ) for ; Sun, 04 Jul 2021 23:14:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AGunOLEk4mAnYAAA1q6Kng (envelope-from ) for ; Sun, 04 Jul 2021 21:14:25 +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 5D7C223DC3 for ; Sun, 4 Jul 2021 23:14:25 +0200 (CEST) Received: from localhost ([::1]:43166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m09RX-0006yj-Ii for larch@yhetil.org; Sun, 04 Jul 2021 17:14:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m09RB-0006yX-IJ for emacs-orgmode@gnu.org; Sun, 04 Jul 2021 17:14:01 -0400 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:34908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m09R9-0004nC-6X for emacs-orgmode@gnu.org; Sun, 04 Jul 2021 17:14:01 -0400 Received: from [192.168.1.33] (unknown [88.162.223.185]) (Authenticated sender: emm.charpentier@free.fr) by smtp5-g21.free.fr (Postfix) with ESMTPA id D69505FF93; Sun, 4 Jul 2021 23:13:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1625433238; bh=cYoofsRVL8UprCVusF5NzceRJSySwzbriPFfT8L/07w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=NjgGBtIZv2Ji0spCjr+SRhfHSwlriEb25yYqt5yigfx/ZJLxeUXHTBeiQw4UuQ5F8 8qbaIZtOWQVvW5nCTYF5XZtN5D6n/7zm/Bk7RuiCBg0h6m2MG4+Az0xd8E5L4WryR4 e83AbvvjFOLRRyh9U612wdBkmhKxrjrNvQwYYskivIbt0QeXBmqrADBQ9YyN+R/mYm fn0wofofilW+6OwPYwNoFkdrk/FPJg2lQDZe5yYKzWw3/uXoNN0PDViJnLA9vExeGl qm1ipyJ3rQ0XXtY9W7uAR0nZ5/8cnX1eF5ZbzR4p3RSvTkEV1BQ+mxghYj48x/jYtY wF11zTyGqAvqQ== Message-ID: Subject: Re: LaTeX-producing code : how to export results to HTML/ODT ? From: Emmanuel Charpentier To: John Kitchin Date: Sun, 04 Jul 2021 23:13:54 +0200 In-Reply-To: References: Organization: =?ISO-8859-1?Q?Organis=E9?= ? Moi ??? Content-Type: multipart/alternative; boundary="=-F8GKqItVIolzmIrXGuH+" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a01:e0c:1:1599::14; envelope-from=emm.charpentier@free.fr; helo=smtp5-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625433265; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=D1vEya8hFNjt40d0RClDMoV7qFIe9nTsqy2AaGzkj6A=; b=l5Ps13r6KDPPiB4eyAkpU3knUcatbXG/xCuRkbk3gXvE7a5Cj5zLJNnjg6TIsKR6FRpoHZ 4g2RMEQmXeNQkwd0xnj6QCpRXTMhmEek7LxkUfyPcpTqlwU46r+dqh4puCG5ctWE4aiw6y Lhd6Ya4051Cm5AN1U6M5mmY2zIsxJ52VP/WzHBUshqcNMOekcHgX5u/pVnW6pBbYPqOrMi FOkp9Wy23Ae0l2OxwELTtlK7b8KtKiNbXTTSIgzg+xHTIDNx8VM1SVZFTRqQfYNWusSIbf x8qI/5Xs/0v1r/rVx/Ptc/q8AgDvzBQ8KSwnGj5prQ55LWOw840n3X6HR4kAsg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625433265; a=rsa-sha256; cv=none; b=dw+bOfzBEaxL+bGfZ257FzzItQ2N28R2PLSX850st81NjYmun35P+UhwvFzJS+tvBDzSHb UVZ5jrK1r/BBA0zbZMzZR03qpixUa62MpTsjcMH0dlgmEtCw9I20VvMwgyYvJ7gkFAGxDh 1tn9ADJdBBlTbau1kbaDCJJqEAJ+sokNk6v9zz9Fj/73Wk/fm8lSDPk4lZR6aDwtRwp/iZ Hc0STeebys6wwD7+c7j4r+BO5cqwkdJColzxuQzYDUcBd12Dmns5xoV3NSRE4Qfa2Zhdfi I2Ycw2zCqOXMmyxNQ2zaJI3XIYOugyb9XWVqs09hnRr2+0VNQOzFNnN+AdQQcg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=NjgGBtIZ; dmarc=pass (policy=none) header.from=free.fr; 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-Migadu-Spam-Score: -0.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=NjgGBtIZ; dmarc=pass (policy=none) header.from=free.fr; 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-Migadu-Queue-Id: 5D7C223DC3 X-Spam-Score: -0.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: rQvOoa/BPanE --=-F8GKqItVIolzmIrXGuH+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Yes, this works, indeed. If I could just figure why ... and how to use it with captions, labels and cross-references. But I still don't "get" drawers, I thonk. Thanks a lot ! You gave me somethong to think about. Le dimanche 04 juillet 2021 à 15:04 -0400, John Kitchin a écrit : > This incantation worked for me: > #+name: foo > #+begin_src emacs-lisp :exports both :results drawer >   "Pseudo-function returning a LaTeX pseudo-result." >   "\\[\\displaystyle{\\sin\\left(\\frac{a}{b}\\right)}\\]" > #+end_src > > #+RESULTS: foo > :results: > \[\displaystyle{\sin\left(\frac{a}{b}\right)}\] > :end: > > the key is the drawer I think. > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > > On Sun, Jul 4, 2021 at 2:51 PM Emmanuel Charpentier > wrote: > > I tried this : > > > > #+property: header-args:sage :session > > #+options: tex:t toc:nil author:nil > > #+begin_src emacs-lisp :exports none > > ;; (customize-set-variable > > ;; 'org-latex-to-mathml-convert-command > > ;; "latexmlmath \"%i\" --presentationmathml=%o") > > (custom-set-variables > > '(org-latex-to-mathml-convert-command > > "java -jar %j -unicode -force -df %o %I") > > '(org-latex-to-mathml-jar-file > > "/usr/local/bin/mathtoweb.jar")) > > #+end_src > > > > A "normal" function call with org result... > > > > #+name: foo > > #+begin_src emacs-lisp :exports both :results org > > "Pseudo-function returning a LaTeX pseudo-result." > > "\\[\\displaystyle{\\sin\\left(\\frac{a}{b}\\right)}\\]" > > #+end_src > > > > #+RESULTS: foo > > #+begin_src org > > \[\displaystyle{\sin\left(\frac{a}{b}\right)}\] > > #+end_src > > > > Which exports the LaTeX *source* (uncompiled) in PDF, HTML and ODT. > > > > I'm currently lookin into a =:post= workaround. But an option to > > export =latex= blocks to selected exporters (ODT, HTML, possibly > > Morkdown via pandoc). > > > > I'll keep you posted. > > > > Le dimanche 04 juillet 2021 à 14:10 -0400, John Kitchin a écrit : > > Can you declare the output as org so they will just be latex > > snippets? > > > > On Sun, Jul 4, 2021 at 3:46 AM Emmanuel Charpentier > > wrote: > > > Dear list, > > > > > > Org-mode offers the ability to create functions returning LaTeX > > > results : such occurrences are frequent with Sagemath, Maxima, > > > Mathematica, R, and even emacs's Calc... > > > > > > Such functions can be declared has having LaTeX output, and the > > > resulting  =#+begin_export latex ...  #+end_export latex= block > > > is exported as LaTeX and end up in the PDF versin. > > > > > > But such blocks seem to export *only* to LaTeX/PDF ; more > > > specically, they do not export to HTML nor ODT. In order to > > > insert those results at export, one *has* to print them *raw*. > > > See the attached examples, and compare PDF, HTML and ODT outputs > > > of the enclosed zip archive (necessary to avoid the wrath of the > > > spam filter of my provider ;-)...).. > > > > > > Unless I am mistaken, this is the *only* way to export LaTeX > > > exports to HTML/ODT ; I am not aware of any option allowing to > > > force such exports. So a couple questions : > > > * Am I mistaken ? > > > * Are there more steamlined ways to get LaTeX in > > > HTML/ODF/whatever- > > > but-not-LaTeX ? > > > * Wouldn't an option to allow these exports be a welcome addition > > > to > > > the export structure (or possibly to the various exporters) ? > > > > > > Thanks in advance, > > --=-F8GKqItVIolzmIrXGuH+ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Yes, this works, indeed.

=
If I could just figure why

... = and how to use it with captions, labels and cross-references.
But I still don't "get" drawers, I thonk.

<= div>Thanks a lot ! You gave me somethong to think about.


Le dimanche 04 juillet 2021 =C3=A0 15:04 -0400, John = Kitchin a =C3=A9crit :
This incantation worked for me:

#+name: foo
#+begin= _src emacs-lisp :exports both :results drawer
  "Pseudo-function re= turning a LaTeX pseudo-result."
  "\\[\\displaystyle{\\sin\\left(\\= frac{a}{b}\\right)}\\]"
#+end_src

#+RESULTS: foo
:results:
= \[\displaystyle{\sin\left(\frac{a}{b}\right)}\]
:end:

the key is the drawer I think.
John

-----------------------------------<= br>Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department = of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 152= 13
412-268-7803


On Sun, = Jul 4, 2021 at 2:51 PM Emmanuel Charpentier <emm.charpentier@free.fr> wrote:
I tried this :

#+propert=
y: header-args:sage :session
#+options: tex:t toc:nil author:nil<=
/pre>
#+begin_src emacs-lisp :exports none
  ;; (customize-se=
t-variable
  ;;  'org-latex-to-mathml-convert-command
 =
 ;;  "latexmlmath \"%i\" --presentationmathml=3D%o")
  (custom-se=
t-variables
   '(org-latex-to-mathml-convert-command
  =
    "java -jar %j -unicode -force -df %o %I")
   '(org-latex-to-m=
athml-jar-file
      "/usr/local/bin/mathtoweb.jar"))
#=
+end_src

A "normal" function call with org result.=
..

#+name: foo
#+begin_src emacs-lisp :e=
xports both :results org
  "Pseudo-function returning a LaTeX pse=
udo-result."
  "\\[\\displaystyle{\\sin\\left(\\frac{a}{b}\\right=
)}\\]"
#+end_src

#+RESULTS: foo
#+begin_src org
\[\displaystyle{\sin\left(\frac{a}{b}\right)}\]=
#+end_src

Which exports the LaTeX *sour= ce* (uncompiled) in PDF, HTML and ODT.

I'm current= ly lookin into a =3D:post=3D workaround. But an option to export =3Dlatex= =3D blocks to selected exporters (ODT, HTML, possibly Morkdown via pandoc).=

I'll keep you posted.

Le= dimanche 04 juillet 2021 =C3=A0 14:10 -0400, John Kitchin a =C3=A9crit&nbs= p;:
Can you declare the output as org so they w= ill just be latex snippets?

On Sun, Jul 4, 2021 at 3:46 AM Emmanuel Cha= rpentier <e= mm.charpentier@free.fr> wrote:
<= div style=3D"overflow-wrap: break-word;">
Dear list,

Org-mode offers the ability to create functions returning LaTeX resu= lts : such occurrences are frequent with Sagemath, Maxima, Mathematica, R, = and even emacs's Calc...

Such functions can be dec= lared has having LaTeX output, and the resulting  =3D#+begin_export la= tex ...  #+end_export latex=3D block is exported as LaTeX and end up i= n the PDF versin.

But such blocks seem to export <= b>*only* to LaTeX/PDF ; more specically, they do not export to HTM= L nor ODT. In order to insert those results at export, one *has* to = print them *raw*. See the attached examples, and compare PDF, HTML a= nd ODT outputs of the enclosed zip archive (necessary to avoid the wrath of= the spam filter of my provider ;-)...)..

Unless I= am mistaken, this is the *only* way to export LaTeX exports to HTML/ODT ; = I am not aware of any option allowing to force such exports. So a couple qu= estions :
  • Am I mistaken ?
  • Are there more steamlined wa= ys to get LaTeX in HTML/ODF/whatever-but-not-LaTeX ?
  • Wouldn't an op= tion to allow these exports be a welcome addition to the export structure (= or possibly to the various exporters) ?

Thanks= in advance,


--=-F8GKqItVIolzmIrXGuH+--