From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Nobis Subject: Re: using vref in latex export, and normal links in html export Date: Sat, 12 Mar 2016 09:44:11 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aef9v-0007et-4A for emacs-orgmode@gnu.org; Sat, 12 Mar 2016 03:44:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aef9q-0005bD-4z for emacs-orgmode@gnu.org; Sat, 12 Mar 2016 03:44:27 -0500 Received: from basilikum.nobis-admin.de ([89.238.71.130]:42743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aef9p-0005Zx-Rq for emacs-orgmode@gnu.org; Sat, 12 Mar 2016 03:44:22 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by basilikum.nobis-admin.de (Postfix) with ESMTP id 79C7E7E0280 for ; Sat, 12 Mar 2016 09:44:19 +0100 (CET) Received: from basilikum.nobis-admin.de ([127.0.0.1]) by localhost (basilikum.nobis-admin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RSIOzc0aYZfI for ; Sat, 12 Mar 2016 09:44:13 +0100 (CET) Received: from bohne.localdomain (x4db500f0.dyn.telefonica.de [77.181.0.240]) by basilikum.nobis-admin.de (Postfix) with ESMTPSA for ; Sat, 12 Mar 2016 09:44:13 +0100 (CET) In-Reply-To: (Alan Schmitt's message of "Fri, 11 Mar 2016 11:20:13 +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 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: --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--- -- Until the next mail..., Stefan.