[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improvements in the default LaTeX preamble: templates? (was: [PATCH] ox

From: Juan Manuel Macías
Subject: Improvements in the default LaTeX preamble: templates? (was: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists)
Date: Sun, 24 Jul 2022 12:06:00 +0000

Ihor Radchenko writes:

> Adding things like paper size is a much more debatable topic.
> Considering the number of expected developments in this area, including
> the earlier discussion on XeLaTeX/LuaTeX and preamble generation by TEC,
> adding the new specific defaults will need to be a subject of extensive
> discussion and testing. I do not see much point delaying this patch,
> which provides an immediate improvement in the codebase, until we
> complete all that.

I agree that adding more elements to the standard preamble is a complex
matter. LaTeX is already horribly complex and multiple, and it is
difficult to satisfy all kinds of users with a standard code. It
occurred to me that an alternative to modifying Org's code in this
regard could be to have some kind of "LaTeX template library". I think
Pandoc has something similar too, if I remember correctly. Those
templates could be on Org or provided by third parties somewhere else,
like Worg. In Org, we also have a great system for creating LaTeX
documents templates, which is the org-latex-classes list. A large number
of elements could be defined in a 'single' class for any type of

Some time ago I shared here a function I wrote (it's a bit raw and
little tested) to be able to convert a LaTeX document (the preamble)
into a lisp expression to be added to org-latex-classes:


On the one hand Org would offer a more or less basic preamble out of the
box and on the other hand there could be a "org-latex-classes library"
(extensible by users) that would support a multitude of LaTeX document
types or users. This would include preamble types with a bunch of
components: page layout, fonts, lua code, custom LaTeX commands, custom
lua functions, article types, book types, etc. It would suffice to add:

#+latex_class: foo

and the magic is done.

Best regards,

Juan Manuel 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]