emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan L Tyree <alantyree@gmail.com>
To: Aaron Ecay <aaronecay@gmail.com>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: LaTeX cross references
Date: Sun, 18 May 2014 08:24:12 +1000	[thread overview]
Message-ID: <5377E18C.7030508@gmail.com> (raw)
In-Reply-To: <5376BBA2.3060700@gmail.com>


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

  reply	other threads:[~2014-05-17 22:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17  0:14 LaTeX cross references Alan L Tyree
     [not found] ` <878uq1kxo3.fsf@gmail.com>
2014-05-17  1:30   ` Alan L Tyree
2014-05-17 22:24     ` Alan L Tyree [this message]
2014-05-18  1:15       ` Alan L Tyree
2014-05-18  3:01         ` Aaron Ecay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5377E18C.7030508@gmail.com \
    --to=alantyree@gmail.com \
    --cc=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).