From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sAU0EUUD4mB7FAAAgWs5BA (envelope-from ) for ; Sun, 04 Jul 2021 20:51:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EGfRDEUD4mDzAgAA1q6Kng (envelope-from ) for ; Sun, 04 Jul 2021 18:51:49 +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 61F1A239F9 for ; Sun, 4 Jul 2021 20:51:48 +0200 (CEST) Received: from localhost ([::1]:59544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m07DW-00073c-7s for larch@yhetil.org; Sun, 04 Jul 2021 14:51:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m07D5-0006zG-IS for emacs-orgmode@gnu.org; Sun, 04 Jul 2021 14:51:19 -0400 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:58996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m07D3-0005xr-Ao for emacs-orgmode@gnu.org; Sun, 04 Jul 2021 14:51:19 -0400 Received: from [192.168.1.38] (unknown [88.162.223.185]) (Authenticated sender: emm.charpentier@free.fr) by smtp5-g21.free.fr (Postfix) with ESMTPA id A9C305FF67; Sun, 4 Jul 2021 20:51:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1625424675; bh=Cz6sQ+pwBOQLsNzNOsn06cSy7O24QZRmvfH8piQcmmk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=r4jFH64+LvS/Bpr7p+fgBbDpApJnkIWL64lijZoDB65gy8LaweB+BSDFcXnS1p/UI x+bN05rS+MyfwtoBHBK1+gXzVuJZkeuXbyNYrOzuD/8oDTMjmLrSRKTZXJsojZPaD/ Dr/0ORFBQU9c7N4z3oZwHhSprQvHR6Ae/i8Nq4GFTCYkxzuOwmgbzbho9rYiF/R3dJ WRLc2Q8hGhQBh0H1rjLY+MJw6936DNJNc5IPXwMLxQrUTSWw6vDPWHZk9L018IiH9k Xp2F+gmfo/q1wJqFVYYjFrn7fTyGC4LD1mmFSiILgssl9k/CePeYVuB5ECNOs+dLd6 3lSZ8yuW5JSmQ== 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 20:51:10 +0200 In-Reply-To: References: Organization: =?ISO-8859-1?Q?Organis=E9?= ? Moi ??? Content-Type: multipart/alternative; boundary="=-KiIjL5AfkyyTCYY0oEXO" 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=1625424708; 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=qPsjhqceHZSo1Oukx4Z+mouxDGqMdtr9wqaWq1/DCf0=; b=FXiXfNRvO7rPwPnoR3f1ACtRZRwed9KdfilYB4HI1tf1KME0NzRfyOzX5+2zrD8+aWtzBM 4g365kG7upeiO7IedP3pIvk8m1VMxHIHYJ0yxN/v2wA7xlH7l5ibsZq0aGzL4jutK0cfMt jwMwDjyO2SqoaL7KC7wuEdaMEfRBxij/q34427LGG+1rgeFJJqYera72ml8/L5PZnvFED+ +NwurMVOevcuwmkEDvT+GyFyWYqMdiQf32sDHGYLLfDDZ90ul0SVOFnGUDxUHJptCoJdz0 mYbgIb/qEPMsVphOTbdngEiuh7lSf81QHNgeg+ZaP3oMIce+no7o+oC3ZR88PQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625424708; a=rsa-sha256; cv=none; b=VUo8njisgYB7UVFLLT53IXa/5ZGaBlUKIz6JtFR//BVSj13w9tZv+QIa7ZF74ywu07hyct a1l0i8xpGzS8FPCBHaK7O/3cAtCGRd+tPBT6qPKrecNx/SIRyGdyISfDJHSeXip7Xo6T0O 8WELUqo3VJ1XHBAMNZU9Y/8/VDQFcTw3YlHxXxrfBgn8P2czJXPNisxGDjAJsp4k5xL0My lmShnhxzlEJ9eroBZZUp/KPqjqku5j13dbCz9Hqqnj7E803jQkswnYOpL82rO0hHm0h0VQ fggBYjFFCcyrj+zzm4ut69Rnk/1/7+X6viOe0Nx8RcNb3nHQhMmjO3eE8uIi4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=r4jFH64+; 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=r4jFH64+; 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: 61F1A239F9 X-Spam-Score: -0.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: jU4iwY/BMGsG --=-KiIjL5AfkyyTCYY0oEXO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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, --=-KiIjL5AfkyyTCYY0oEXO Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
I tried this :

#+pro=
perty: header-args:sage :session
#+options: tex:t toc:nil author:=
nil
#+begin_src emacs-lisp :exports none
  ;; (customiz=
e-set-variable
  ;;  'org-latex-to-mathml-convert-command
;; "latexmlmath \"%i\" --presentationmathml=3D%o")
  (custo=
m-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 res=
ult...

#+name: foo
#+begin_src emacs-lis=
p :exports both :results org
  "Pseudo-function returning a LaTeX=
 pseudo-result."
  "\\[\\displaystyle{\\sin\\left(\\frac{a}{b}\\r=
ight)}\\]"
#+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 cur= rently lookin into a =3D:post=3D workaround. But an option to export =3Dlat= ex=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&n= bsp;:
Can you declare the output as org so they= will just be latex snippets?

On Sun, Jul 4, 2021 at 3:46 AM Emmanuel C= harpentier <emm.charpentier@f= ree.fr> wrote:
Dear list,
<= br>
Org-mode offers the ability to create functions returning LaT= eX results : such occurrences are frequent with Sagemath, Maxima, Mathemati= ca, R, and even emacs's Calc...

Such functions can= be declared has having LaTeX output, and the resulting  =3D#+begin_ex= port latex ...  #+end_export latex=3D block is exported as LaTeX and e= nd up in the PDF versin.

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

U= nless 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 co= uple questions :
  • Am I mistaken ?
  • Are there more steaml= ined 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 stru= cture (or possibly to the various exporters) ?

Thanks in advance,
<= /div>

--=-KiIjL5AfkyyTCYY0oEXO--