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 yu9MC+pMT1/+fgAA0tVLHw (envelope-from ) for ; Wed, 02 Sep 2020 07:42:34 +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 oAGFBupMT18jVgAAbx9fmQ (envelope-from ) for ; Wed, 02 Sep 2020 07:42:34 +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 B20E1940414 for ; Wed, 2 Sep 2020 07:42:33 +0000 (UTC) Received: from localhost ([::1]:57436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDNPc-0004nq-92 for larch@yhetil.org; Wed, 02 Sep 2020 03:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDNNs-0004nJ-US for emacs-orgmode@gnu.org; Wed, 02 Sep 2020 03:40:44 -0400 Received: from mout.gmx.net ([212.227.15.15]:53651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDNNq-0006cB-Gg for emacs-orgmode@gnu.org; Wed, 02 Sep 2020 03:40:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599032439; bh=6AhSGz/9EBU5VBV9GAsduh6UtkZy5+Zj/m5qw8d/rSc=; h=X-UI-Sender-Class:References:From:To:Subject:Reply-To:In-reply-to: Date; b=gbRKvBz2F/U4s0RXGl1jUlO2PmM34CvYzDoIz0xo6H8TowLhOwwrFqxlTE4m1yCVu iQpvBPDZhExxIg6Qo2Iiwp5oO+/3j5GcwClmZAs4uigtr03ZTUGxvKDLnYQt5a8sOC dKO7KbXdt1CpH7da/+MWGDFarnJzrz8QMZ2BHEas= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from dell-desktop ([173.48.184.153]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MtfNl-1kQuSX3FZn-00vC36 for ; Wed, 02 Sep 2020 09:40:38 +0200 Received: by dell-desktop (Postfix, from userid 1000) id DC8E2282B90; Wed, 2 Sep 2020 03:40:36 -0400 (EDT) References: <87h7si4l80.fsf@gmail.com> <87y2lt3lyn.fsf@ucl.ac.uk> <87tuwhnthi.fsf@gmail.com> <87a6y8ogge.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 26.1 From: Thibault Marin To: emacs-orgmode@gnu.org Subject: Re: latex fragments compilation error when exporting to html In-reply-to: <87a6y8ogge.fsf@gmail.com> Date: Wed, 02 Sep 2020 03:40:36 -0400 Message-ID: <87mu28r5hn.fsf@dell-desktop.WORKGROUP> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:5liUU5B5ceBdeiYnvpoRX4LcxVeataDCi9kKVdiH/77SPpOfDR4 3DY8an/+olxAwmTxGr9eu9hJq3NAGQVnSDV3GmqFyuKqxBu41DpnOB74adDCBotry9rivfa x/2PqWmp7RRI3jvxGwS6At9JMdxmnLrMBZtJ6ifl7OvwdLfsb+qUFfck7WaRR0j1AQ+2L+u 1cYFsNA/FAhVSSMaAGk8Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:K6tlyMqTWKQ=:K7gkuoewfVDeBSMmhLeiS7 ffze20XorLjw69+0R9Iflh1nQzGbNiZnFXFkCq/J4fpnBKoH1W7RN4+jad8w7VS2UoOeB3bVl MdTSCtUATifIg7BVhj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HUb75ut60spIimnfKy0nG+3kKNXFH1Pc0DnccL67RtAPxBOhNYbfEMRpRFjCv9gsQTq9gYCMh nlEiRJifTb4vRK+hbLHslyY07suF0NJazW6ijgQ== Received-SPF: pass client-ip=212.227.15.15; envelope-from=thibault.marin@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/02 03:40:39 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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 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: , Reply-To: thibault.marin@gmx.com 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=gmx.net header.s=badeba3b8450 header.b=gbRKvBz2; 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: 0.29 X-TUID: PWai12P2v7+L Hi, I can't comment on the rest of the discussion but I think I added this org-html--unlabel-latex-environment line. It was part of a change allowing links to equations in HTML export (https://lists.gnu.org/archive/html/emacs-orgmode/2018-01/msg00120.html). When removing the call to org-html--unlabel-latex-environment, exporting the following org file to html results in double equation labels (one from dvipng, one from org to allow links). ,---- | #+OPTIONS: toc:nil html-postamble:nil tex:dvipng | | #+NAME: eq-test | \begin{align} | 1 + 1 = 0 | \end{align} | | link to equation [[eq-test]] `---- (one could play with tex:mathjax and replace align by align* to see the possible modes) If I understand the problem correctly, one solution would be to apply the environment transformation from env to env* only for math environments. Something along the lines of ,---- | (if (eq nil (org-html--math-environment-p latex-environment)) | latex-frag | (org-html--unlabel-latex-environment latex-frag)) `---- may work (there may be a better way to do that). I hope this helps. Best, thibault On 2020-09-02T02:12:01-0400, Jeremie Juste wrote: Hello, I have found the culprit in the end. It was the function org-html--unlabel-latex-environment, int he ox-html.el file. I'm not sure this function is useful as I think it is better to give the user control on his environment (labelled or unlabelled) directly in his org file. I'm I missing something else about the use of this function? Anyway it was a good experience at debugging elisp. diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 55d017529..b2a5d6d36 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2891,7 +2891,7 @@ 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) + 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)))) Best regards, Jeremie - GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0) of 2020-09-01 - Org mode version 9.3.7 (release_9.3.7-725-g7bc18e @ /home/djj/src/org-mode/lisp/)