mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-15 17:00:45 +00:00
ox-latex: Fix bug with enforced item numbering in mixed lists
* lisp/ox-latex.el (org-latex-item): Fix wrong behaviour when a counter is set in an ordered list while its parent is not ordered. This fixes numbering in the following case: - Unordered. 3. [@3] Ordered. Thanks to Hiroshi Saito for reporting the problem.
This commit is contained in:
parent
8ed99fad6b
commit
f00fd7800f
@ -1632,9 +1632,17 @@ contextual information."
|
||||
(let* ((counter
|
||||
(let ((count (org-element-property :counter item))
|
||||
(level
|
||||
(loop for parent in (org-export-get-genealogy item)
|
||||
count (eq (org-element-type parent) 'plain-list)
|
||||
until (eq (org-element-type parent) 'headline))))
|
||||
;; 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))
|
||||
(incf level)))
|
||||
level)))
|
||||
(and count
|
||||
(< level 5)
|
||||
(format "\\setcounter{enum%s}{%s}\n"
|
||||
|
Loading…
Reference in New Issue
Block a user