From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QHsxGJxLWWJAsgAAgWs5BA (envelope-from ) for ; Fri, 15 Apr 2022 12:40:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oH3DFJxLWWKNEgEAauVa8A (envelope-from ) for ; Fri, 15 Apr 2022 12:40:28 +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 D0756240B0 for ; Fri, 15 Apr 2022 12:40:27 +0200 (CEST) Received: from localhost ([::1]:51366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfJNK-00021S-HS for larch@yhetil.org; Fri, 15 Apr 2022 06:40:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfJBU-0003ar-PG for emacs-orgmode@gnu.org; Fri, 15 Apr 2022 06:28:15 -0400 Received: from mail-vi1eur04olkn0830.outbound.protection.outlook.com ([2a01:111:f400:fe0e::830]:27169 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfJBS-0002s7-Fm for emacs-orgmode@gnu.org; Fri, 15 Apr 2022 06:28:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EAXlMjKZPtv5IQVdnXzB1qdtxTbWQlDGyHOLHfnKeurueeT+v2Ogw2x9C9Zijqq2geQQN934GESHLxV8nS0Ezt6v7uXlNvpWyiuXYYzoVrcFYscm+dffUaOcKv9i/kMvQa9xa4sXfWYrWVsmUOBiCMHZT/krEiFp7PmxWznVcpc9wYiNtuzZDF9fHc++wxQlc6JqeUnxLwrKckk9C7zXPkoaHHnajv9wlC83rbJ8WwItc5SB2W2vppArj8udb7aWWoWkbZkzcE71V2bZC1tkXCfoK/jvtuAz597cmSObH7w5XZ4fH7NsGLTJwaN18W+JCTP5W+yBIYbbLxkIITTkpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3JpmsUhWzgc/+IJn/DgwfnB8cJubA9UJXhs3CK36sww=; b=CExgkOCsipKLamzfHzv1R6aPOoyVaVGI15iIdZOItB/1GLnnGg+68rJNy8l6GA94YsP1wsYDoFoYQ+PF4HkdRf1Pt1bYdFITPn6QGJW6q8tfUj5YeFWGibRyiydqUC/JIGp89e9XDOlpuD/I4nInuKp1S1m24kp7olrhQjg21iNHXTm5REd65so3GwD7hDLW9NTSZG2asB49nCw1moIQ/0Tia7ZrVrEEtZKsusSbNZK/nFD1SufjN9uCxQVePp0iYwzTGUosT1gwCDWJkwZhWy4ko9tbpabkqReSwIVVTcnvp77NCWulCa+b9KrTUVnYM0J85TeYTwRwz7q2O4ra3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from AM0PR04MB5649.eurprd04.prod.outlook.com (2603:10a6:208:12a::21) by DB6PR0401MB2552.eurprd04.prod.outlook.com (2603:10a6:4:37::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Fri, 15 Apr 2022 10:23:04 +0000 Received: from AM0PR04MB5649.eurprd04.prod.outlook.com ([fe80::5994:7147:dc2c:bfaa]) by AM0PR04MB5649.eurprd04.prod.outlook.com ([fe80::5994:7147:dc2c:bfaa%3]) with mapi id 15.20.5144.032; Fri, 15 Apr 2022 10:23:04 +0000 From: =?Windows-1252?Q?Vitus_Sch=E4fftlein?= To: "thibault.marin@gmx.com" Subject: AW: ox-html: exporting LaTeX-environments Thread-Topic: ox-html: exporting LaTeX-environments Thread-Index: AQHYTdupT0bZsziPkUufbTt6UunTUazrvQgAgAUIivs= Date: Fri, 15 Apr 2022 10:23:04 +0000 Message-ID: References: <87lewax3rt.fsf@dell-desktop.WORKGROUP> In-Reply-To: <87lewax3rt.fsf@dell-desktop.WORKGROUP> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [oXcOVtUtajoUgrs+n0NbQ4e7pi/ll1fn] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e51218f6-1880-4279-db65-08da1ec9ed53 x-ms-traffictypediagnostic: DB6PR0401MB2552:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VSE2vpY8zYoowT7XxPvh7whn+yUcIf5CvuMayD2JbevHwz/Pm/o891aB4yLBxTWXAKdpzqISpLrqWz1LOJ/Sa5+/nmljbNDzLDynWukYXzvZ8bQRewTIIE+JDYxQAh8MNDvyi5om37SsOrMAEn+UIwRgDopBLAzuwoBhbZI2vlBqyy7r9uKdYRUkcaGIX8vdNzU+DRb5Zg5lv6Ka7P3vuSyqZ+pdol0er34tj+U9I0/NqHwiIRda8upwwKKuhz3Nf0mSKKMRfegiS3u7OgGQPbzXSYBq/9ZARe8dITjrWb5CQm3+DYIocHVfezim9+IvrEknXKLsrnGAYFmYtgNQ4yMp33W/eAQlrNhlRHviDAG5Y7fJpjnY28n9Vi6jIhjZ17ZB3fppnBunZqIefkuj40mzsng2gZO3BmFF+vAdv7HsfXPuhG4Zo8U0Un70cnIVL+MfdKK0VvMF78pMF4rbRy0aLNBk/D1PctJTLB064XcCjoD8IfaERy3iNqf8XUioiIhfLP7PARQFDSfOEMq5LfTMiMnpzuUSHa57N0klonddyBIlMR+rqgeoIZz5sTQu9dH0E6s5h7zmHh/ANzeEGVC2qcopSq2M8iRRdxONteXdWAy9hiW8Ujrpt4p8XyVA x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?Y39U5JbYpyB2ROt2i3WQ9bVUdoIIV8JYregzG62hwA04fgSYsOxZQPxO?= =?Windows-1252?Q?gwr2ZEhwqBgK6+qatmI70T6tVSuyg10iXky9mpxgV+U+YUPM/AMBD+mm?= =?Windows-1252?Q?wSa6VgQ9rypzRYVe8Y0zixqVf51w792Rz7Krk3xfIvH3cPF7AFb2ilsd?= =?Windows-1252?Q?5unse8wgS0zc+3KbCjB+mAxtnZ+uFHDOXesmqycXoyaoOtzbvoVqdfLX?= =?Windows-1252?Q?TgGzpbs3KV2smTflnjnl9Lm+geMTVZobE22dC8SJDT2xf4eFGa6Sgr70?= =?Windows-1252?Q?fmgU2kmCTK/lT0jeFvIQKfQwjmVSSGPtEgEdCWZuzD5vnlu3y0Vad9rr?= =?Windows-1252?Q?zLtWctTmvZZv0UhCcoSkaCVspJmjmYr5/nC3H2zLconJYpwMXfVDpTl5?= =?Windows-1252?Q?2PRrybzdPiKZWzfnpkicEP0bS3gF5s0FqT/48vzTwt8IArWnOD8jLl6z?= =?Windows-1252?Q?MmN12UNhmgeNW59aki0wxjRtWYaK3S06ciPaoh6dedODIil2MPOqNrLx?= =?Windows-1252?Q?/YD4jSs1YkdM6MnOp0YGX0CL/7M/1urOm0RcZ1fnd6YBQmZoRK92o94G?= =?Windows-1252?Q?lFI/UzyRijUFDIR/3MNlJu9p/jsGny+fzh3JoiOB2ne3cA5X8ydkgpBG?= =?Windows-1252?Q?tqQLlHUqbfxfOmqKg+cpWxz1C78zkJFgoiHT0yD8ZluPvdp8/uMHT53z?= =?Windows-1252?Q?0oiTXUzJt3XJnk/S/2m/cw5X4hvw5unu1kS6Iv97xKk8s7amcxaWC/rM?= =?Windows-1252?Q?OsLkOc4s312PsqjfnJLOxH+hLczmboVipuZD88Yno7P1pjXmb6wnQKVs?= =?Windows-1252?Q?JkzuKcwN+cK9dv7lESk1PSIqIUclfNm6bz83S6dvK4Gao8yLNo8hzOkO?= =?Windows-1252?Q?QEXmJQ8o1Gu5O/Rh/1TA4a38BieYtfd6Wi03O0pi4J4N0xxcsakGjB5L?= =?Windows-1252?Q?vicj8IgSZcr6a3prjx45+PtfOGAn2kEApOJlKTUffADFSUCCv9ozZ18Z?= =?Windows-1252?Q?3rBtHhhD4lxmLlMz9gJI4ES756WiG2/rZWYRLcos3LbKeqdlZvi8We14?= =?Windows-1252?Q?U9LRi4Hz/oxU0OSTKeaqSc7wl1yMtsjY4kU1LUXkZoJ8+rfZhi8DSNHg?= =?Windows-1252?Q?flSCX+GCDj3Juwb9EoeHCAj0LG+95MyT8Z2Nt5wtL3rNWEC9BPorG8R9?= =?Windows-1252?Q?o6vgSNb0uAIDMZul75DtbtMKIIE6rJZtkkGqufoq15PFaQFDGiOkGrox?= =?Windows-1252?Q?zY51YAFpG0fZV7Et58K5vmBLR+FnomiYY34EI5/Fg7irrrr1m3/z++jN?= =?Windows-1252?Q?K1DzPc8wV+E+3kOkVJbgFFVjp0H9/drvthz48JWvZoQVp3Rntb6nSwkJ?= =?Windows-1252?Q?x9h+ILq9csqeN9ljh4VYvb//Cilm4V0nVqZv0yeHKedvNkx4iYZQzjyU?= =?Windows-1252?Q?S0vEERzYlayj/x6qE1HEDAQNedSOsUoR4XEcSOvQ6yjzNCTKVrKIm9kV?= =?Windows-1252?Q?mEDV0yH+PRNK33DArWfjVGSQz/VXdKkHIVZIPUVKfUOMGedVBNE=3D?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-03a34.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5649.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e51218f6-1880-4279-db65-08da1ec9ed53 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2022 10:23:04.4520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2552 Received-SPF: pass client-ip=2a01:111:f400:fe0e::830; envelope-from=vitusschaefftlein@live.de; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , 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=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650019228; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3JpmsUhWzgc/+IJn/DgwfnB8cJubA9UJXhs3CK36sww=; b=SXR7AkiN5gSXMZvAFRQCeXVc05ss6rCOK5jJ6xBW+aUUVIuWaEOH8TKomG+zrWgrmo7Yx1 WPreFJdUkb29/eua42VEVMJCsI9NYJnzuPf5T94yOVLxvaCDk+heIXTRGxO24+ZMr/0Grr hDpWPGQpYCteWgAnIDxeRHVOBG5QYT9ABrKzGNccwEdvRbaryOGcjaf2G3QoNFzOXp82PC hA34fMrDEAjzV1Q+bMHEhUm5LEaVxbPMShL1EtwhaxpkCdUTScHmuIiZDBUoEjtngO4kPV Pp9QNhDB1VrCQ9N0G12V8nR3EOwEvUbXivyB2TcvXvcmRfGVVqZ9UwKU99stSQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1650019228; a=rsa-sha256; cv=pass; b=PZuJOylINCnUfPOLgnQZNpSLOLyPm1gFZbvAiu9ulNRFNknc46PUVhl0EmNDlufIG6/4zE vDOZNksR30+S1qj6r2qg0NpTD5GG/XgQ99kOEwCcNCPw4WVHS+IhMagDE6Oqf6R0sHAppV 3vkwm0JsXWCsbXHd3ASgs+GOcl4MPSJjfYjejWD0Ui7O7nrWIiAqFsbNBq0cFYXMvUqwEV ACfp0laK7linK3tT3KRvcoufH2qbuA3/Pd2Pw54v1O5n6sRDVg0ZSmmKAQl7SMOO1iugqr 6w3HhNc96QQxvQhShtidp02gvzdMI94mI+C5/K9+UwlXLCKAq6dWyoGS+0Guyw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=none; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=live.de (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.14 Authentication-Results: aspmx1.migadu.com; dkim=none; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=live.de (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: D0756240B0 X-Spam-Score: -1.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: LFSuG5yRcHGx Dear Thibault, dear list, thanks for your fast answer, Thibault! I am happy to have convinced you of= dropping the extra \n's. The patch you addressed works fine for the aster= isk issue: Only those environments get an extra asterisk which are in org-l= atex-math-environments-re. Nonetheless, I think we should make that variabl= e more user-friendly by not requiring one huge regexp but a list of environ= ment names like ("foo" "bar" "baz"). Unfortunately, the patch does not have any impact on the numbering problem.= I guess we actually need org-html--latex-environments-leave-unlabelled to = get this running. I just wanna give two examples why it is not useful to la= ble every environment.=20 1. Imagine you do not need links to your equations and use the \tag command= in your equation environment to get the right equation numbers within the = svg. This looks nicer anyway because the font is the same and the formattin= g is perfect. If we did not have org-html--latex-environments-leave-unlabel= led, there would be both the line number within the equation and, below it,= another in-text-line-number on a new line. Same goes for the figure-enviro= nment which provides its own caption. In general, everything that has its o= wn counter within the svg should not receive extra equation numbers. 2. There are some environments you do not want labelled. Imagine you compil= e a table summarizing the most important formulas of your post. This is not= an equation and it should not be numbered, but it is. Below the table then= is a number which looks awful. Since I am in the position of setting up a blog just now, I can only stress= this variable is needed. I wish I could help you with the code more than I= have done with my suggestions. But maybe some one else on the list has an = idea? Best Regards, Vitus ________________________________________ Von: Thibault Marin [thibault.marin@gmx.com] Gesendet: Dienstag, 12. April 2022 07:15 An: Vitus Sch=E4fftlein Cc: emacs-orgmode@gnu.org Betreff: Re: ox-html: exporting LaTeX-environments 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=E4fftlein 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=92t 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=92t 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