From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: Issue with HTML export of Org document with a list Date: Tue, 11 Jun 2013 16:49:55 +0900 Message-ID: <20130611074955.GA706@smoon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmJLA-0003IQ-VK for emacs-orgmode@gnu.org; Tue, 11 Jun 2013 03:50:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmJL9-0007BZ-6b for emacs-orgmode@gnu.org; Tue, 11 Jun 2013 03:50:04 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:51038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmJL8-00074g-QI for emacs-orgmode@gnu.org; Tue, 11 Jun 2013 03:50:03 -0400 Received: by mail-lb0-f169.google.com with SMTP id d10so7188165lbj.14 for ; Tue, 11 Jun 2013 00:50:01 -0700 (PDT) Received: from smoon ([141.105.33.55]) by mx.google.com with ESMTPSA id x8sm5750803lae.10.2013.06.11.00.49.57 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 00:49:59 -0700 (PDT) Content-Disposition: inline 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: General discussions about Org-mode --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I faced a strange problem with either my configuration or Org settings. Please consider the attached Org document, ~ex.org~ and it's export to HTML. What I expect (and that used to be earlier): a list with sequential numbers each has source block. Would be glad to provide more information. Thanks in advance. --- WBR, Vladimir Lomov -- Okay ... I'm going home to write the "I HATE RUBIK's CUBE HANDBOOK FOR DEAD CAT LOVERS" ... --tThc/1wpZn/ma/RB Content-Type: application/vnd.lotus-organizer Content-Disposition: attachment; filename="ex.org" Content-Transfer-Encoding: quoted-printable #+TITLE: Example document=0A#+AUTHOR: Vladimir Lomov=0A#+OPTIONS: ^:{}=0A= =0AHello, I faced with a problem when export Org document with a list and= =0Ablock examples within to HTML.=0A1. Let's consider following small initi= alization file for Emacs=0A #+NAME: org-minimal=0A #+BEGIN_SRC emacs-li= sp :tangle min-org.el :padline no=0A(add-to-list 'load-path "/usr/share/ema= cs/site-lisp/org")=0A(require 'org)=0A(require 'ox-html)=0A #+END_SRC=0A = List is written according to guide for lists in manual,=0A which says t= hat all items belong to one list must be indented on=0A the same level. I= nterestingly enough, that even ~M-q~ works wrong=0A on this example: it p= uts beginning of first sentence after block=0A on the same line as ~END_S= RC~.=0A2. The Emacs is started by following command in terminal=0A #+NAME= : emacs-run=0A #+BEGIN_SRC sh=0Aemacs -Q -l min-org.el=0A #+END_SRC=0A = Here ~min-org.el~ file is the one tangled from previous source block.=0A3= =2E To demonstrate the problem it is enough to export to HTML this=0A doc= ument and to see the result. For example, let's take a look on=0A this so= urce block=0A#+NAME: cdlatex-nw=0A#+BEGIN_SRC emacs-lisp :noweb yes=0A<>=0A(add-to-list 'load-path "~/.emacs.d/mode")=0A#+END_SRC=0A I = have ~cdlatex.el~ file in =3D~/.emacs.d/mode=3D.=0A4. While one have to ind= ent ~BEGIN|END~ of source block as it is=0A requirement for lists, it is = unnecessary to indent they content.=0A Moreover it would be wrong because= tangled code will be indented=0A too and it is may be undesired. Let's s= ee another example of source=0A block=0A#+NAME: cdlatex-wv=0A#+BEGIN_SRC = emacs-lisp :tangle org-cdlatex.el :noweb yes :padline no=0A<>= =0A(add-to-list 'load-path "/usr/share/emacs/site-lisp/auctex")=0A(add-to-l= ist 'load-path "~/.emacs.d/mode")=0A#+END_SRC=0A But something is fundame= ntally broken, either on my side or with=0A Org settings.=0A5. Because ev= ery item with a source block which content is not=0A indented (as it shou= ld be) will break the list and any following=0A item (considered as seque= ntial item in one list) will be=0A interpreted as *new* list. To finish w= ith list let's show once=0A again minimal example of Emacs initialization= for Org mode with=0A cdlatex=0A #+NAME: org-cdlatex-minimal=0A #+BEG= IN_SRC emacs-lisp :tangle min-org-cdlatex.el :noweb yes :padline no=0A <<= org-minimal>>=0A(add-to-list 'load-path "/usr/share/emacs/site-lisp/auctex"= )=0A (add-to-list 'load-path "~/.emacs.d/mode")=0A #+END_SRC=0A Is th= is the last sentence of last item of the one list of the document?=0A=0AHow= ever, lists without source blocks works fine=0A1. First. First. First. Firs= t. First. First. First. First. First.=0A First. First. First. First. Firs= t. First. First. First. First.=0A First. First. First. First. First. Firs= t. First. First. First.=0A First. First. First. First. First.=0A2. Second= , Second, Second, Second, Second, Second, Second, Second,=0A Second, Seco= nd, Second, Second, Second, Second, Second, Second,=0A3. Third. Third. Thir= d. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Th= ird. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. = Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third= =2E Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. T= hird. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third.= Third. Third. Third. Third. Third. Third. Third. Third.=0A=0AAnother probl= em (?). First and third entries of above list isn't=0Areformatted by ~M-q~.= =0A=0A#+BEGIN_QUOTE=0AOrg-mode version 8.0.3 (release_8.0.3-225-g8e9c10 @ /= usr/share/emacs/site-lisp/org/)=0A#+END_QUOTE=0A --tThc/1wpZn/ma/RB Content-Type: text/html; charset=utf-8 Content-Disposition: attachment; filename="ex.html" Content-Transfer-Encoding: 8bit Example document

