|
@@ -2172,25 +2172,27 @@ 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 ((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)
|
|
(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
|