OK, done (hopefully.) best, /PA
On Mon, 27 Apr 2026 at 08:41, Pedro Andres Aranda Gutierrez < [email protected]> wrote: > Good point. I’ll add a user option and consolidate.. > > Best, /PA > > > El 26 abr 2026, a las 19:30, Ihor Radchenko <[email protected]> > escribió: > > > > Pedro Andres Aranda Gutierrez <[email protected]> writes: > > > >> Rationale behind this is: > >> 1.- that I don’t see other environments being used > >> 2.- three choices is better than one hard-coded default. > >> 3.- Adding a ‘free style’ may introduce more doubts than solve issues. > > > > I am not sure if closed list of options is flexible enough. > > Org users sometimes use weird setups. > > For example, could someone need trivlist there? > > > https://tex.stackexchange.com/questions/47204/definitive-guide-to-trivlists#47217 > > > >> PS: Any action on my side? > > > > You can consolidate the patches to apply more easily. > > Then, I will leave it to Derek to provide more comments or mark the > > patch as reviewed. > > > > -- > > 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
From 5ba0880df90312f50bf43890cdca48c3b2419c72 Mon Sep 17 00:00:00 2001 From: "Pedro A. Aranda" <[email protected]> Date: Mon, 27 Apr 2026 16:34:07 +0200 Subject: [PATCH] ox-latex.el: New variable org-latex-descriptive-environment lisp/ox-latex.el: (org-latex-descriptive-environment): New custom variable with options for the custom interface. (org-latex-plain-list): use it instead of the hard-coded value. doc/org-manual.doc: Document `org-latex-descriptive-environment`. etc/ORG-NEWS: Announce `org-latex-descriptive-environment`. testing/lisp/test-ox-latex.el: (test-ox-latex/change-descriptive-environment) New test for the descriptive environment. --- doc/org-manual.org | 23 +++++++++++++++++++++++ etc/ORG-NEWS | 7 +++++++ lisp/ox-latex.el | 21 +++++++++++++++++++-- testing/lisp/test-ox-latex.el | 15 +++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index baa1127a0..eb36bde07 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -14723,6 +14723,29 @@ four: - Five #+end_example +*** Description lists in LaTeX export +#+cindex: description lists, in @LaTeX{} export +#+vindex: org-latex-descriptive-environment + +Description lists are exported using the LaTeX environment +~description~ by default. You can change it setting custom variable +~org-latex-descriptive-environment~. You may need to do so, if you +mix plain list items with descriptive items like in: + +#+begin_src org +- Note :: this is a list of things I need +- Water +- Sleep +- Silence +#+end_src + +To use environment ~itemize~ in this case, add this to your +configuration + +#+begin_src emacs-lisp +(setq-default org-latex-descriptive-environment "itemize") +#+end_src + *** Source blocks in LaTeX export :PROPERTIES: :DESCRIPTION: Attributes specific to source code blocks. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 93c108690..6a8ee23eb 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -195,6 +195,13 @@ addition to being added to a data attribute, ~data-linenr~, on that highlight and copy/paste multiple lines from a code block without having the line numbers included. +*** New custom variable ~org-latex-descriptive-environment~ + +~org-latex-descriptive-environment~ allows you to use custom +environment for descriptive lists when exporting to LaTeX. +Use it when the default ~description~ environment does not fit your +needs. The recommended alternative value is ~itemize~. + ** New functions and changes in function arguments # This also includes changes in function behavior from Elisp perspective. diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index a54ac5a3b..a2a52f275 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -884,6 +884,24 @@ When nil, no transformation is made." (string :tag "Format string") (const :tag "No formatting" nil))) +;;;; Lists + +(defcustom org-latex-descriptive-environment "description" + "The environment to use for lists tagged as descriptive. + +Set this variable if using + - tag :: +upsets the typesetting of a list." + :group 'org-export-latex + :package-version '(Org . "10.0") + :type '(choice + (const :tag "description (default)" "description") + (const :tag "itemize" "itemize") + (const :tag "enumerate" "enumerate") + (string :tag "User defined")) + :safe #'stringp) + + ;;;; Text markup (defcustom org-latex-text-markup-alist '((bold . "\\textbf{%s}") @@ -2160,7 +2178,6 @@ holding export options." ;; Document end. "\\end{document}"))) - ;;; Transcode Functions @@ -3220,7 +3237,7 @@ contextual information." (latex-type (let ((env (plist-get attr :environment))) (cond (env (format "%s" env)) ((eq type 'ordered) "enumerate") - ((eq type 'descriptive) "description") + ((eq type 'descriptive) org-latex-descriptive-environment) (t "itemize"))))) (org-latex--wrap-label plain-list diff --git a/testing/lisp/test-ox-latex.el b/testing/lisp/test-ox-latex.el index 7db371d31..0664a2478 100644 --- a/testing/lisp/test-ox-latex.el +++ b/testing/lisp/test-ox-latex.el @@ -486,5 +486,20 @@ How do you do? (goto-char (point-min)) (should (search-forward "\\framebox{\\#C}")))) +(ert-deftest test-ox-latex/change-descriptive-environment () + "Test numeric priorities in headlines." + (let ((org-latex-descriptive-environment "itemize")) + (org-test-with-exported-text + 'latex + "* Acronyms +- SDN :: Software Defined Networks +" + (goto-char (point-min)) + (should (search-forward "\\section{Acronyms}")) + (should (search-forward "\\begin{itemize} +\\item[{SDN}] Software Defined Networks +\\end{itemize} +"))))) + (provide 'test-ox-latex) ;;; test-ox-latex.el ends here -- 2.43.0
