On Friday, 11 Mar 2016 at 11:20, Alan Schmitt wrote: > Hello, > > I'm converting a latex document into org-mode to easily export it both > to latex and html. I've just encountered something that I don't know how > to do: export a \vref reference. I would like to have something that > exports to \vref in latex, and to a normal link in html. > > I thought I could do this trick with a macro: > > #+macro: vref @@latex:\myvref{$1}{@@[[$1]]@@latex:}@@
I may be missing something but could you not simply use [[vref:fig:log-expt-7]] (along with description text if you wished) and define an org link as below? #+begin_src elisp (org-add-link-type "vref" nil (lambda (path desc format) (cond ((eq format 'latex) (format "\\vref{%s}" path))))) #+end_src (untested) -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.91.1, Org release_8.3.4-626-gb62d55