From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: using vref in latex export, and normal links in html export Date: Mon, 14 Mar 2016 10:29:29 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afOoZ-0005bE-A7 for emacs-orgmode@gnu.org; Mon, 14 Mar 2016 05:29:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afOoW-00024j-1E for emacs-orgmode@gnu.org; Mon, 14 Mar 2016 05:29:27 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:19088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afOoV-00024N-RB for emacs-orgmode@gnu.org; Mon, 14 Mar 2016 05:29:23 -0400 In-Reply-To: (Stefan Nobis's message of "Sat, 12 Mar 2016 09:44:11 +0100") 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-03-12 09:44, Stefan Nobis writes: > Alan Schmitt 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: > > (defun sn/ox-latex-filter-varioref (text backend info) > (when (org-export-derived-backend-p backend 'latex) > (replace-regexp-in-string "\\\\ref{" "\\\\vref{" text))) >=20=20=20=20=20 > (eval-after-load "ox-latex" > '(progn > (add-to-list 'org-export-filter-link-functions 'sn/ox-latex-filter-v= arioref))) Thank you for the suggestion, but this would convert every link in a vref link. What I want to do is to be able to handle some links as vref. Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Monthly Athmospheric CO=E2=82=82 (2016-02, Mauna Loa Obs.): 404.02 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJW5oR5AAoJEAQNCjtO0uXHV0cH/A8zZWyaSYZ09vY7HgmDB2l4 RrIR2Cithj7+XVGkcsnabhQ5YVUVA4aMPYfzifqzTXWJt2kRaoKgY6hXELkVoVAk S7fUH3q6VF3EBG6khEroDWqtXf6kA5/6DyGGnOV7PJKgbxyrGUcvlBj0g3ESPOaM JvnxoXy93aT24O7ya0lkA4Eq6BPeJOcPTQdNJEO3PDIFUHh0bu+VkpT4OfqywVe2 exfSXf8pw91HYM2hHdK+XIRV69x/KPEQ0A+nTymxjXSr8RgXwqzM7VptKA7IW23T kps6GFOqAe5NEDPCGKHZ7aw2fooxxoFoSHHWA47uzwtxAhBLHEfk3WUtvV6g8Rs= =cPPu -----END PGP SIGNATURE----- --=-=-=--