Example document

Hello, I faced with a problem when export Org document with a list and block examples within to HTML.

  1. Let's consider following small initialization file for Emacs

    #+BEGIN_SRC emacs-lisp :tangle min-org.el :padline no

(add-to-list 'load-path "/usr/share/emacs/site-lisp/org") (require 'org) (require 'ox-html)

#+END_SRC List is written according to guide for lists in manual, which says that all items belong to one list must be indented on the same level. Interestingly enough, that even M-q works wrong on this example: it puts beginning of first sentence after block on the same line as END_SRC.

  1. The Emacs is started by following command in terminal

    #+BEGIN_SRC sh

emacs -Q -l min-org.el

#+END_SRC Here min-org.el file is the one tangled from previous source block.

  1. To demonstrate the problem it is enough to export to HTML this document and to see the result. For example, let's take a look on this source block
(add-to-list 'load-path "/usr/share/emacs/site-lisp/org")
(require 'org)
(require 'ox-html)
(add-to-list 'load-path "~/.emacs.d/mode")

I have cdlatex.el file in ~/.emacs.d/mode.

  1. While one have to indent BEGIN|END of source block as it is requirement for lists, it is unnecessary to indent they content. Moreover it would be wrong because tangled code will be indented too and it is may be undesired. Let's see another example of source block
(add-to-list 'load-path "/usr/share/emacs/site-lisp/org")
(require 'org)
(require 'ox-html)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/auctex")
(add-to-list 'load-path "~/.emacs.d/mode")

But something is fundamentally broken, either on my side or with Org settings.

  1. Because every item with a source block which content is not indented (as it should be) will break the list and any following item (considered as sequential item in one list) will be interpreted as new list. To finish with list let's show once again minimal example of Emacs initialization for Org mode with cdlatex

    #+BEGIN_SRC emacs-lisp :tangle min-org-cdlatex.el :noweb yes :padline no

(add-to-list 'load-path "usr/share/emacs/site-lisp/auctex") (add-to-list 'load-path "~.emacs.d/mode")

#+END_SRC Is this the last sentence of last item of the one list of the document?

However, lists without source blocks works fine

  1. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First. First.
  2. Second, Second, Second, Second, Second, Second, Second, Second, Second, Second, Second, Second, Second, Second, Second, Second,
  3. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third. Third.

Another problem (?). First and third entries of above list isn't reformatted by M-q.

Org-mode version 8.0.3 (release_8.0.3-225-g8e9c10 @ usr/share/emacs/site-lisp/org)

Author: Vladimir Lomov

Created: 2013-06-11 Вт 16:41

Emacs 24.3.50.1 (Org mode 8.0.3)

Validate

--tThc/1wpZn/ma/RB--