This commit is contained in:
Bastien 2020-02-19 18:10:26 +01:00
parent 10607d45ae
commit 88d218a5a0
1 changed files with 25 additions and 21 deletions

View File

@ -2172,8 +2172,9 @@ contextual information."
"Transcode an ITEM element from Org to LaTeX. "Transcode an ITEM element from Org to LaTeX.
CONTENTS holds the contents of the item. INFO is a plist holding CONTENTS holds the contents of the item. INFO is a plist holding
contextual information." contextual information."
(let* ((counter (let* ((orderedp (eq (org-element-property
(let ((count (org-element-property :counter item)) :type (org-export-get-parent item))
'ordered))
(level (level
;; Determine level of current item to determine the ;; Determine level of current item to determine the
;; correct LaTeX counter to use (enumi, enumii...). ;; correct LaTeX counter to use (enumi, enumii...).
@ -2185,12 +2186,13 @@ contextual information."
(eq (org-element-property :type parent) (eq (org-element-property :type parent)
'ordered)) 'ordered))
(cl-incf level))) (cl-incf level)))
level))) level))
(and count (count (org-element-property :counter item))
(counter (and count
(< level 5) (< level 5)
(format "\\setcounter{enum%s}{%s}\n" (format "\\setcounter{enum%s}{%s}\n"
(nth (1- level) '("i" "ii" "iii" "iv")) (nth (1- level) '("i" "ii" "iii" "iv"))
(1- count))))) (1- count))))
(checkbox (cl-case (org-element-property :checkbox item) (checkbox (cl-case (org-element-property :checkbox item)
(on "$\\boxtimes$") (on "$\\boxtimes$")
(off "$\\square$") (off "$\\square$")
@ -2209,9 +2211,11 @@ contextual information."
"\\item" "\\item"
(cond (cond
((and checkbox tag) ((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) ((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 ;; Without a tag or a check-box, if CONTENTS starts with
;; an opening square bracket, add "\relax" to "\item", ;; an opening square bracket, add "\relax" to "\item",
;; unless the brackets comes from an initial export ;; unless the brackets comes from an initial export