From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id KPXtJtFyq2WAEgEAqHPOHw:P1 (envelope-from ) for ; Sat, 20 Jan 2024 08:14:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id KPXtJtFyq2WAEgEAqHPOHw (envelope-from ) for ; Sat, 20 Jan 2024 08:14:25 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=M4wjwKRy; dmarc=pass (policy=none) header.from=gmail.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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705734865; 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=hZv717Wb4asUh6SQFnZnTavj01psHOjRJZ8l8vJ0WMo=; b=AbJzvgMGUNMr8xiEGgIuVOUMmj4/lEgg06v2sVkO15LRQPQ5zZghGao7Om4ucdhSo999LB C90O37NsG122ALyElx6vxIxs5o+Th9awFViLThg+4+i/N0abYorsNuPWkaLDKVNmBwG9wd fWsE8BYl7HVEKMrMurdFLPM9JxJpYlbdGAoNEpkrbG44PG4HKmki/4D82ryGA0SXqFpwgI r/cWXiRRcmOnY5BxcP5KCf585Rf/GMlf9E8p5imlywOAYKQ4l80sPb/oTlX10BoK0Vwt0G M4lCYVhA7r/g8P8ukdfv6/G1UrpD9HuI0/Ygh6rA3Skbc7FnW2Ar0lSgQ9hfgg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705734865; a=rsa-sha256; cv=none; b=dkT7JhWOdkOJsNiQWXCv/mXKBSIB0IiIJHBjtGy88vPajDQMqCTIVVgmRvHYhovQc4Pder DvAxs9/PrZMfXljL3GUl5DwuAxWUcP2D+f2T7PyOlR6UVhCVTlbPNRR0NtiyFUF+lBDMpF huZG1l9NQmHyZmkO+TnsZa4KL16FDvPzA+MCKW4POQ44XbBdabR959Hrvh+25qeXwaiDkW 3N6EURIeVG6ukU8SP3qMsz3QT4LSl9tJXcYD/kbZe7tJEO0VNPWVVa/3FVxlmF8wRlVGsY swVNcyPsx/4YvMfbz33Ckkueq/fOYbcKzlWU/tN6x0haGq/clSw9BC0BPeKzIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=M4wjwKRy; dmarc=pass (policy=none) header.from=gmail.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" 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 363AD2325E for ; Sat, 20 Jan 2024 08:14:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rR5Xl-00032F-IF; Sat, 20 Jan 2024 02:13:29 -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 1rR5Xj-00031J-N5 for emacs-orgmode@gnu.org; Sat, 20 Jan 2024 02:13:27 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rR5Xh-0002CB-Cr for emacs-orgmode@gnu.org; Sat, 20 Jan 2024 02:13:27 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6dbd07916d0so149549b3a.0 for ; Fri, 19 Jan 2024 23:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705734801; x=1706339601; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=hZv717Wb4asUh6SQFnZnTavj01psHOjRJZ8l8vJ0WMo=; b=M4wjwKRybK2tfRx/alKuejmu1vZPz+L1sFCl9mAHdXFMaq+1rTHAPM1nb87RQU6fw0 8tPEDRuHIY2J1E3+BV5OugY8E4+CTZNOicM0DpV59Qd2zQj9z6NIqb/ozFyMTaMYqzcs h8ANkTC1TWk882iSlUm31KEtiXAY/6neH6lkDTgA2W1IO4Slcnku49FLEzqJYTc9qAKt LXjTwjc84zFOz/v1bT8TpU9dWD8phyLHJQDWW5jy+1BmhKWeYrsLMRLE3okza92Osb9L KhjEvP+c8gZx+y4ywdTpoXn/LDr7mk7Kmi3EMh4tKQFG57GXx4ZtdJkGhKQDKwLAuUE8 SW6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705734801; x=1706339601; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hZv717Wb4asUh6SQFnZnTavj01psHOjRJZ8l8vJ0WMo=; b=xS2SQyTR/H9WSvIAVd4T3GDQatJZK1vzq9g96NORwI2KukJup5oftddGlTRQ4M1Wpj cDFbiLWeu7G8p2hiaqnxaoFDcY61Mx/DtG+gQ/MlInfu1cUl20sV9ojXwk+sX3zbArcO H6OzfdyM2OPrDBcms2v89W7ClGo3EVaKoxIRhrQPlRg0WIQAi2EBPII9lzJaEPAd0rLr wCzHta1yYzF82RMwvn/ZYXZNwOatekVJNabPQxjde7cmMdIHlItnndFmTY4TA5WTkYix 3mxgP647yU78ci5hlTaw2eG8d8epCFTehBfCQ2WVV0IjGtgrHhGaMLZPXiav6qF2GleI RBuA== X-Gm-Message-State: AOJu0Yzxtes98g1v7odnKe/zgWCjOsD7NUhjpqc1f5fB4jsFCeeZaboa C9nczTH4TNrjpu1aljogVpDuU3LhVzN6ISzZwcZoMnDcNaBbFdJ/HZ6PMwVH X-Google-Smtp-Source: AGHT+IGZBLI/ibpz1M2PnyOvZVFcZPGGfFXDA7U5tBPsaiCENIUlDiQv7/RvdRLdjzwxZ4FMP37ubA== X-Received: by 2002:a05:6a00:1d8b:b0:6db:a155:df7f with SMTP id z11-20020a056a001d8b00b006dba155df7fmr1493962pfw.50.1705734801543; Fri, 19 Jan 2024 23:13:21 -0800 (PST) Received: from ryzen3950 ([2001:5a8:6105:2400:eb77:c6fa:caaf:aed5]) by smtp.gmail.com with ESMTPSA id n16-20020aa78a50000000b006cecaff9e29sm6167775pfa.128.2024.01.19.23.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 23:13:21 -0800 (PST) From: Matt Huszagh To: Timothy , emacs-orgmode@gnu.org Cc: Subject: Re: [Pre-PATCH] Overhaul of the LaTeX preview system In-Reply-To: <87cytwk0eo.fsf@gmail.com> References: <87lek2up0w.fsf@tec.tecosaur.net> <87cytwk0eo.fsf@gmail.com> Date: Fri, 19 Jan 2024 23:13:19 -0800 Message-ID: <87plxwfpf4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=huszaghmatt@gmail.com; helo=mail-pf1-x435.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, 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: , 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 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.99 X-Spam-Score: -9.99 X-Migadu-Queue-Id: 363AD2325E X-TUID: 46rTrUMnooBs Matt Huszagh writes: > Another minor issue I've encountered. Using different delimiters results > in images of slightly different sizes. > > For example, in a file containing: > > ``` > Using first delimiters: \(F=ma\). > > Using other delimiters: $F=ma$. > ``` > > The snippet with dollar sign delimiters is slightly larger than the one > using \(\). The following code, where you compute the ascent value, seems relevant to this observation: ;; The baseline seems to tend to sit slightly ;; lower than it should be, and a very mild ;; bias seems to improve the visual result. ;; From testing with a collecting of LaTeX ;; maths fonts (cm, cmbright, arev, pxfonts, ;; notomath, nextxsf, eulervm) decreacing the ;; depth measurement by 0.02pt in the baseline ;; calculation seems to work well. ;; I have yet to come across any situation ;; where this results in a negative depth, ;; however we may as well ensure that never ;; occurs. (round (* 100 (- 1 (/ (max 0.0 (- depth 0.02)) height)))) When using \(\) delimiters, using a depth adjustment of 0 (instead of 0.02) looks correct to me. I checked this by blowing up the fragment with a very large scale factor (eg 10) and then baseline misalignments become more obvious. This is how I ensured my baseline computation was correct when I wrote that patch aligning the baseline several years ago. I /think/ that's a valid method, and I've been using my code for the last couple years and the baseline has always looked correct. Anyway, can you explain more why you came to the conclusion of that slight depth adjustment? Are you using $$ delimiters? That also appears to produce other visual imperfections. For $F=ma$, I see the bottom of the "m" and "a" cut off slightly. I wonder why different delimiters produce different results. I used slightly different settings for dvisvgm in my implementation (including --exact-bbox). I wonder if that has any relevance... I also used a different document class - standalone in preview mode. Now that I think about it, IIRC that was to address another corner case I ran into, which is that for large images, article will crop it before it gets to dvisvgm. It's been a while since I did this and my memory is hazy, but I think that's why I used standalone. I can try to investigate that with a minimal issue. Matt