Pedro Andres Aranda Gutierrez <paag...@gmail.com> writes:

> A new version of the patch, including a test for the new
> #+BEAMER_CLASS_OPTIONS

Thanks!
I have no objections to adding a new keyword.
See my comments inline on the patch itself.

> Subject: [PATCH] New BEAMER_CLASS_OPTIONS
>
> * lisp/ox-beamer.el: Add #+BEAMER_CLASS_OPTIONS
> (org-beamer-template) replace the class options with the
> #+BEAMER_CLASS_OPTIONS, if defined.
> * testing/lisp/test-ox-beamer.el: Add test for new
> #+BEAMER_CLASS_OPTIONS
> * doc/org-manual.org: Add entry explaining new
> #+BEAMER_CLASS_OPTIONS

May you please follow the commit message conventions as described in
https://orgmode.org/worg/org-contribute.html#commit-messages ?

> +- =BEAMER_CLASS_OPTIONS= ::
> +
> +  #+cindex: @samp{BEAMER_CLASS_OPTIONS}, keyword
> +
> +  The options to pass to the beamer class. It is the equivalent
> +  to ~LATEX_CLASS_OPTIONS~ in the LaTeX exporter.  For example:

We generally use =...= markup when referring to Org markup verbatim.
Please check doc/Documentation_Standards.org file.

> +*** New keyword ~#+BEAMER_CLASS_OPTIONS:~
> +
> +~#+BEAMER_CLASS_OPTIONS~ is a equivalent to ~#+LATEX_CLASS_OPTIONS~ for

Same here =...=.

>    '((:headline-levels nil "H" org-beamer-frame-level)
>      (:latex-class "LATEX_CLASS" nil "beamer" t)
> +    (:beamer-class-options "BEAMER_CLASS_OPTIONS" nil "[presentation]" t)

I think that it will be much simpler to override :latex-class-options
as we do for :latex-class
   (:latex-class-options "BEAMER_CLASS_OPTIONS" nil "[presentation]" t)

>       ;; Document class and packages.
> -     (org-latex-make-preamble info)
> +     (let* ((preamble  (org-latex-make-preamble info))
> +            (beamer-class-options (plist-get info :beamer-class-options)))
> +       (if beamer-class-options
> +           ;; modify the documentclass only
> +           (replace-regexp-in-string "class\\[[^]]+\\]"
> +                                     (concat "class " beamer-class-options)
> +                                     preamble)
> +       preamble))

If we override :latex-class-options, there will be no need to change
anything here. 

> +(ert-deftest ox-beamer/beamer-class-options ()
> +  "Test that #+BEAMER_CLASS_OPTIONS is used."
> +  (org-test-with-exported-text
> +   'beamer
> +   "#+OPTIONS: toc:nil
> +#+BEAMER_CLASS_OPTIONS: [12pt,t]
> +
> +* A frame
> +- Hola
> +"
> +   (goto-char (point-min))
> +   (should (search-forward "\\documentclass [12pt,t]{beamer}"))))

I am wondering why you added space after documentclass.

-- 
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>

Reply via email to