emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Exporting to groff, now in org-export.el ...


From: Nicolas Goaziou
Subject: Re: [O] Exporting to groff, now in org-export.el ...
Date: Fri, 06 Jul 2012 09:14:27 +0200

Hello,

Luis Anaya <address@hidden> writes:

> 1. Automated caption support. I need to figure out how to get the
> caption text (via CAPTION? via ATTR ? ). Right now generic ones are
> added which they show up in the table of content.

This is done through :caption property:

  (org-element-property :caption some-element)

Note that when non nil, the value of this property is a list of two
secondary strings: CAR is the regular caption while CDR in the
(optional) short caption. Also, don't forget to send them through
`org-export-data'. Here's a snippet illustrating this:

#+begin_src emacs-lisp
(let ((caption (org-element-property :caption element)))
  ;; This how you get the long caption.
  (org-export-data (car caption) info)
  ;; This is how you get the short caption or the empty string.
  (org-export-data (cdr caption) info))
#+end_src

> I have a general question though. Equation and Picture creation 
> support in Groff is done with the use of the "eqn" and "pic" programs. 
> I've been debating if these should be included in org-babel, 
> for executing these the same way plantuml is  executed through the use
> of #+begin_src #+end_src 
>
> However considering that these are Groff only I'm not sure if these
> would be better served by using special attributes to add pic/eqn
> code. This is because the output of these commands are Groff statements
> that only make sense in Groff.

You can also write raw Groff code within #+begin_groff...#+end_groff,
provided that you modify `org-element-block-name-alist' accordingly and
define a transcoder for export blocks like the following:

#+begin_src emacs-lisp
(defun org-e-groff-export-block (export-block contents info)
  "Transcode a EXPORT-BLOCK element from Org to GROFF.
CONTENTS is nil.  INFO is a plist holding contextual information."
  (when (equal (org-element-property :type export-block) "GROFF")
    (org-remove-indentation (org-element-property :value export-block))))
#+end_src


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]