emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX export of lists
@ 2010-11-28 14:33 Thomas S. Dye
  2010-11-28 15:05 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2010-11-28 14:33 UTC (permalink / raw)
  To: tsd; +Cc: emacs mailing list

Aloha all,

The solution to my earlier query is this:

* List
  1. First item
  2. Second item Following text.

This works for lists set in a paragraph, but won't work for lists set  
out by themselves.  Richard's \noindent will work in these situations,  
but I'm wondering why the empty line is there in the first place?

All the best,
Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: LaTeX export of lists
  2010-11-28 14:33 LaTeX export of lists Thomas S. Dye
@ 2010-11-28 15:05 ` Nicolas Goaziou
  2010-11-28 15:54   ` [patch] " Nicolas Goaziou
  2010-11-28 18:40   ` Thomas S. Dye
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2010-11-28 15:05 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs mailing list

Hello,

>>>>> Thomas S Dye writes:

> * List
>   1. First item
>   2. Second item Following text.

This is completely different from your first example. Here "Following
text" is inside the list, whereas before, it was outside.

> This works for lists set in a paragraph, but won't work for lists
> set out by themselves. Richard's \noindent will work in these
> situations, but I'm wondering why the empty line is there in the
> first place?

I don't know, I am going to investigate this.

Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] LaTeX export of lists
  2010-11-28 15:05 ` Nicolas Goaziou
@ 2010-11-28 15:54   ` Nicolas Goaziou
  2010-11-28 19:02     ` Thomas S. Dye
  2010-11-28 18:40   ` Thomas S. Dye
  1 sibling, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-11-28 15:54 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs mailing list

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

Thomas,

Could you please test this patch and tell me if it breaks something?

Regards,

-- Nicolas


[-- Attachment #2: 0001-Exporting-lists-to-LaTeX-respects-blank-lines.patch --]
[-- Type: text/plain, Size: 1548 bytes --]

From 8fdd9ff682306cc5161f0b230d43493abff1d5e2 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Sun, 28 Nov 2010 16:51:14 +0100
Subject: [PATCH] Exporting lists to LaTeX respects blank lines

* lisp/org-latex.el (org-export-latex-lists): do not add an
  unnecessary newline character after a list.
* lisp/org-list.el (org-list-bottom-point-with-indent): ensure bottom
  point is just after a non blank line.
---
 lisp/org-latex.el |    2 +-
 lisp/org-list.el  |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 91bf380..1a0aaf7 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -2383,7 +2383,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 			   "\n"
 			   (match-string 1 res))
 		   t t res)))
-      (insert res "\n"))))
+      (insert res))))
 
 (defconst org-latex-entities
  '("\\!"
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 2290b4a..07a15e4 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -518,7 +518,11 @@ List ending is determined by the indentation of text. See
 	      (setq ind-ref ind)
 	      (forward-line 1))
 	     ((<= ind ind-ref)
-	      (throw 'exit (point-at-bol)))
+	      (throw 'exit (progn
+			     ;; Ensure bottom is just after a
+			     ;; non-blank line.
+			     (skip-chars-backward " \r\t\n")
+			     (min (point-max) (1+ (point-at-eol))))))
 	     ((looking-at "#\\+begin_")
 	      (re-search-forward "[ \t]*#\\+end_")
 	      (forward-line 1))
-- 
1.7.3.2


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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: LaTeX export of lists
  2010-11-28 15:05 ` Nicolas Goaziou
  2010-11-28 15:54   ` [patch] " Nicolas Goaziou
@ 2010-11-28 18:40   ` Thomas S. Dye
  2010-11-29  8:43     ` Sébastien Mengin
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2010-11-28 18:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs mailing list

Aloha Nicolas,
On Nov 28, 2010, at 5:05 AM, Nicolas Goaziou wrote:

> Hello,
>
>>>>>> Thomas S Dye writes:
>
>> * List
>>  1. First item
>>  2. Second item Following text.
>
> This is completely different from your first example. Here "Following
> text" is inside the list, whereas before, it was outside.
>
>> This works for lists set in a paragraph, but won't work for lists
>> set out by themselves. Richard's \noindent will work in these
>> situations, but I'm wondering why the empty line is there in the
>> first place?
>
> I don't know, I am going to investigate this.

Thanks for looking into this.  The desired org-mode example and  
exported result is this:

* List
   1. First item
   2. Second item
Following text

\section{List}
\label{sec-1}

\begin{enumerate}
\item First item
\item Second item
\end{enumerate}
Following text

This way, the decision to typeset the list in-paragraph or displayed  
with following non-indented text can be made by the LaTeX class file.

This means that

* List
   1. First item
   2. Second item

Following text

should export as:

\section{List}
\label{sec-1}

\begin{enumerate}
\item First item
\item Second item
\end{enumerate}

Following text

All the best,
Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] LaTeX export of lists
  2010-11-28 15:54   ` [patch] " Nicolas Goaziou
