you could also try redefining the export of a ref link like this.

#+BEGIN_SRC emacs-lisp
(setf (elt  (assoc "ref" org-link-protocols) 2)
      (lambda (keyword desc format)
        (cond
         ((eq format 'latex)
          "\\vref{keyword}")
         ((eq format 'html)
          (format
           "<a href=\"%s\">%s</a>"
           keyword (or desc ""))))))
#+END_SRC

I am not sure if that is the kind of html export you want, but you could
adapt it to something else.

Stefan Nobis writes:

> Alan Schmitt <alan.schm...@polytechnique.org> writes:
>
>> 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 solve this with the help of an export filter:
>
> --8<---------------cut here---------------start------------->8---
> (defun sn/ox-latex-filter-varioref (text backend info)
>   (when (org-export-derived-backend-p backend 'latex)
>     (replace-regexp-in-string "\\\\ref{" "\\\\vref{" text)))
>
> (eval-after-load "ox-latex"
>   '(progn
>      (add-to-list 'org-export-filter-link-functions 
> 'sn/ox-latex-filter-varioref)))
> --8<---------------cut here---------------end--------------->8---


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

Reply via email to