From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2Mz6IzQQVWIbbwAAgWs5BA (envelope-from ) for ; Tue, 12 Apr 2022 07:37:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2Kw7ITQQVWLiXQEA9RJhRA (envelope-from ) for ; Tue, 12 Apr 2022 07:37:56 +0200 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 21DAA37E23 for ; Tue, 12 Apr 2022 07:37:56 +0200 (CEST) Received: from localhost ([::1]:52852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ne9Du-0003oQ-Pq for larch@yhetil.org; Tue, 12 Apr 2022 01:37:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ne9Bp-0003oD-Jm for emacs-orgmode@gnu.org; Tue, 12 Apr 2022 01:35:45 -0400 Received: from mout.gmx.net ([212.227.15.15]:34977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ne9Bn-0007ME-Dm for emacs-orgmode@gnu.org; Tue, 12 Apr 2022 01:35:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649741737; bh=/APt441J790Ztc7zeXIlZlVqZBxCXKUe2BYuzBYIjR0=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:Date:Reply-To: In-reply-to; b=NF0iBhOsVXjaJ7JiU4+kimOnaUH8ApPIlVUBIa/kzQWPEuiMOBoU/gYmvXelWrfXb 1MnrjZi4wC0xeibUmL+zzPB1jcmNEMfWoWPseho7G5agBFUQx4c3cflimTewKN457P ioAv0rgA2bYMUfjJShs9Ye5fF4lHR3UBdzOM796o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from dell-desktop ([173.48.184.153]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N79yQ-1o1USS2swe-017Ywq; Tue, 12 Apr 2022 07:35:36 +0200 Received: by dell-desktop (Postfix, from userid 1000) id B02EE280870; Tue, 12 Apr 2022 01:35:34 -0400 (EDT) References: User-agent: mu4e 1.6.10; emacs 27.1 From: Thibault Marin To: Vitus =?utf-8?Q?Sch=C3=A4fftlein?= Subject: Re: ox-html: exporting LaTeX-environments Date: Tue, 12 Apr 2022 01:15:50 -0400 In-reply-to: Message-ID: <87lewax3rt.fsf@dell-desktop.WORKGROUP> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:BCFJU0ov1rzbR5RWXaVJgtdW3jC/Z/2xOTdTC3eAfIqQkClo3OS hn4v6lA5wfOTE8XNAxAFG+HFRoH7SXtjMac4V9AdCMShGm+ljcsQtkuzpYKwTX9hwXeXSk2 reQZqRkERwtIea/5JQOJQxO3e+3z3/h1aABWRUhB6qsVW94azYI+ea0gxWOG1Swx5JaJgDj prTP2bH0t+GT0Ako4qixQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:kY2qpBVSKn0=:PtoW3Mze6iGKaLXLdaFr9Q icElnME9s//Ah6zopd4T1QRwGtiS0CGEci7yEy6WtmABwKFW6QDNt/OgT82kDGx3R56bvDnOs nHOGG2gqkC9xnCEZogr/m/2J0quCDLDRO8HFBoPkfUEVnz7EXghOAjI5CPAn1CNqG2WM3cb7d QKtdyZ7tvmeD9PA/WUr2Jjt4Yv9UH6/UyMwEMOGCYY8dqgwcoUIUKLKXGYECu71dyeAzJwGMM LO9LSmBe4dzFfPho+3BF8hvQHSq68KhaihXTSwOnl2+22xdoRmDPoiDReZ1M0ZhvAU6nM2eMA CgmbLH6ZVLsYfwOGbBkxgclm4UwrInE8t55Rd1AtKehhqhfbyURhB74Q3YGduGzO4pDL+8NJy AjaZBRzBOftAILH6CDmBPxFU7Fbl2roNqyz78KW10WhkJB6yCQZYx1jwdVrUngbISj+PnFreQ 2DiS16A2PpA8juIoQhB2tIyzdfms/IlkE2elbGG4k4723c7j4J3CYAIarTqp7EUMc0c/fpKZe n9fwHF1JvMCX3Hth2DclUIBBcff0epVSFvkyKwmXDceeaP4shQI5GlM3dD9e2xE2GS/BI1Ng+ F1Dprp6F3BC+R+B47vgMbmvPTnt9t6d1xbWdeZgb6fzrYEvDpUH/ZD1WtH1HJVds3p8bSYU3e kePiAmCXnlH9ovKtmhOvKJ7MkJJb/Trlmi2NB13OmH5vdDe6Z16xou9gYMkFTIQ9ncQYt6hX2 RESq0TGsm00YPEk5dziSWGqE2H8cFfysr++mbbCNe+wFDXn/6KDWzVH/72KeH1ueRGwPlkRLI 7jeSbIWsCEfOC40p7gfYXRYI4uasxTGOkn++thF8u5YBU49ZsAbI67dLWi26lMG6M9grWxfGM ZCBgnSMdCbWf/KZNUxu5FubyfQIZmXgYLmRwtu5A1qTRyF75CvLQhE/yT1N1xUu3TtawUR4ss F7i5q4yEKZUVc78ZDQng8S3d4eMxd8i8TCxxAGeLJojjRTadKN4FD23SFT9zyztQs4j3XFnUn 5E4wQUns4O+PkA2C0q/lrEDgqElxyNGRl81/F9tIPYuzSV6LuLSfRDaK3xZkf6VeondrsWDKd kFh2vcjOR+5ij8= Received-SPF: pass client-ip=212.227.15.15; envelope-from=thibault.marin@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: thibault.marin@gmx.com Cc: "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649741876; h=from:from:sender:sender:reply-to: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=JrR5e6In3RpCGg95epEptB2H3O5jI3ZTnSzYa95FnSI=; b=hWTPSrfjDJ24cpOe8lR4ef0Ch4z/vnCFbBjseA4Ryn+1HzrVpUdHf0QgNfW3PVV/lloYTb 7/KfECMxx9pn0E4HrnmkeHqC7kqCZ0ietZP/ByfoqaM+OnmPXHdXAOwkMlyuWLn+aOKeN0 JQVwblS2w8GzztxaYXO0MH3SASDnDwxWLnXLk2DqQziXr0VxXWmj3CBEkX/EH9YRocu8gI emvANVdP4Z/YUwkZDXmgWJMOl7/3GHaIznmi3iRbRxWOTy7NUZdMTkfYwkSDNk4IWh8xOD +hnbum7cWdUZWmDcVSRP5B3ysHKnrJ/7UPIMbtV38I/WK3B5gHvH2iDR9cFi+g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649741876; a=rsa-sha256; cv=none; b=Qc055wEW+WT3a4x0JLsb2vw7xz53fABxnqGNT5JPfbPogCQXBWMQIkedAGfz6ruqZ4mFqZ ByfUZmXrz5T3WeSrpOTZTinD2mpS8Zx51HyFs07whOcQd8UranxQ4aRL8v3ii5mtXEjPHE 4cH+o9B9+Xd+tiGnq5mUFI3PcMU5WT/VXdcn0jzFibRlyz9xwkjcOr7HBkBBM2gCPahp9E qyzATy+w5s/zOFkD63fXSy1UPVdonpQdF70o8R6tDWBBn/IJo2oeooCfN2F9YnfUPF6SGN mM7iHN1xxJJZYnsTtTgUC6qFZXz2p9rCNHLwHxlnTkCehAS2+ycfmL+VFcHhXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=NF0iBhOs; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=NF0iBhOs; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 21DAA37E23 X-Spam-Score: 1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: HKGcp926NSAK --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Vitus, list. My memory is quite fuzzy on this and I won't have a chance to take a deep look until later, but I will try to share the information I have. On Mon, 11 Apr 2022 19:38:13 +0000 (9 hours, 37 minutes, 37 seconds ago), V= itus Sch=C3=A4fftlein wrote: Dear org-mode mailing list, [...] 3. Any LaTeX environment name foo is changed to foo* (except it already e= nds with an asterisk). For example, \begin{tabular} is changed to \begin{tabular*}; = same for \end{tabular}. But tabular* differs from tabular in needing an extra wid= th-argument, so the export won=E2=80=99t work properly. I had submitted a patch trying to address this (https://list.orgmode.org/87h7ok3qi2.fsf@dell-desktop.WORKGROUP/, I have attached a new version rebased on main to this message). It never made it in and I failed to follow-up. This patch (or something similar) could help with this issue. It basically only adds the star for math environments (using org-html--math-environment-p) [...] Now the newline commands \n before and after %s are exported as whitespac= e. Just replacing \n%s\n by %s (that is, leaving the newlines out) solves the problem. HTML= ignores newlines anyway. This seems to work better indeed; the \n's were just cosmetic. [...] 1 Create a new variable ox-html-latex-environments-no-number of the form = ("foo" "bar" "baz" ...), which contains all environments that should not receiv= e equation numbers. I don't know whether org-html--math-environment-p (as used in the attached patch) is sufficient to determine whether we need to add a star to the environment or if we need another variable (in my use cases, testing for a match environment is sufficient but it may not be the case in general). [...] I don=E2=80=99t know how to express in elisp what is in brackets, though.= Does this make sense to you? I am a beginner with elisp, so I can only state the ideas I have but not im= plement them (yet). This can be made to work if there is a consensus that we want to add a ox-html-latex-environments-no-number variable (I can try to help with that if needed, even though my elisp isn't great) [...] (let ((formula-link (org-html-format-latex (org-html--unlabel-latex-environment latex-frag) processing-type info))) The patch should address that, I would be curious to see if you encounter additional problematic cases after applying it. Thanks for resurrecting this and for your help detecting and fixing the iss= ues. Best, thibault --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lisp-ox-html.el-Fix-automatic-numbering-of-non-math-.patch Content-Transfer-Encoding: quoted-printable =46rom 61a27c4816a0dae1072f851cc67ea48cec2d362c Mon Sep 17 00:00:00 2001 From: thibault Date: Tue, 12 Apr 2022 00:45:18 -0400 Subject: [PATCH] lisp/ox-html.el: Fix automatic numbering of non-math environment * ox-html.el (org-html-latex-environment): Prevent addition of * to non-math environments. Added * is used for math environments to replace latex equation numbering by org labels for html linking. =2D-- lisp/ox-html.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 81ef002a0..0968e2199 100644 =2D-- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2945,7 +2945,9 @@ CONTENTS is nil. INFO is a plist holding contextual= information." ((assq processing-type org-preview-latex-process-alist) (let ((formula-link (org-html-format-latex - (org-html--unlabel-latex-environment latex-frag) + (if (eq nil (org-html--math-environment-p latex-environment)) + latex-frag + (org-html--unlabel-latex-environment latex-frag)) processing-type info))) (when (and formula-link (string-match "file:\\([^]]*\\)" formula-= link)) (let ((source (org-export-file-uri (match-string 1 formula-link= )))) =2D- 2.33.0 --=-=-=--