emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] LaTeX cross references


From: Alan L Tyree
Subject: Re: [O] LaTeX cross references
Date: Sun, 18 May 2014 08:24:12 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0


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:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]