From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: odt macro export Date: Sat, 06 Aug 2016 11:20:50 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVxms-0005XC-58 for emacs-orgmode@gnu.org; Sat, 06 Aug 2016 05:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVxmn-0005pg-Uv for emacs-orgmode@gnu.org; Sat, 06 Aug 2016 05:20:57 -0400 Received: from mail2.b1.hitrost.net ([91.185.211.205]:58981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVxmn-0005pc-NF for emacs-orgmode@gnu.org; Sat, 06 Aug 2016 05:20:53 -0400 In-reply-to: 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: Ken Mankoff Cc: "'emacs-orgmode@gnu.org'" Ken Mankoff writes: > This works: > > #+BEGIN_ODT > > This paragraph is specially formatted and uses bold text. > > #+END_ODT > > But this does not. Should it? > > #+MACRO: BEGIN_RC @@odt:@@ > #+MACRO: END_RC @@odt:@@ > {{{BEGIN_RC}}} > This paragraph is specially formatted and uses bold text. > {{{END_RC}}} You can analyze the problem by examining the content.xml part of the ODT document. (On my system, simply opening the ODT file in Emacs reveals the unzipped files in dired; your settings may vary.) In this case, your source is already treated as a block and wrapped in a

element, so macro expansion results in a

illegally wrapped in a

: #+begin_example This paragraph is specially formatted and uses bold text. #+end_example This makes it different to style a paragraph block with macros. You could add closing and opening tags to the macros, but that would result in empty paragraphs (double spacing) on either side. However, following the example in the Info, you could create a bold character style, and use the inline instead of the block in your macro. Actually, my version of LibreOffice has a "Bold" character style pre-defined, so I can just do this: #+begin_example #+MACRO: BEGIN_RC @@odt:@@ #+MACRO: END_RC @@odt:@@ {{{BEGIN_RC}}}This paragraph is specially formatted and uses bold text.{{{END_RC}}} #+end_example This should solve your use case. It does not provide a convenient method if you want to affect paragraph-style properties rather than character-style ones, though. Yours, Christian