From: Ihor Radchenko <yantar92@posteo.net>
To: Timothy <orgmode@tec.tecosaur.net>,
Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Feedback on the new "feature" system in org-export (was: [Pre-PATCH] Overhaul of the LaTeX preview system)
Date: Mon, 22 Apr 2024 11:08:07 +0000 [thread overview]
Message-ID: <87a5llzmco.fsf@localhost> (raw)
In-Reply-To: <87lek2up0w.fsf@tec.tecosaur.net>
Timothy <orgmode@tec.tecosaur.net> writes:
> After months of work, Karthink and I have prepared a rather large patch-set
> completely overhauling the LaTeX preview system. I hope to have a patch set
> shortly, but in the mean time it would be good to get some more people testing
> this.
>
> To test this feature, please check out the `dev' branch of
> <https://git.tecosaur.net/tec/org-mode.git> (it’s the default branch). There are
> also some other changes there currently, but I don’t think anything 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-backend)
(: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
[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
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2024-04-22 11:07 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-12 12:23 [Pre-PATCH] Overhaul of the LaTeX preview system Timothy
2023-03-13 12:26 ` Ihor Radchenko
2023-03-14 16:04 ` Timothy
2023-03-15 9:34 ` Ihor Radchenko
2023-03-15 17:28 ` Rudolf Adamkovič
2023-03-13 12:30 ` Ihor Radchenko
2023-03-13 12:32 ` Ihor Radchenko
2023-03-14 14:46 ` Timothy
2023-03-13 12:36 ` Ihor Radchenko
2023-03-14 16:10 ` Timothy
2023-03-15 9:38 ` Ihor Radchenko
2023-03-13 12:37 ` Ihor Radchenko
2023-03-14 16:13 ` Timothy
2023-03-25 15:29 ` Tony Zorman
2023-05-02 12:15 ` K. Chousos
2023-05-03 10:07 ` K. Chousos
2023-05-05 17:57 ` Karthik Chikmagalur
2023-05-05 18:48 ` Konstantinos Chousos
2023-05-05 18:53 ` Konstantinos Chousos
2023-05-05 20:05 ` Karthik Chikmagalur
2023-05-05 21:06 ` Konstantinos Chousos
2023-05-05 22:58 ` Karthik Chikmagalur
2023-05-06 9:19 ` Konstantinos Chousos
2023-05-06 9:30 ` Ihor Radchenko
2023-05-06 10:08 ` Konstantinos Chousos
2023-05-08 20:04 ` Karthik Chikmagalur
2023-05-08 20:40 ` Konstantinos Chousos
2023-05-09 11:34 ` Ihor Radchenko
2023-05-09 12:03 ` Timothy
2023-05-09 12:10 ` Ruijie Yu via General discussions about Org-mode.
2023-05-09 12:12 ` Ihor Radchenko
2023-05-09 12:10 ` Timothy
2023-05-09 12:49 ` Max Nikulin
2023-05-09 12:57 ` Ihor Radchenko
2023-05-10 10:07 ` Jun Inoue
2023-05-10 10:21 ` Timothy
2023-05-10 13:09 ` Jun Inoue
2023-05-26 9:50 ` Rudolf Adamkovič
2023-05-28 17:31 ` Timothy
2023-06-03 9:00 ` Rudolf Adamkovič
2023-08-21 8:59 ` Visuwesh
2023-08-21 16:40 ` Karthik Chikmagalur
2023-08-21 17:19 ` Visuwesh
2023-08-21 21:40 ` Karthik Chikmagalur
2023-08-22 2:57 ` Visuwesh
2024-05-30 8:28 ` Visuwesh
2024-10-15 18:44 ` Ihor Radchenko
2024-10-16 5:58 ` Visuwesh
2023-08-29 6:01 ` Roshan Shariff
2023-08-29 6:01 ` [PATCH 1/1] Fix background color when line-wrapping latex previews Roshan Shariff
2023-08-29 17:14 ` [PATCH v2] Fix background color of " Roshan Shariff
2024-01-07 7:25 ` Timothy
2024-01-07 9:50 ` Roshan Shariff
2024-01-08 10:24 ` Timothy
2024-01-09 20:12 ` Roshan Shariff
2024-01-07 7:28 ` [Pre-PATCH] Overhaul of the LaTeX preview system Timothy
2024-01-20 5:53 ` Matt Huszagh
2024-01-20 6:02 ` Matt Huszagh
2024-01-20 7:13 ` Matt Huszagh
2024-01-21 17:08 ` Timothy
2024-04-22 11:08 ` Ihor Radchenko [this message]
2024-07-21 12:41 ` Jun Inoue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a5llzmco.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=karthikchikmagalur@gmail.com \
--cc=orgmode@tec.tecosaur.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).