@ 2010-11-28 19:02     ` Thomas S. Dye
  2010-11-28 21:15       ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2010-11-28 19:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs mailing list

Aloha Nicolas,
On Nov 28, 2010, at 5:54 AM, Nicolas Goaziou wrote:

> Thomas,
>
> Could you please test this patch and tell me if it breaks something?
>
> Regards,
>
> -- Nicolas
>
> <0001-Exporting-lists-to-LaTeX-respects-blank-lines.patch>

This works perfectly for me.  Thanks!

All the best,
Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] LaTeX export of lists
  2010-11-28 19:02     ` Thomas S. Dye
@ 2010-11-28 21:15       ` Nicolas Goaziou
  2010-11-29  8:42         ` Sébastien Mengin
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-11-28 21:15 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs mailing list


> This works perfectly for me. Thanks!

It is available on master branch now.

Thanks for pointing out this little annoyance.

Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: [patch] LaTeX export of lists
  2010-11-28 21:15       ` Nicolas Goaziou
@ 2010-11-29  8:42         ` Sébastien Mengin
  2010-11-29 12:17           ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Sébastien Mengin @ 2010-11-29  8:42 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs mailing list

Le dim. 28/11/10 (10:15:34 +0100), Nicolas Goaziou a écrit :
> 
> > This works perfectly for me. Thanks!
> 
> It is available on master branch now.
> 
> Thanks for pointing out this little annoyance.

Sorry I come too late but I would not like this kind of "annoyance"
avoided ;)

In Thomas' case, it is perfectly understandable, true.

But in general, I find it a lot better to leave a blank line between the
end of a list and the following paragraph in the LaTeX code -- easier to
read, I think.

Can your patch be set as an option or so, instead of the default
behaviour?

Thanks anyway,

-- 
Sébastien Mengin
Édition et logiciels libres
< Mise en page avec LaTeX >
http://edilibre.net
tél. : 06 84 88 49 17
jid. : sebastien-mengin@jabber.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: LaTeX export of lists
  2010-11-28 18:40   ` Thomas S. Dye
@ 2010-11-29  8:43     ` Sébastien Mengin
  0 siblings, 0 replies; 9+ messages in thread
From: Sébastien Mengin @ 2010-11-29  8:43 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs mailing list, Nicolas Goaziou

Hi,

Forget my previous post, I didn't see this last one by Thomas.

Seems sensible, indeed.

Cheers,
S.

Le dim. 28/11/10 (08:40:58 -1000), Thomas S. Dye a écrit :
> Aloha Nicolas,
> On Nov 28, 2010, at 5:05 AM, Nicolas Goaziou wrote:
> 
> >Hello,
> >
> >>>>>>Thomas S Dye writes:
> >
> >>* List
> >> 1. First item
> >> 2. Second item Following text.
> >
> >This is completely different from your first example. Here "Following
> >text" is inside the list, whereas before, it was outside.
> >
> >>This works for lists set in a paragraph, but won't work for lists
> >>set out by themselves. Richard's \noindent will work in these
> >>situations, but I'm wondering why the empty line is there in the
> >>first place?
> >
> >I don't know, I am going to investigate this.
> 
> Thanks for looking into this.  The desired org-mode example and
> exported result is this:
> 
> * List
>   1. First item
>   2. Second item
> Following text
> 
> \section{List}
> \label{sec-1}
> 
> \begin{enumerate}
> \item First item
> \item Second item
> \end{enumerate}
> Following text
> 
> This way, the decision to typeset the list in-paragraph or displayed
> with following non-indented text can be made by the LaTeX class
> file.
> 
> This means that
> 
> * List
>   1. First item
>   2. Second item
> 
> Following text
> 
> should export as:
> 
> \section{List}
> \label{sec-1}
> 
> \begin{enumerate}
> \item First item
> \item Second item
> \end{enumerate}
> 
> Following text
> 
> All the best,
> Tom
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

-- 
Sébastien Mengin
Édition et logiciels libres
< Mise en page avec LaTeX >
http://edilibre.net
tél. : 06 84 88 49 17
jid. : sebastien-mengin@jabber.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: [patch] LaTeX export of lists
  2010-11-29  8:42         ` Sébastien Mengin
@ 2010-11-29 12:17           ` Nicolas Goaziou
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2010-11-29 12:17 UTC (permalink / raw)
  To: Sébastien Mengin; +Cc: emacs mailing list

Hello,

>>>>> Sébastien Mengin writes:

> Sorry I come too late but I would not like this kind of "annoyance"
> avoided ;)

> In Thomas' case, it is perfectly understandable, true.

> But in general, I find it a lot better to leave a blank line between
> the end of a list and the following paragraph in the LaTeX code --
> easier to read, I think.

> Can your patch be set as an option or so, instead of the default
> behaviour?

You just need to leave a blank line between your list and the next
paragraph. I don't see why an option should be needed here.

Or am I wrong?

Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-11-29 12:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-28 14:33 LaTeX export of lists Thomas S. Dye
2010-11-28 15:05 ` Nicolas Goaziou
2010-11-28 15:54   ` [patch] " Nicolas Goaziou
2010-11-28 19:02     ` Thomas S. Dye
2010-11-28 21:15       ` Nicolas Goaziou
2010-11-29  8:42         ` Sébastien Mengin
2010-11-29 12:17           ` Nicolas Goaziou
2010-11-28 18:40   ` Thomas S. Dye
2010-11-29  8:43     ` Sébastien Mengin

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).