* LaTeX cross references
@ 2014-05-17 0:14 Alan L Tyree
[not found] ` <878uq1kxo3.fsf@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Alan L Tyree @ 2014-05-17 0:14 UTC (permalink / raw)
To: emacs-orgmode
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.
Any help appreciated.
Cheers,
Alan
--
Alan L Tyree http://www2.austlii.edu.au/~alan
Tel: 04 2748 6206 sip:typhoon@iptel.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: LaTeX cross references
[not found] ` <878uq1kxo3.fsf@gmail.com>
@ 2014-05-17 1:30 ` Alan L Tyree
2014-05-17 22:24 ` Alan L Tyree
0 siblings, 1 reply; 5+ messages in thread
From: Alan L Tyree @ 2014-05-17 1:30 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: LaTeX cross references
2014-05-17 1:30 ` Alan L Tyree
@ 2014-05-17 22:24 ` Alan L Tyree
2014-05-18 1:15 ` Alan L Tyree
0 siblings, 1 reply; 5+ messages in thread
From: Alan L Tyree @ 2014-05-17 22:24 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: LaTeX cross references
2014-05-17 22:24 ` Alan L Tyree
@ 2014-05-18 1:15 ` Alan L Tyree
2014-05-18 3:01 ` Aaron Ecay
0 siblings, 1 reply; 5+ messages in thread
From: Alan L Tyree @ 2014-05-18 1:15 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: LaTeX cross references
2014-05-18 1:15 ` Alan L Tyree
@ 2014-05-18 3:01 ` Aaron Ecay
0 siblings, 0 replies; 5+ messages in thread
From: Aaron Ecay @ 2014-05-18 3:01 UTC (permalink / raw)
To: Alan L Tyree; +Cc: emacs-orgmode
Hi Alan (et al.),
I meant to reply to the list as well, thanks for forwarding. And I'm
glad the filter works for you.
Aaron
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-18 3:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-05-18 1:15 ` Alan L Tyree
2014-05-18 3:01 ` Aaron Ecay
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).