From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: LaTeX cross references Date: Sun, 18 May 2014 11:15:18 +1000 Message-ID: <537809A6.1090002@gmail.com> References: <5376A9D5.4010703@gmail.com> <878uq1kxo3.fsf@gmail.com> <5376BBA2.3060700@gmail.com> <5377E18C.7030508@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]:50010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlphI-0002Bp-GJ for emacs-orgmode@gnu.org; Sat, 17 May 2014 21:15:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlphD-0007j1-PF for emacs-orgmode@gnu.org; Sat, 17 May 2014 21:15:28 -0400 Received: from mail-pb0-x22e.google.com ([2607:f8b0:400e:c01::22e]:44285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlphD-0007iw-HA for emacs-orgmode@gnu.org; Sat, 17 May 2014 21:15:23 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq2so4202485pbb.5 for ; Sat, 17 May 2014 18:15:22 -0700 (PDT) In-Reply-To: <5377E18C.7030508@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 18/05/14 08:24, Alan L Tyree wrote: > > 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. Forget this - I didn't have proper files loaded. Sorry for the noise, and many thanks toyou Aaron since it works a treat. Alan > > Cheers, > Alan >> >>> -- >>> Aaron Ecay >> > -- Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:typhoon@iptel.org