emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Help on org-export-filter-link-functions
@ 2014-10-03 11:19 Daimrod
  2014-10-04 16:40 ` John Kitchin
  0 siblings, 1 reply; 5+ messages in thread
From: Daimrod @ 2014-10-03 11:19 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

end of thread, other threads:[~2014-10-05 22:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-03 11:19 Help on org-export-filter-link-functions Daimrod
2014-10-04 16:40 ` John Kitchin
2014-10-05  1:13   ` Rasmus
2014-10-05 13:11     ` John Kitchin
2014-10-05 22:24       ` Rasmus

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).