From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id KOjPGg1FJmb3LwEAe85BDQ:P1 (envelope-from ) for ; Mon, 22 Apr 2024 13:07:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id KOjPGg1FJmb3LwEAe85BDQ (envelope-from ) for ; Mon, 22 Apr 2024 13:07:57 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Wsz1sdWu; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713784077; 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:dkim-signature; bh=cdh8vaMoP5ucZJY2YPB2npjhBSoQexn2/bQGh7kexSw=; b=axXqlHvX1KtMd/rdudz0QC7G3GiRhBDI3VGaqyaAn/mhCj4/t+Rsg9ZL4/PXyZs5S/jpsH CcL7APsX+Ix9s5wbnok4Vu/JGZw82ufXx3nALEFfpZqKQsPLTbCTBmqBODcJaD1CFy9dfu Gp1vvulYSGRtDKOzSiX7lhAu5/qDageiOksqiRFZhZtFXUMOEmaCIcQs0f+nW+Yl70jJ4C 9KVW9yGfeyoLlofT4mSb9MqqpGP6T7gdn/aZOypEcn0QC0sHmFmMqUhVjTG0fW2S8JXm4M PCgcnBly3jP3viLx7/yxr1gKDEzLgX1uka8MgrRLVks49dRUlRyocvfQa/RU8w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713784077; a=rsa-sha256; cv=none; b=LU/nHhaRjQliMwvz6zy56+nk2DtZlfJcrbSF4uCEMnEHqhEclziiy9NPKcgLO58k5u7BWV fv+R28k2TsDt3kIMMPmmQ5C2YTmeGqX+dXnNDhk9DXUaVzWtEXXd1pZvSjj5447RgUZtMV Ou/f230yChwE8D62R11uQ6HLTJIlZQDN1aDFb1vHFZIkibMgZ6K4SMyC6KqnFy7VQJCPGh fZLLBg7mRrX5YtEMK5xpXA3iVy6UZnM3vpCxUYd3MKaV2bq1tik91Qzh4MJu0VEu9kTzBI QWSoj6XpDKn+nctLaMnToDdzXLWOP7hN3NzMA4JEK8uWjv3vjewGpnIU0B9M4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Wsz1sdWu; 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"; dmarc=pass (policy=none) header.from=posteo.net 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 0BE1915AAF for ; Mon, 22 Apr 2024 13:07:57 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryrWB-0006dQ-Ju; Mon, 22 Apr 2024 07:07:27 -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 1ryrW9-0006d6-RF for emacs-orgmode@gnu.org; Mon, 22 Apr 2024 07:07:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryrW7-0003ao-0M for emacs-orgmode@gnu.org; Mon, 22 Apr 2024 07:07:25 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BF139240105 for ; Mon, 22 Apr 2024 13:07:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1713784039; bh=4Ezl9esZEaUqKZ4SRd4vCcdk/TiXiv6bKNscUHdIvbk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=Wsz1sdWueVSzhaukpeKeuax+AqYEUpz0enoYMYtet/QAuS2jlg20koHoTEqTk3sXA OGnML24XDORKLy0xXB2U/LTWH1IJMKbhyYdcZWKcLnIYTwhET78IMzniYn5GBENiKy 7cSj/asO5xAhfPAxAsnqPS2RbkIcJLKTuD4harjfkrRC3NiQIXjWIk+Sw0vk5nAltp a1bttJkUCJ5wSaDLKNb80UsB64PbW4nCi4jt8r5Pvya+iThAS88dBC878VFLhLS87O Evnx8nSZQfpg0EdwXoyaxNjqwHYdGLk7ttUDCPgu9iHmmP4M1jOp/njlXqawkhJmNq cogrf8Dh5YODw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VNMsL5yBnz9rxD; Mon, 22 Apr 2024 13:07:18 +0200 (CEST) From: Ihor Radchenko To: Timothy , Karthik Chikmagalur Cc: emacs-orgmode@gnu.org Subject: Feedback on the new "feature" system in org-export (was: [Pre-PATCH] Overhaul of the LaTeX preview system) In-Reply-To: <87lek2up0w.fsf@tec.tecosaur.net> References: <87lek2up0w.fsf@tec.tecosaur.net> Date: Mon, 22 Apr 2024 11:08:07 +0000 Message-ID: <87a5llzmco.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 X-Migadu-Spam-Score: -9.59 X-Spam-Score: -9.59 X-Migadu-Queue-Id: 0BE1915AAF X-Migadu-Scanner: mx12.migadu.com X-TUID: 1I1/YanWOoP6 Timothy writes: > After months of work, Karthink and I have prepared a rather large patch-s= et > completely overhauling the LaTeX preview system. I hope to have a patch s= et > shortly, but in the mean time it would be good to get some more people te= sting > this. > > To test this feature, please check out the `dev' branch of > (it=E2=80=99s the default bra= nch). There are > also some other changes there currently, but I don=E2=80=99t think anythi= ng is broken. Now, after the last blocker with odt export has been addressed, I am starting to review the patch formally for merging upstream. One of the new core mechanisms introduced in the patch is the "feature" system for building export preambles. It allows building the preambles selectively, depending on the document contents and current export configuration. The feature is mostly designed for use in latex/beamer export where every additional \usepackage call adds to the compile time. Not to mention the problem when we have to limit the latex packages we use by default in order to not create incompatibilities with user packages. For now, I will provide some high-level feedback: 1. After not following latex-preview feature development for a while, with a fresh mind, I find the basic terminology rather confusing. When reading the new "Export features" section of the manual, and looking through the code, I feel that a more appropriate name for the "features" would be "templates" - what you call "feature implementations" is, at the end, very similar to Emacs skeletons, but with a twist that the template order is not fixed: (cl-defstruct (org-export-backend (:constructor org-export-create-backen= d) (:copier nil)) ... template-conditions templates) 2. While reading the new manual section, I have an impression that the feature/template system can be used in any export backend and that document preamble can be customized by users locally, on top of the backend. However, it is only really true for ox-latex and its derived backends. If one, for example, tries to use org-export-update-features on 'html (for example, to include some JS library conditionally), it will not work. I thus feel that the newly added section does not really belong to the user manual. Rather to https://orgmode.org/worg/dev/org-export-reference.html 3. What could make sense to expose to users (and to add to the user manual) is the means to customize the document preamble conditionally. Now, we have `org-latex-classes' with its awkward syntax of =20=20=20 [DEFAULT-PACKAGES] \usepackage statements for default packages [NO-DEFAULT-PACKAGES] do not include any of the default packages [PACKAGES] \usepackage statements for packages [NO-PACKAGES] do not include the packages [EXTRA] the stuff from #+LATEX_HEADER(_EXTRA) [NO-EXTRA] do not include #+LATEX_HEADER(_EXTRA) stuff I think that it could be a good idea to support an alternative syntax making use of feature/template system. Same thing for similar customizations like `org-cite-csl-latex-preamble' and `org-latex-engraved-preamble' Ideally, we should supply users with a list of templates for the most commonly used latex packages, formalizing LaTeX package dependencies and conflicts 4. The overall design of the feature/template system is solid, and we can extend it in case we need to. However, I am slightly concerned that the only user of the new system is ox-latex. I believe that we can test the current API better if we try to use it for real in several scenarios. I have the following use-cases in mind: + `org-latex-classes' and similar user-defined templates + `org-latex-template' + `org-beamer-template' -> this one is important as we can partially inherit from the latex template. + `org-html-template' -> something non-LaTeX --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at