emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in export to LaTex: Lists with source code blocks
@ 2011-10-25 11:32 Thomas Holst
  2012-01-31  7:10 ` [bug]Bug " Boyun Tang
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Holst @ 2011-10-25 11:32 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

there is a bug when exporting to LaTeX if there is a source code block
inside a list.

I have a file with the following contents:

#+begin_org
  #+TITLE:     Lists mit Source-Blocks
  #+AUTHOR:    thomas.holst@gmx.de
  #+EMAIL:     Thomas Holst
  #+DATE:      25.10.2011
  #+LANGUAGE:  en
  #+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t <:t
  #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
  #+EXPORT_SELECT_TAGS: export
  #+EXPORT_EXCLUDE_TAGS: noexport

  * A heading
  1. First Item
     #+begin_src perl
       print "First example:\n";
     #+end_src
     Text in first item.
  2. Second Item
     #+begin_src perl
       print "Second example:\n";
     #+end_src
     Text in second item.
#+end_org

The exportet LaTeX file contains the following:

#+begin_src latex
  % [ ... snip ... ]
  \begin{document}

  % [ ... snip ... ]
  
  \begin{enumerate}
  \item First Item
  
  \lstset{language=Perl}
  \begin{lstlisting}
  print "First example:\n";
  \end{lstlisting}
  \end{enumerate}
  %^^^^^^^^^^^^^^
       Text in first item.
  \begin{enumerate}
  %^^^^^^^^^^^^^^^^
  \item Second Item
  
  \lstset{language=Perl}
  \begin{lstlisting}
  print "Second example:\n";
  \end{lstlisting}
  \end{enumerate}
  %^^^^^^^^^^^^^^
       Text in second item.
  ORG-LIST-END-MARKER
  %^^^^^^^^^^^^^^^^^^
  \end{document}
#+end_src

The enumerate environment is ended after the source code block and
started before the next item again. There is a line saying
'ORG-LIST-END-MARKER' which should not be there. I marked the
relevant lines with comments.

This happens with:

(emacs-version)
"GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-19 on 3249CTO" on WinXP

(org-version)
"Org-mode version 7.7 (release_7.7.396.gfaaa)"

Tested with a minimal setup file:

#+begin_src emacs-lisp
  ;; -----------------------------------------------------------------------------
  ;; set path to local org repo
  ;; -----------------------------------------------------------------------------
  (add-to-list 'load-path "~/git/org-mode/lisp")
  ;; pfad zu contib/lisp
  (add-to-list 'load-path "~/git/org-mode/contrib/lisp")
  (add-to-list 'load-path "~/git/org-mode/contrib/babel/lisp")

  (require 'org-install)
  (require 'org-latex)
  (find-file "~/emacs/Testing/ListsSCB.org")
  (org-export-as-latex-to-buffer 3)
#+end_src

: emacs -Q --eval "(load-file \"~/emacs/Testing/start-exp-test.el\")"

In "Org-mode version 7.7 (release_7.7)" the bug does not exist.

'git bisect' showed that the bug was introduced by:

commit 707897c25c8f2412a31d5f47bc2c201c5bcf8d1d
Author: Nick Dokos <nick@dokosmarshall.org>
Date:   Fri Aug 19 05:02:57 2011 -0400

    Eliminate extra newline(s) after example or src block.
    
    Signed-off-by: Nick Dokos <nick@dokosmarshall.org>

-- 
Bis neulich ...
  Thomas

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

* [bug]Bug in export to LaTex: Lists with source code blocks
  2011-10-25 11:32 Bug in export to LaTex: Lists with source code blocks Thomas Holst
@ 2012-01-31  7:10 ` Boyun Tang
  2012-01-31 19:33   ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Boyun Tang @ 2012-01-31  7:10 UTC (permalink / raw)
  To: emacs-orgmode

Hello,
Today I found a bug which was well described in 
http://thread.gmane.org/gmane.emacs.orgmode/48388
is still there.

(emacs-version)
GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.8)
(org-version)
Org-mode version 7.8.03

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

* Re: [bug]Bug in export to LaTex: Lists with source code blocks
  2012-01-31  7:10 ` [bug]Bug " Boyun Tang
@ 2012-01-31 19:33   ` Nicolas Goaziou
  2012-02-03 11:27     ` Thomas Holst
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2012-01-31 19:33 UTC (permalink / raw)
  To: Boyun Tang; +Cc: emacs-orgmode

Hello,

Boyun Tang <tangboyun@hotmail.com> writes:

> Hello,
> Today I found a bug which was well described in 
> http://thread.gmane.org/gmane.emacs.orgmode/48388

I have pushed a fix for that bug.

Thank you for reminding me about it, and to Thomas Holst for reporting
it in the first place.


Regards,

-- 
Nicolas Goaziou

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

* Re: [bug]Bug in export to LaTex: Lists with source code blocks
  2012-01-31 19:33   ` Nicolas Goaziou
@ 2012-02-03 11:27     ` Thomas Holst
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Holst @ 2012-02-03 11:27 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

· Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Boyun Tang <tangboyun@hotmail.com> writes:
>
>> Hello,
>> Today I found a bug which was well described in 
>> http://thread.gmane.org/gmane.emacs.orgmode/48388
>
> I have pushed a fix for that bug.
>
> Thank you for reminding me about it, and to Thomas Holst for reporting
> it in the first place.
>
> Regards,

only today I had a chance to test the fix. Works like a charm. Thanks a
lot to Nicolas and to Boyun Tang for giving this thred a kick.

-- 
Mit freundlichen Grüßen / Best regards 

Thomas Holst 

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

end of thread, other threads:[~2012-02-03 11:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-25 11:32 Bug in export to LaTex: Lists with source code blocks Thomas Holst
2012-01-31  7:10 ` [bug]Bug " Boyun Tang
2012-01-31 19:33   ` Nicolas Goaziou
2012-02-03 11:27     ` Thomas Holst

Code repositories for project(s) associated with this 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).