Pedro Andres Aranda Gutierrez <[email protected]> writes: > Yet another small patch to make the LaTeX more flexible. > Allow the example block environment to use something different that > 'verbatim'.
Thanks. Could you please rebase the patch onto the latest main? > Subject: [PATCH] ox-latex: Add ~org-latex-default-example-environment~. No need to use Org markup in the commit message. Just use `quote' or 'quote'. > Add custom variable to set the LaTeX environment for example blocks. > * lisp/ox-latex.el: (org-latex-default-example-environment) new custom > variable. *New (capitalize) > (org-latex-example-block): Use variable instead of literal string. > * testing/lisp/test-ox-latex.el: new *New > test (test-ox-latex/latex-default-example-with-options) > * etc/ORG-NEWS: Announce *Announce. (dot at the end of sentence) > +Additionally, you can set the environment used in example blocks with > +custom variable ~org-latex-default-example-environment~. The default > +value is ~"verbatim"~, but setting it ~"Verbatim"~ would allow you to > +write the previous example as: > + > +#+begin_example > +,#+ATTR_LATEX: :options [fontsize=\footnotesize] > +,#+BEGIN_EXAMPLE > + This sentence is false. > +,#+END_EXAMPLE > +#+end_example > + > +In this case, it is recommended to add ~fancyvrb~ to the LaTeX > +packages imported by your document. I feel like this section of the manual if getting too verbose. Maybe we can collapse the the examples together? > +(defcustom org-latex-default-example-environment "verbatim" > + "Default environment used in `example' blocks." > + :group 'org-export-latex > + :package-version '(Org . "9.5") *10.0 -- 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>
