From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6OIvLU/Zf2PCQgAAbAwnHQ (envelope-from ) for ; Thu, 24 Nov 2022 21:51:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2Oo8LU/Zf2O13AAAauVa8A (envelope-from ) for ; Thu, 24 Nov 2022 21:51:27 +0100 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 8CB9D6D3 for ; Thu, 24 Nov 2022 21:51:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyJAT-00087S-0F; Thu, 24 Nov 2022 15:49:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyJAM-00084z-Di for emacs-orgmode@gnu.org; Thu, 24 Nov 2022 15:49:52 -0500 Received: from mr85p00im-ztdg06021701.me.com ([17.58.23.196]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyJAJ-0000LE-Qn for emacs-orgmode@gnu.org; Thu, 24 Nov 2022 15:49:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1669322985; bh=LWjN4JCzoCE3mMjefFELaugOWWsegJ9uKs9gFINDGlE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=mqIjr67HMS+4c990uneybqVED23WbaoPuB+Vf3Ws9Td1qszn5AjWqOtpyoDpQG8Vo JthApxZLy0EXEtHd+yXUKuh7VRqM6rSrq6oOXqlq2O9lIWEWyyyAALm4wNxrYhG8DJ MTdgJGa9pA9QDXWck8ZugSLhCsASebuaggSJFT0GtTBuu5UFvNxLJFlcUiE1D3HHt8 XZacrfkcyz+d4Raj17VMYj3DW5e27gOgMPmns2CW2LaFYRTDvxs6aFgH5UXMY+U2eU QvNaFIsZ3RlVKLxThXXM+roWTfn29bQlk19kZkUF1gUI5NtZcqyvoJ4DM+1+JatUx1 l6NxsrnaHe9yw== Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-ztdg06021701.me.com (Postfix) with ESMTPSA id 022879A05A2; Thu, 24 Nov 2022 20:49:44 +0000 (UTC) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Fix clipped LaTeX fragments (not Babel) In-Reply-To: <875yf5clj8.fsf@localhost> References: <875yf5clj8.fsf@localhost> Date: Thu, 24 Nov 2022 21:49:35 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Proofpoint-ORIG-GUID: tdQna2KFiO_IYWgr2bXWKQOwbiYFMhUt X-Proofpoint-GUID: tdQna2KFiO_IYWgr2bXWKQOwbiYFMhUt X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.572,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2020-02-14=5F11:2020-02-14=5F02,2020-02-14=5F11,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 clxscore=1015 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2211240156 Received-SPF: pass client-ip=17.58.23.196; envelope-from=salutis@me.com; helo=mr85p00im-ztdg06021701.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, 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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669323087; 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=LWjN4JCzoCE3mMjefFELaugOWWsegJ9uKs9gFINDGlE=; b=pbs3lVZyIH7fsCEnFlIf3VREqu6WSQ2NswYBGWU/VkMroEtWQBSJ0w8cSJUJXpjW+PP6Em 3Jxd9XpXMue3yO2NEEqLb8RPLsbFQOcXFEpvF339J1d2uEeUtM0lyXrG3Jg7/wqJ+DUAK1 h8hHjC5rXd6us7+sax9iB8Gcqme/CECVqg+NB/GyUw5LhCiwLWibY7yxz5KJFiUygfgcWm v6Nynobxdu+ScsLkBBrhwJbhpQWSHP8WpQ2ndm8V0L+EbKJR+tkqBDQdeXFZFef2LNqVIa qt+pSppY2V0WybNx0j3t4I/YSi3ehXYeQ1E3QgODtW8YziaqH+MEER9+J25BAw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669323087; a=rsa-sha256; cv=none; b=TOPNceu/6/akeFhKJrWBN/0UxkWa5IN7RBuHjYnTNBuWx7ZsPq4m/8PnmhIaSDqO/Li+vk r0ZdNAGYk1OoSaihjpdvqRskSizEJsS1hUB37hee87qLCAtGV4WECD8mWBWUiMFFDqtsM5 +/MGeZUYkN3fBfmIoRSC+iM90/hMBE5HAJuoeixSO1Akq7CT+f3pIZQKaKs1R65aCnR4rB 0uj6efdyeW7HO3xKn5VFGqw9x3HqwXjcvx4dfQoeMdH0jBKxo3y2N1axgD+yJ+ilsu/jat WaZKTM7rxCmhW8pk424VWUz/CYfvVSIYksCPuUqTnf2vsZ1OgS1WJqpsnCG2mQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=mqIjr67H; dmarc=pass (policy=quarantine) header.from=me.com; 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: -2.58 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=mqIjr67H; dmarc=pass (policy=quarantine) header.from=me.com; 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: 8CB9D6D3 X-Spam-Score: -2.58 X-Migadu-Scanner: scn1.migadu.com X-TUID: UWuDpclVmrfM --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Maybe you can use full argument versions instead of short ones? Good idea, Ihor! Please see the two attached patches. I re-attach the first patch again because I reworded the first line of its commit message to put more emphasis on the term "exact". Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org.el-Compute-bounds-exactly-when-converting-LaTeX-.patch >From b1be654ba28ceca60d0b12778d374db27e6eced5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Wed, 23 Nov 2022 23:03:37 +0100 Subject: [PATCH 1/2] org.el: Compute bounds exactly when converting LaTeX output to SVG * lisp/org.el (org-preview-latex-process-alist): Call `dvisvgm' with `-e' (`--exact-bbox') instead of `-b min' (`--bbox=min') to measure the exact bounds around visual glyphs, as opposed to using font metrics, to avoid clipping at the edges. --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 64b33e597..2f473f54d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3243,7 +3243,7 @@ All available processes and theirs documents can be found in :image-output-type "svg" :image-size-adjust (1.7 . 1.5) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") - :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) + :image-converter ("dvisvgm %f -n -e -c %S -o %O")) (imagemagick :programs ("latex" "convert") :description "pdf > png" -- 2.38.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-org.el-Use-long-option-names-when-launching-dvisvgm.patch >From 34e3ecd3b23fae330574fe1cbcb3154b2fb8a2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Thu, 24 Nov 2022 21:41:35 +0100 Subject: [PATCH 2/2] org.el: Use long option names when launching dvisvgm * lisp/org.el (org-preview-latex-process-alist): Use long option names when launching dvisvgm, optimizing for maintainability, instead of brevity. For example, use `--no-fonts' instead of `-n'. --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 2f473f54d..472e87b9b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3243,7 +3243,7 @@ All available processes and theirs documents can be found in :image-output-type "svg" :image-size-adjust (1.7 . 1.5) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") - :image-converter ("dvisvgm %f -n -e -c %S -o %O")) + :image-converter ("dvisvgm %f --no-fonts --exact-bbox --scale=%S --output=%O")) (imagemagick :programs ("latex" "convert") :description "pdf > png" -- 2.38.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "I love deadlines. I love the whooshing noise they make as they go by." -- Douglas Adams, The Salmon of Doubt, 2002 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--