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,

Reply via email to