emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Help on org-export-filter-link-functions


From: Daimrod
Subject: [O] Help on org-export-filter-link-functions
Date: Fri, 03 Oct 2014 13:19:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Hi,

I've wrote a simple filter to customize how links are exported in
latex:
#+BEGIN_SRC
(defun dmd--latex-bib-link-filter (data backend info)
  "Convert a bib link to a citation (e.g. bib:foo93 -> \cite{foo93})."
  (let* ((beg (next-property-change 0 data))
         (link (if beg (get-text-property beg :parent data))))
    (cond ((and link
                (org-export-derived-backend-p backend 'latex)
                (string= (org-element-property :type link) "bib"))
           (format "\\cite{%s}" (org-element-property :path link)))
          ((and link
                (org-export-derived-backend-p backend 'latex)
                (string= (org-element-property :type link) "file")
                (string= (org-element-property :path link) "~/.bib.bib"))
           (format "\\cite{%s}" (org-element-property :search-option link)))
          (t data))))
#+END_SRC

And I was wondering whether there is an easier way to retrieve the org
properties stored in the text properties of DATA.

Best,

-- 
Daimrod/Greg

Attachment: signature.asc
Description: PGP signature


reply via email to

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