Answers inline... On Sat, 25 Jul 2026 at 09:29, Ihor Radchenko <[email protected]> wrote:
> Pedro Andres Aranda Gutierrez <[email protected]> writes: > > > Subject: [PATCH] ox-beamer.el: New Beamer LaTeX prelude sequence > > > > * doc/org-manual.org: (*** Beamer specific export settings): Add note > > about theme information in org-latex-classes. > > * etc/ORG-NEWS: Announce new place of theme information in LaTeX prelude > as > > (potentially) breaking change. > > * lisp/ox-beamer.el (org-beamer--insert-theme): New function to insert > > theme information in header for document class beamer. Will leave header > > unaltered if it contains theme configuration or the class is not beamer. > > (org-beamer-template): Use (org-beamer--insert-theme) to add the theme > > information to the LaTeX preamble. > > * testing/lisp/test-ox-beamer.el (test-ox-beamer/beamer-theme-keep): New > > test to check that the theme information in the class header provided by > > (org-latex-classes) takes precedence over the BEAMER_... keywords. > > Document class options are inserted correctly in all cases. > > --- > > doc/org-manual.org | 5 ++++- > > etc/ORG-NEWS | 18 ++++++++++++++++++ > > lisp/ox-beamer.el | 30 ++++++++++++++++++++++-------- > > testing/lisp/test-ox-beamer.el | 34 ++++++++++++++++++++++++++++++++++ > > 4 files changed, 78 insertions(+), 9 deletions(-) > > > > diff --git a/doc/org-manual.org b/doc/org-manual.org > > index cd8903a7e..cab2f200d 100644 > > --- a/doc/org-manual.org > > +++ b/doc/org-manual.org > > @@ -13159,9 +13159,12 @@ Beamer output. These keywords work similar to > the general options > > settings (see [[*Export Settings]]). > > > > #+texinfo: @noindent > > -*Note:* Theme-related =BEAMER_...= keywords do not apply to =ltx-talk= > > +*Note 1:* Theme-related =BEAMER_...= keywords do not apply to =ltx-talk= > > and will be ignored. > > > > +*Note 2:* Theme-related =BEAMER_...= keywords will be ignored in the > > +=beamer= class definition in ~org-latex-classes~ defines the Beamer > theme. > > Maybe "Theme-related =BEAMER_...= keywords will be ignored *if* the > =beamer= class definition in ~org-latex-classes~ contains =\usetheme{...}=" > or "contains Beamer theme-related declarations" > > > +(defun org-beamer--insert-theme (header theme-info) > > + "Insert THEME-INFO right after `\\usepackage..{beamer}' in HEADER. > > *documentclass > Right > > +Return the resulting HEADER. > > + > > +If the class is not \"beamer\" or the header contains a theme > declaration, > > +return HEADER unaltered." > > + (save-match-data > > + ;; this is only match beamer... will not do anything for ltx-talk(!) > > + (when (string-match "\\documentclass\\(\\[.+?]\\)?{beamer}\n" > header) > > + (let ((document-class (match-string 0 header))) > > + (unless (string-match-p "\\usetheme\\(\\[.+?]\\)?{[^]]+}\n" > header) > > + (setq header > > + (string-replace document-class > > + (concat document-class theme-info) ;; > theme-info ends with '\n' > > + header)))))) > > + header) > > + > > ... > > + ;; Document class, theme and packages. > > + (org-beamer--insert-theme > > + (org-latex-make-preamble info) > > + (org-beamer--theme-header info)) > > org-latex-make-preamble will create the full preamble, including > #+LATEX_HEADER. So, something like > #+LATEX_HEADER: \usetheme{Madrid} > will also trigger #+BEAMER_... keywords being ignored. > Is it intentional? > I see it as the equivalent of someone defining the theme in org-latex-classes. > -- > 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> > Will fix the nits once we agree. -- 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 *IA: onomatopeya del rebuznar* This was produced by a human (implied virtues and weaknesses acknowledged) I'd hate this being fed to any form of Art. Stup. (aka A alleged-I)...
