فهرست منبع

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 سال پیش
والد
کامیت
889a487ae4
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  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{[ ]}")