emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] using vref in latex export, and normal links in html export


From: Eric S Fraga
Subject: Re: [O] using vref in latex export, and normal links in html export
Date: Fri, 11 Mar 2016 11:03:33 +0000

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



reply via email to

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