Have tried what you suggest with little success.
For example in the case of beamer, I tried adding
\usepackage[dvipsnames]{xcolor}
with a #+LATEX_HEADER and it did not work.

On the other hand I don't always need the dvips colour names always,
so it would be doing and undoing the LaTeX class definition continuously,
which is sort of a hassle.
This way, I can add it when I need it and use just one LATEX_CLASS.
IMHO it is much cleaner...

/PA

On Sat, 7 Feb 2026 at 13:30, Ihor Radchenko <[email protected]> wrote:

> Pedro Andres Aranda Gutierrez <[email protected]> writes:
>
> > attached is a patch that adds prepending lines before the LaTeX preamble.
> > This is something I needed to be able to use extended colour names in my
> > slides.
> > ...
> > +#+cindex: @samp{LATEX_HEADER_PRE}, keyword
> > +The LaTeX export backend prepends values from =LATEX_HEADER_PRE=
> > +keywords before the LaTeX preamble. Use this option when you want to
> > +set the values passed to packages included in the document class. For
> > +example, to use extended names for the ~xcolor~ package, use
> > +
> > +#+begin_example
> > +,#+LATEX_HEADER_PRE: \PassOptionsToPackage{dvipsnames}{xcolor}
> > +#+end_example
>
> Conceptually, this feels like something that should be a part of
> #+LATEX_CLASS definition. `org-latex-classes', if modified, should allow
> similar features, if you need to add something before \documentclass line.
>
> Maybe we should instead allow an override for header string in
> org-latex-classes as a new keyword?
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> 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>
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

"Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
Year 2 of the New Koprocracy

Reply via email to