From 88d218a5a085a2c0484141b3b39e1fc2bc8cce44 Mon Sep 17 00:00:00 2001 From: Bastien Date: Wed, 19 Feb 2020 18:10:26 +0100 Subject: [PATCH] Fix 5acf4d4692 --- lisp/ox-latex.el | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 46983bf43..2d6acb13e 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2172,25 +2172,27 @@ contextual information." "Transcode an ITEM element from Org to LaTeX. CONTENTS holds the contents of the item. INFO is a plist holding contextual information." - (let* ((counter - (let ((count (org-element-property :counter item)) - (level - ;; Determine level of current item to determine the - ;; correct LaTeX counter to use (enumi, enumii...). - (let ((parent item) (level 0)) - (while (memq (org-element-type - (setq parent (org-export-get-parent parent))) - '(plain-list item)) - (when (and (eq (org-element-type parent) 'plain-list) - (eq (org-element-property :type parent) - 'ordered)) - (cl-incf level))) - level))) - (and count - (< level 5) - (format "\\setcounter{enum%s}{%s}\n" - (nth (1- level) '("i" "ii" "iii" "iv")) - (1- count))))) + (let* ((orderedp (eq (org-element-property + :type (org-export-get-parent item)) + 'ordered)) + (level + ;; Determine level of current item to determine the + ;; correct LaTeX counter to use (enumi, enumii...). + (let ((parent item) (level 0)) + (while (memq (org-element-type + (setq parent (org-export-get-parent parent))) + '(plain-list item)) + (when (and (eq (org-element-type parent) 'plain-list) + (eq (org-element-property :type parent) + 'ordered)) + (cl-incf level))) + level)) + (count (org-element-property :counter item)) + (counter (and count + (< level 5) + (format "\\setcounter{enum%s}{%s}\n" + (nth (1- level) '("i" "ii" "iii" "iv")) + (1- count)))) (checkbox (cl-case (org-element-property :checkbox item) (on "$\\boxtimes$") (off "$\\square$") @@ -2209,9 +2211,11 @@ contextual information." "\\item" (cond ((and checkbox tag) - (format "{%s %s} %s" checkbox tag tag-footnotes)) + (format (if orderedp "{%s %s} %s" "[{%s %s}] %s") + checkbox tag tag-footnotes)) ((or checkbox tag) - (format "{%s} %s" (or checkbox tag) tag-footnotes)) + (format (if orderedp "{%s} %s" "[{%s}] %s") + (or checkbox tag) tag-footnotes)) ;; Without a tag or a check-box, if CONTENTS starts with ;; an opening square bracket, add "\relax" to "\item", ;; unless the brackets comes from an initial export