From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: using vref in latex export, and normal links in html export Date: Fri, 11 Mar 2016 11:03:33 +0000 Message-ID: <8737rxwa2i.fsf@ucl.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeL6L-0005oW-8G for emacs-orgmode@gnu.org; Fri, 11 Mar 2016 06:19:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeL6G-0000L4-5q for emacs-orgmode@gnu.org; Fri, 11 Mar 2016 06:19:25 -0500 Received: from mail-db3on0126.outbound.protection.outlook.com ([157.55.234.126]:58796 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeL6F-0000IW-T8 for emacs-orgmode@gnu.org; Fri, 11 Mar 2016 06:19:20 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode 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