From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: [Bug] [Patch] List number start with the latex exporter Date: Thu, 09 Jun 2011 18:05:35 -0300 Message-ID: <4df135a5.07b2e60a.443f.2d8e@mx.google.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Thu_Jun__9_18:05:35_2011-1" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUmQE-0000rC-Pt for emacs-orgmode@gnu.org; Thu, 09 Jun 2011 17:05:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUmQC-0003H8-SN for emacs-orgmode@gnu.org; Thu, 09 Jun 2011 17:05:46 -0400 Received: from mail-vx0-f169.google.com ([209.85.220.169]:32918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUmQC-0003Gn-9w for emacs-orgmode@gnu.org; Thu, 09 Jun 2011 17:05:44 -0400 Received: by vxk20 with SMTP id 20so2036583vxk.0 for ; Thu, 09 Jun 2011 14:05:43 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Orgmode Mailing List --Multipart_Thu_Jun__9_18:05:35_2011-1 Content-Type: text/plain; charset=US-ASCII When using a numbered list it is possible to specify the start number using [@number] so that one can write 1. one 2. two 20. [@20] twenty 21. twenty one This works OK with the HTML exporter, but in the latex exporter the number will be one unity above the desired value. The reason why this happens is because the \item command in 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. A patch is attached for the lisp/org-list.el file. -- Darlan Cavalcante --Multipart_Thu_Jun__9_18:05:35_2011-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="org-list.el.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/org-list.el b/lisp/org-list.el index d72a284..efecaf5 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2947,7 +2947,7 @@ with overruling parameters for `org-list-to-generic'." :icount (let ((enum (nth depth '("i" "ii" "iii" "iv")))) (if enum (format "\\setcounter{enum%s}{%s}\n\\item " - enum counter) + enum (- counter 1)) "\\item ")) :csep "\n" :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}") --Multipart_Thu_Jun__9_18:05:35_2011-1 Content-Type: text/plain; charset=US-ASCII --Multipart_Thu_Jun__9_18:05:35_2011-1--