emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Darlan Cavalcante Moreira <darcamo@gmail.com>
To: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: [Bug] [Patch] List number start with the latex exporter
Date: Thu, 09 Jun 2011 18:05:35 -0300	[thread overview]
Message-ID: <4df135a5.07b2e60a.443f.2d8e@mx.google.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]



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


[-- Attachment #2: org-list.el.diff --]
[-- Type: text/plain, Size: 483 bytes --]

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{[ ]}")

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



             reply	other threads:[~2011-06-09 21:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 21:05 Darlan Cavalcante Moreira [this message]
2011-06-10 13:52 ` [Bug] [Patch] List number start with the latex exporter Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4df135a5.07b2e60a.443f.2d8e@mx.google.com \
    --to=darcamo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).