From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: LaTeX cross references Date: Sat, 17 May 2014 11:30:10 +1000 Message-ID: <5376BBA2.3060700@gmail.com> References: <5376A9D5.4010703@gmail.com> <878uq1kxo3.fsf@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]:58206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlTS7-0004SZ-4v for emacs-orgmode@gnu.org; Fri, 16 May 2014 21:30:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlTS2-0007KA-Gt for emacs-orgmode@gnu.org; Fri, 16 May 2014 21:30:19 -0400 Received: from mail-pb0-x231.google.com ([2607:f8b0:400e:c01::231]:49879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlTS2-0007Ib-A8 for emacs-orgmode@gnu.org; Fri, 16 May 2014 21:30:14 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so3265881pbb.8 for ; Fri, 16 May 2014 18:30:13 -0700 (PDT) In-Reply-To: <878uq1kxo3.fsf@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: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 > -- > Aaron Ecay -- Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:typhoon@iptel.org