From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GCGLDpF3s2EnRAAAgWs5BA (envelope-from ) for ; Fri, 10 Dec 2021 16:51:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KNphCpF3s2GQeAAAB5/wlQ (envelope-from ) for ; Fri, 10 Dec 2021 15:51:45 +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 8BC30337CA for ; Fri, 10 Dec 2021 16:51:44 +0100 (CET) Received: from localhost ([::1]:32850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mviBS-0000re-0B for larch@yhetil.org; Fri, 10 Dec 2021 10:51:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvi9o-0000rO-BL for emacs-orgmode@gnu.org; Fri, 10 Dec 2021 10:50:00 -0500 Received: from mout02.posteo.de ([185.67.36.66]:58799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvi9j-0000sN-Tz for emacs-orgmode@gnu.org; Fri, 10 Dec 2021 10:50:00 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id D5CD0240104 for ; Fri, 10 Dec 2021 16:49:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1639151390; bh=DdaxRPuKnGJwtIhsunuUmBZ0+RBUrE8FhLir5dcdPpI=; h=Date:Subject:To:Cc:From:From; b=In9dQ5wuqlrHK0B5YlQo+vea4EIfjb2tpdCr7/I72xL/Ml1zIh7r3KwpWBlhRDQhr WGrX2gB1R/y+Ncm3NpU/C+TZ9M63xyCroRzonWIKmL88RCwwmrMe5Gcr5niVxSXdZu 74+4VFDQkZBRY2OYz2pL62w08xmKFjnEQzgcgvqco4n6UUjcoWCpakucveih5MXFWT FKFoNWUNqScze4+Sj/Avj/QAOokUHirH2dQHunJtp8ZaoJwNUCaqCPjF+q6berGkA2 oHbsDarGubwPXJ5m6Q4fXmS0yFN9QSoPA2pgbQC7iqwo+h4VdJsvdleTdVxTL3w4KL 2n0NhAYeU/WCg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4J9b255kX5z6tnC; Fri, 10 Dec 2021 16:49:49 +0100 (CET) Message-ID: Date: Fri, 10 Dec 2021 15:49:49 +0000 MIME-Version: 1.0 Subject: Re: Patch to align baseline of latex fragments and surrounding text Content-Language: fr To: Matt Huszagh References: <874k9oxy48.fsf@gmail.com> <871r4sxxuv.fsf@gmail.com> <87v906bepp.fsf@gmail.com> <87ilvxmngf.fsf@gmail.com> X-Woof-Patch: confirmed From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= In-Reply-To: <87ilvxmngf.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.66; envelope-from=sebastien.miquel@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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: , Reply-To: sebastien.miquel@posteo.eu Cc: "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639151504; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=xKD6T2NN1bSnyILHjMnQ+c9y0gn9sMp8lzQGnXdTcxs=; b=j5WkA5o+qTvJHmO1IqBfXcwGz1ohG49xKmejuf5i/0d0wQaoi8NSBLX8D8HKBPndZNclFq XxAsL5ygDApO2DBpgqCivY0bN/4VPAHmGMwRZWcQfSLv6gZKotnhxwMeCUHstvybq9AFa5 /mUtmzmii44v9YyI2+bBa1QjkpAYDbyF0lEeiJW3ngs+toFruhusI39XKi0bEFUarEVXr6 qAsbp50pEoQ7YZqcVqxHsIGH9R5DQztBoz7Pk6P2QQtLMbxBAQwmu+Ozcf5oEYGjmfra1v cJZyEdTJ/4Ai23GtMxVAXfPIECPP64xBriG+qoYEvwMuIP05J8cZpTVFD9clYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639151504; a=rsa-sha256; cv=none; b=ItxYLK1GuGPt1Y+YqfjYpewPEuLZJMHmJ/N9oQznn8idGIDj2DOL6tXtAa8YGjhygznvwY kv/JSWrTgcontbp6N0g+XqL66ELg0zd5tJZu5ExjGXD4M8clGk1zrdLF0sZ9gHgNvyXziR KYJJbB4x8xFNURwVl8SKFc7EFX3I0++5ialljGLSz3AAnFwyhxsXoHgwbfkRNfoYp5FmKq 1/pY4xfaBilEIvetwEzefAkHan17+aNZLWXPvX0LWTn5SZusgYuq4a3YGUtvwI99nv7cmy mAvnS9QIBy9bERMmlFK0/TNsjk5iDjCuDG4lmSPXsYlM8n2FmpbTznRabmdTvg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=In9dQ5wu; dmarc=pass (policy=none) header.from=posteo.eu; 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: -4.36 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=In9dQ5wu; dmarc=pass (policy=none) header.from=posteo.eu; 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: 8BC30337CA X-Spam-Score: -4.36 X-Migadu-Scanner: scn1.migadu.com X-TUID: qls1+jECBTUu Matt Huszagh writes: >> I couldn't get ~org--match-text-baseline-ascent~ to compute the >> ascent : the ~xml-get-attribute~ call returns >>  : ("-16.945024" "12.153473" "16.148855" "8.064997") >> which gives an ascent < -100, and the code then defaults to 'center. > I'd need to know more about your setup for generating latex > fragments. Did you follow all the directions in > org--match-text-baseline-ascent? How is your org-format-latex-header > set? In particular, are you using \documentclass[preview]{standalone}? > If you can provide me with the TeX file used to generate the fragment, > as well as the SVG file you get as a result, that would be helpful too. My mistake. For some reason, I had thought that =\documentclass[preview]{standalone}= was used by default for LaTeX previews. Setting it as described in your patch, it now works properly, even with the default value of =dvisvgm=. >> If there are no drawbacks, perhaps this behaviour should be the >> default. Otherwise, it should at least be easier to toggle. > I didn't attempt to make this the default because it requires a specific > setup, which is also different from the current default setup in other > respects. Most importantly, it requires using the standalone document > class, though I believe article is used at the moment. To make this behavior easier to toggle, you could  1. Change the default value of =org-format-latex-header=. The     =standalone= class makes sense, but I don't know if that might     break things.  2. Specify the =:latex-header= of the default =dvisvgm= option. Same     caveat applies.  3. Add a =dvisvgm-with-ascent= option to the default value of     =org-preview-latex-process-alist=. Instead of the new variable =org-latex-fragment-overlay-ascent=, perhaps the function used to compute the ascent could be provided as another property, such as =:ascent=, added to the relevant options in =org-preview-latex-process-alist=. It seems to make more sense since it only applies to svg output, and it makes it easier to have this behavior as default. It would require =org--make-preview-overlay= to take the ascent as an additional argument. Please note that I am not a maintainer, these are just a few thoughts. I do hope your work can be applied and that LaTeX fragments can be properly aligned by default. You should add [PATCH] to the subject of your mail, so that it gets listed at https://updates.orgmode.org/ and not forgotten. A maintainer will reply eventually, but it might take up to a few months. Regards, -- Sébastien Miquel