From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword
Date: Mon, 2 Oct 2023 17:42:40 +0700 [thread overview]
Message-ID: <ufe6r4$si5$1@ciao.gmane.io> (raw)
In-Reply-To: <87lecsvjdd.fsf@posteo.net>
On 27/09/2023 02:12, Juan Manuel Macías wrote:
> Max Nikulin writes:
>
>> I just have checked that a dirty hack with a few lines of code for
>> `org-export-filter-final-output-functions' allows to insert arbitrary
>> text to the beginning of export result. Perhaps a more elegant solution
>> exists, but I admit it is not a straightforward way. At least it is
>> possible.
>
> And it is also possible by simply defining a new class (in Org
> terminology, not LaTeX). My usual class is an almost empty one, without
> documentclass and without packages, because I don't want org to write
> the preamble for me. But I think this is not the point.
LATEX_PRE_HEADER you proposed is a document-local setting while
`org-latex-classes' is shared by all Org documents. In that hack I used
a buffer-local variable to achieve document-specific fragment.
In the specific cases of \DocumentMetadata and .xmpdata,
LATEX_PRE_HEADER needs to be passed through `format-spec' with result of
`org-latex--format-spec' call to get notion of Org metadata. Whether it
is necessary for \PassOptionsToPackage depends on particular cases. If
such options do not vary across documents then certainly
`org-latex-classes' becomes viable.
I do not like "[NO-PACKAGES]" and similar keywords to suppress adding of
some code snippets. That is why I believe it is better to seek for
another approach to generate LaTeX preamble. I have not had a look into
Timothy's code yet, so I can say nothing concerning its flexibility in
respect to substituting metadata into code before \documentclass.
prev parent reply other threads:[~2023-10-02 10:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-16 18:00 [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword Juan Manuel Macías
2023-09-17 10:02 ` Ihor Radchenko
2023-09-17 17:23 ` Timothy
2023-09-18 8:09 ` Ihor Radchenko
2023-09-22 16:38 ` Max Nikulin
2023-09-24 18:42 ` Juan Manuel Macías
2023-09-25 13:58 ` Max Nikulin
2023-09-25 18:49 ` Juan Manuel Macías
2023-09-25 21:57 ` Thomas S. Dye
2023-09-26 15:39 ` Max Nikulin
2023-09-26 19:12 ` Juan Manuel Macías
2023-09-28 10:07 ` Max Nikulin
2023-09-28 12:31 ` Juan Manuel Macías
2023-09-29 2:38 ` Max Nikulin
2023-10-01 16:32 ` Max Nikulin
2023-09-28 15:36 ` AW
2023-10-01 16:02 ` Max Nikulin
2023-10-01 17:48 ` Juan Manuel Macías
2023-10-02 10:42 ` Max Nikulin [this message]
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='ufe6r4$si5$1@ciao.gmane.io' \
--to=manikulin@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).