From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: LaTeX cross references Date: Sun, 18 May 2014 08:24:12 +1000 Message-ID: <5377E18C.7030508@gmail.com> References: <5376A9D5.4010703@gmail.com> <878uq1kxo3.fsf@gmail.com> <5376BBA2.3060700@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wln1i-0006mp-RT for emacs-orgmode@gnu.org; Sat, 17 May 2014 18:24:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wln1e-0000n8-4n for emacs-orgmode@gnu.org; Sat, 17 May 2014 18:24:22 -0400 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:56560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wln1d-0000my-Tj for emacs-orgmode@gnu.org; Sat, 17 May 2014 18:24:18 -0400 Received: by mail-pa0-f45.google.com with SMTP id ey11so4075640pad.18 for ; Sat, 17 May 2014 15:24:15 -0700 (PDT) In-Reply-To: <5376BBA2.3060700@gmail.com> 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: Aaron Ecay , emacs-orgmode On 17/05/14 11:30, Alan L Tyree wrote: > > On 17/05/14 11:26, Aaron Ecay wrote: >> Hi Alan, >> >> 2014ko maiatzak 16an, Alan L Tyree-ek idatzi zuen: >>> G'day, >>> >>> My org manuscript has cross references like this: see >>> [[id:4c473c51-b484-4a29-8fe7-118d8084a6f8][Limitations Acts]] >>> >>> Exporting to LaTeX currently gives me: see >>> \hyperref[sec-4-3]{Limitations Acts} >>> >>> What I would like is: \ref{sec-4-3} since I am trying to end up with a >>> Word file for an editor that will be (ultimately) a printed book. >>> >>> I'm sure this is a simple variable somewhere, but I'm frustrated trying >>> to find it. >> I think you have two choices. The first is to remove the description >> from the link, leaving just: >> >> [[id:4c473c51-b484-4a29-8fe7-118d8084a6f8]] >> >> Sadly, this is not very informative to look at. >> >> The other is to use an export filter like the following to convert the >> exporter’s output to the desired format: >> >> #+BEGIN_SRC emacs-lisp >> (defun awe-org-latex-filter-section-links (string backend plist) >> (if (and (org-export-derived-backend-p backend 'latex) >> (string-match "\\\\hyperref\\[\\(sec-.*?\\)\\]" string)) >> (let ((end-space (if (string-match-p " \\'" string) " " ""))) >> (concat (format "\\ref{%s}" (match-string 1 string)) >> end-space)) >> string)) >> (add-to-list 'org-export-filter-link-functions >> #'awe-org-latex-filter-section-links) >> #+END_SRC >> >> Hope this helps, > Hi Aaron, > I'm adding the reply to the list. > > It helps immensely. I'll give the filter a try later this weekend. > Thanks for your help! > > Alan > I'm having some trouble with this: when I try to evaluate the (add-to-list ..., I get a message: Symbol's value as variable is void: org-export-filter-link-functions Emacs: 24.3.1 Org-mode version 8.2.6 (release_8.2.6-958-g7c8559 @ /home/alant/.emacs.d/org-mode/lisp/) Any help appreciated. Cheers, Alan > >> -- >> Aaron Ecay > -- Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:typhoon@iptel.org