From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Need some help in customizing ox-texinfo Date: Fri, 18 Dec 2015 22:37:19 +0100 Message-ID: <87d1u3moa8.fsf@nicolasgoaziou.fr> References: <87bn9nn9rq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA2gX-0006r9-Ij for emacs-orgmode@gnu.org; Fri, 18 Dec 2015 16:35:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aA2gS-0002xS-9V for emacs-orgmode@gnu.org; Fri, 18 Dec 2015 16:35:33 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:38486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA2gS-0002wb-3z for emacs-orgmode@gnu.org; Fri, 18 Dec 2015 16:35:28 -0500 In-Reply-To: <87bn9nn9rq.fsf@gmail.com> (Oleh Krehel's message of "Fri, 18 Dec 2015 14:53:13 +0100") 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: Oleh Krehel Cc: emacs-orgmode@gnu.org Hello, Oleh Krehel writes: > I'm exporting an Org-mode document to Texinfo currently, but I'm having > an inconvenience with production of @subsubheading items. > > What I'm doing right now: > > #+BEGIN_TEXINFO > @subsubheading > #+END_TEXINFO > <Content> > > What I would like to have instead: > > * <Title> :@subsubheading > <Content> > > And have it export to the same thing. I didn't find an easy way to do > it, since this requires embedding the content of a headline into the > parent headline. What I've got so far is adding this code to > `org-texinfo--normalize-headlines': > > (org-element-map tree 'headline > (lambda (hl) > (when (member "@subsubheading" (org-element-property :tags hl)) > (setcar (nthcdr (cl-position hl (org-element-property :parent hl)) > (org-element-property :parent hl)) > (cons `(paragraph > () > ,(format > "@subsubheading %s" > (org-element-property > :raw-value hl))) > (org-element-contents hl))))) > info) > > It almost works, the only issue is that "@" is escaped later on and I > get "@@subsubheading" in the end. How can I fix that? Is there an easier > way to do this in general? I'm not sure to understand your use case, but couldn't you customize `org-texinfo-classes'? In particular, see the last paragraph in its docstring. Regards, -- Nicolas Goaziou