Browse Source

org-list: fix item's start number in LaTeX exporter

* lisp/org-list.el (org-list-to-latex): the enumerate environment in
latex increments the counter before using it. Therefore, org-mode
should set the enumeration counter to the desired value minus one.

Patch from Darlan Cavalcante Moreira
TINYCHANGE
Nicolas Goaziou 14 years ago
parent
commit
889a487ae4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lisp/org-list.el

+ 4 - 1
lisp/org-list.el

@@ -2946,8 +2946,11 @@ with overruling parameters for `org-list-to-generic'."
 	       :istart "\\item " :iend "\n"
 	       :icount (let ((enum (nth depth '("i" "ii" "iii" "iv"))))
 			 (if enum
+			     ;; LaTeX increments counter just before
+			     ;; using it, so set it to the desired
+			     ;; value, minus one.
 			     (format "\\setcounter{enum%s}{%s}\n\\item "
-				     enum counter)
+				     enum (1- counter))
 			   "\\item "))
 	       :csep "\n"
 	       :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}")