From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Krehel Subject: Need some help in customizing ox-texinfo Date: Fri, 18 Dec 2015 14:53:13 +0100 Message-ID: <87bn9nn9rq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9vUA-00032n-5t for emacs-orgmode@gnu.org; Fri, 18 Dec 2015 08:54:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9vU6-0003pt-39 for emacs-orgmode@gnu.org; Fri, 18 Dec 2015 08:54:18 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9vU5-0003pp-Rt for emacs-orgmode@gnu.org; Fri, 18 Dec 2015 08:54:14 -0500 Received: by mail-wm0-x229.google.com with SMTP id p187so64532723wmp.1 for ; Fri, 18 Dec 2015 05:54:13 -0800 (PST) Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id o65sm6831915wmg.3.2015.12.18.05.54.11 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 18 Dec 2015 05:54:11 -0800 (PST) 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: emacs-orgmode@gnu.org Hello, 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? regards, Oleh From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou <mail@nicolasgoaziou.fr> 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: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org> Received: from eggs.gnu.org ([2001:4830:134:3::10]:50991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <mail@nicolasgoaziou.fr>) 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 <mail@nicolasgoaziou.fr>) 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 <mail@nicolasgoaziou.fr>) 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." <emacs-orgmode.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode> List-Post: <mailto:emacs-orgmode@gnu.org> List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=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 <ohwoeowho@gmail.com> Cc: emacs-orgmode@gnu.org Hello, Oleh Krehel <ohwoeowho@gmail.com> 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 <Title> > #+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