From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lixin Chin Subject: Re: Bug: Unable to nest headings within export blocks [9.0 (9.0-elpa @ c:/Data/Documents/emacs.d/elpa/org-20161102/)] Date: Mon, 7 Nov 2016 10:47:08 +0800 Message-ID: <3cb1d470-fb7b-adde-70ca-d34a3ec9c717@gmail.com> References: <338ea338-093e-6323-083e-ac8732c44778@gmail.com> <878tsybcg7.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3a7J-0000jR-3T for emacs-orgmode@gnu.org; Sun, 06 Nov 2016 21:57:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3a7F-0005qu-7f for emacs-orgmode@gnu.org; Sun, 06 Nov 2016 21:57:01 -0500 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]:35811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c3a7F-0005pA-1h for emacs-orgmode@gnu.org; Sun, 06 Nov 2016 21:56:57 -0500 Received: by mail-pf0-x22c.google.com with SMTP id i88so82967905pfk.2 for ; Sun, 06 Nov 2016 18:56:55 -0800 (PST) Received: from [130.95.197.213] ([130.95.197.213]) by smtp.gmail.com with ESMTPSA id s3sm35590203pfe.27.2016.11.06.18.47.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Nov 2016 18:47:11 -0800 (PST) In-Reply-To: <878tsybcg7.fsf@nicolasgoaziou.fr> 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" To: emacs-orgmode@gnu.org Hi, Thanks, yes that almost works. Unfortunately the heading line is just reproduced verbatim in the output, whereas ideally it should be parsed as a normal heading. I.e., currently: #+BEGIN_EXPORT html ,* HTML only heading Text which should appear in HTML exports, but not \LaTeX{}. #+END_EXPORT Exports as:
* HTML only heading Text which should appear in HTML exports, but not \LaTeX{}.
Whereas ideally I'd like to be able to input: #+BEGIN_EXPORT html * HTML only heading Text which should appear in HTML exports, but not \LaTeX{}. #+END_EXPORT that would export as:

2 HTML only heading

Text which should appear in HTML exports, but not \LaTeX{}.

I'm not sure how difficult this would be to add to org-mode. It seems that currently everything within a #+BEGIN_EXPORT ... #+END_EXPORT block, or included using #+INCLUDE: export is just treated as verbatim text to be include in the output, and bypasses much of the org-mode parsing. Regards, Lixin On 05/11/2016 03:41 PM, Nicolas Goaziou wrote: > Hello, > > Lixin Chin writes: > >> As per the subject, when a heading line is included within a >> `#+BEGIN_EXPORT backend ... #+END_EXPORT' block, it breaks the parsing >> of the block, which is instead split into multiple `paragraph' elements. >> >> See the attached example (test.org), and associate exports (test.tex) >> and (test.html). >> >> Tested with `emacs -Q -l minimal-org.el', with the org package installed >> from http://orgmode.org/elpa/, org-20161102. >> >> * Test heading >> >> #+BEGIN_EXPORT latex >> Text which should appear in \LaTeX{} exports, but not HTML. >> #+END_EXPORT >> >> #+BEGIN_EXPORT html >> * HTML only heading >> Text which should appear in HTML exports, but not \LaTeX{}. >> #+END_EXPORT > You need to escape the pseudo-headline with a comma. > > #+BEGIN_EXPORT html > ,* HTML only heading > Text which should appear in HTML exports, but not \LaTeX{}. > #+END_EXPORT > > > Regards, >