emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Exporting fuzzy links using LaTeX's autoref


From: Konstantin Kliakhandler
Subject: [O] Exporting fuzzy links using LaTeX's autoref
Date: Thu, 13 Oct 2016 16:35:56 +0300

Hi Clément,

I don’t know if you’ve found a satisfactory solution yet, but I found the 
following to work quite well in my case:

  ;; Define an export function for autoref links
  (defun kk/org-autoref-export (path desc format)
    "Export an autoref type reference for the given path"
    (case format
      ('latex (string-join `("\\autoref{" ,path "}")))))

  ;; Define a function for following org links
  (defun kk/org-follow-path (path)
    "Follow an org path given in the argument"
    (org-open-link-from-string (string-join `("[[" ,path "]]"))))

  ;; Register autoref link type
  (org-add-link-type "ar" 'kk/org-follow-path 'kk/org-autoref-export)

It works fine for items that have a #+NAME attached to them, perhaps to other 
stuff as well (though I haven’t tested this).
Hope it helps.

Good luck,
Kosta


reply via email to

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