From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id iIFoOOyfFWYG2AAAe85BDQ:P1 (envelope-from ) for ; Tue, 09 Apr 2024 22:07:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iIFoOOyfFWYG2AAAe85BDQ (envelope-from ) for ; Tue, 09 Apr 2024 22:07:09 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712693228; a=rsa-sha256; cv=none; b=hS7A6gTHv00MpwfiCtJvAcIvt59nQd8xIvpHFuvHnyUYATCTMQI8AFxZt4Idb+a4eSTL23 UETRr+1rYZPosYRUwQ8a8p55LgwWMfxyswt1xgkEcISHmaiSJh2+6sD+WQEiWvAlP2FPrA NMYpu6qSSrlnpLA5dgZSWadEcxl/E+O9jSwnbdQvDLXoZcX3O3pjbiMPdHOl8Ltxn8+ftR dtD6j71lumDjF5s3F8S9U+bbpSa040pfu1XxZhV3gYBovAWac2cXWZfp/xyWWzo4DgLh3Q +CXAywWpm6DY4SO+XMhVH9jRkkolLqhp32TUje/qF8+wICaKLLlIhocmVptlCA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712693228; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=/0KBUUK8/gQDgpkYUdiLs9WlnhZPyRo569sTay6pwGA=; b=nXPnAxKrSqTt6/ApoGc1F5ERaBKD4mUsfUWMQodRo6QZ9SB9Ae9N1WPFIQlcRBm16H1PxR EQZCU+1HYDxF+jKMlKga0K33O4HMb8xwEYqmmbnGhZRp9FClU+dnypPTx3Uk20LlBug0vh wm3pvtLr44kJ+GH3B7I0UY+zOPlNM8cj4CwHXXeKpydc+ad26MQi6ke3cj5Ziu6cTFKVBw LGiC/827u3TeHumc4MTAbZDNcNTKPkW5CBnNwLEZnqj/PXggvTqCYkIM/VpupZ03Va2I8k FkwmvySJw4MvR7vk7dQjNImDyTFAtWDFv0VABLxdhbbW1jz9HEQ9BKruimzptA== 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 A9454E9B1 for ; Tue, 9 Apr 2024 22:07:08 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruHjT-0001xG-SX; Tue, 09 Apr 2024 16:06:16 -0400 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 1ruHjS-0001x8-BD for emacs-orgmode@gnu.org; Tue, 09 Apr 2024 16:06:14 -0400 Received: from www553.your-server.de ([78.46.153.203]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruHjQ-0000xV-1F for emacs-orgmode@gnu.org; Tue, 09 Apr 2024 16:06:13 -0400 Received: from sslproxy05.your-server.de ([78.46.172.2]) by www553.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruHjI-0007I5-Qd; Tue, 09 Apr 2024 22:06:04 +0200 Received: from [2001:9e8:b3d:5900:1320:df76:3b64:8070] (helo=comonad) by sslproxy05.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ruHjI-0016Bo-1e; Tue, 09 Apr 2024 22:06:04 +0200 From: Tony Zorman To: Karthik Chikmagalur , emacs-orgmode@gnu.org Subject: Re: Using org-latex-preview in other major modes In-Reply-To: <87y19oe4yd.fsf@gmail.com> References: <87edbhljr7.fsf@hyperspace> <874jcdf4hj.fsf@gmail.com> <87wmp8l6dg.fsf@hyperspace> <87y19oe4yd.fsf@gmail.com> User-Agent: Notmuch/0.38.3, Emacs 30.0.50 Date: Tue, 09 Apr 2024 22:06:03 +0200 Message-ID: <87cyqyqp1w.fsf@hyperspace> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: mail@tony-zorman.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27240/Tue Apr 9 10:26:56 2024) Received-SPF: pass client-ip=78.46.153.203; envelope-from=mail@tony-zorman.com; helo=www553.your-server.de X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 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: , 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-Spam-Score: -3.25 X-Migadu-Queue-Id: A9454E9B1 X-Migadu-Spam-Score: -3.25 X-Migadu-Scanner: mx10.migadu.com X-TUID: 9WtiOj5nduhI On Sun, Apr 07 2024 23:36, Karthik Chikmagalur wrote: > You can ignore `org-latex-preview-live--src-buffer-setup', this is for > previewing when using `org-edit-special' (C-c '), which does not apply > to any other major mode. So `org-latex-preview-live--ensure-overlay' is > the only function you need to rewrite, which should be easy. Oh, indeed, you are right; seems like it only looked intimidating! I quickly hacked this in just now, and it works just fine. As a very brief summary, one currently needs to=E2=80=94in addition to supp= lying a preamble and a way to recognise maths and environments=E2=80=94patch the following functions: =C2=B7 org-latex-preview--place-from-elements =C2=B7 org-latex-preview-auto--regenerate-overlay=20 =C2=B7 org-latex-preview-auto--maybe-track-element-here =C2=B7 org-latex-preview-live--ensure-overlay The last two are only needed for the "live" part of the live previews to work. I will clean the code up a little bit (hopefully by the weekend, but no promises), and try to add support for LaTeX environments instead of just maths. I reckon that once this is finished one can get a pretty good idea in which direction org-latex-preview.el would need to be nudged to more easily facilitate this kind of integration. After that I guess there's still the issue of caching and numbering, but I'll cross that bridge once we get to it :) Tony --=20 Tony Zorman | https://tony-zorman.com/