emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Need some help in customizing ox-texinfo
@ 2015-12-18 13:53 Oleh Krehel
  2015-12-18 21:37 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Oleh Krehel @ 2015-12-18 13:53 UTC (permalink / raw)
  To: emacs-orgmode

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 <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?

regards,
Oleh

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Need some help in customizing ox-texinfo
  2015-12-18 13:53 Need some help in customizing ox-texinfo Oleh Krehel
@ 2015-12-18 21:37 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2015-12-18 21:37 UTC (permalink / raw)
  To: Oleh Krehel; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-18 21:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-18 13:53 Need some help in customizing ox-texinfo Oleh Krehel
2015-12-18 21:37 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).