[Top][All Lists]

[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: John Kitchin
Subject: Re: [O] using vref in latex export, and normal links in html export
Date: Sat, 12 Mar 2016 16:27:22 -0500
User-agent: mu4e 0.9.16; emacs

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)
         ((eq format 'latex)
         ((eq format 'html)
           "<a href=\"%s\">%s</a>"
           keyword (or desc ""))))))

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 <address@hidden> 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

reply via email to

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