* [Bug] [Patch] List number start with the latex exporter
@ 2011-06-09 21:05 Darlan Cavalcante Moreira
2011-06-10 13:52 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Darlan Cavalcante Moreira @ 2011-06-09 21:05 UTC (permalink / raw)
To: Orgmode Mailing List
[-- 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 --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Bug] [Patch] List number start with the latex exporter
2011-06-09 21:05 [Bug] [Patch] List number start with the latex exporter Darlan Cavalcante Moreira
@ 2011-06-10 13:52 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2011-06-10 13:52 UTC (permalink / raw)
To: Darlan Cavalcante Moreira; +Cc: Orgmode Mailing List
Hello,
Darlan Cavalcante Moreira <darcamo@gmail.com> writes:
> 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.
Thank you! Patch applied.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-10 13:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09 21:05 [Bug] [Patch] List number start with the latex exporter Darlan Cavalcante Moreira
2011-06-10 13:52 ` Nicolas Goaziou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.