"Pedro A. Aranda" <[email protected]> writes:

> Find attached a couple of patches that I'd like you to take a look 
> before applying on main.

Looks good in general.
Although I have a couple of larger-scope comments.

> TINYCHANGE

Nit: The purpose of TINYCHANGE is copyright marking. It is only needed
for commits created by people without copyright assignment.

> +#+vindex: org-latex-src-block-backend
> +#+vindex: org-latex-listings-env
> +#+vindex: org-latex-listings-src-omit-language
> +The =listings= export backend generates LaTeX code for the ~listings~
> +package by default, but is also compatible with the ~fancyvrb~
> +package.  To generate code for the latter, you need to adjust the
> +following variables:
> +
> +#+begin_src emacs-lisp
> +(setq org-latex-listings-env "Verbatim"
> +      org-latex-src-block-backend 'listings
> +      org-latex-listings-src-omit-language t)
> +#+end_src
> +
> +*Note:* if you use ~Verbatim~ to export your source code blocks, add
> +~fancyvrb~ to ~org-latex-packages-alist~, or include:
> +
> +#+BEGIN_SRC org
> +,#+LATEX_HEADER: \usepackage{fancyvrb}
> +#+END_SRC
> +
> +in your document header.

A general thought not for this patch, but for future - if we keep adding
more and more special defaults sensible for ltx-talk, it could make
sense to split it into a separate ox-ltx-talk derived from ox-beamer.
Then, we can have ltx-specific defaults for org-latex-listings-env and similar.

>      (:latex-link-with-unknown-path-format nil nil 
> org-latex-link-with-unknown-path-format)
>      (:latex-src-block-backend nil nil org-latex-src-block-backend)
>      (:latex-listings-langs nil nil org-latex-listings-langs)
> +    (:latex-listings-env nil nil org-latex-listings-env)
>      (:latex-listings-options nil nil org-latex-listings-options)
>      (:latex-listings-src-omit-language nil nil 
> org-latex-listings-src-omit-language)
>      (:latex-minted-langs nil nil org-latex-minted-langs)

I think it would be nice (in the future), to allow some of these
ox-latex options to be settable via in-document keywords.
For example, #+LATEX_LISTINGS_ENV: fancyrb would be very natural.

> +(defcustom org-latex-listings-env "lstlisting"
> +  "The LaTeX environment to use by the listings source code export backend.
> +
> +Set this variable to \"Verbatim\" and add the fancyvrb LaTeX package to your
> +`org-latex-packages-alist' variable, via local variables, customization or in
> +your Emacs init code, for example, with:
> +
> +  (require \\='ox-latex)
> +  (add-to-list \\='org-latex-packages-alist \\='(\"\" \"fancyvrb\"))
> +
> +Note: this is the simplest solution to add code blocks in ltx-talk.
> +"
> +  :group 'org-export-latex
> +  :type '(string :tag "Listings environment")
> +  :safe #'stringp)

Please add :package-version.
Also, I am wondering if we should make the type less generic and only
accept lstlisting and fancyrb.

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