emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Navigatable and exportable bib/notes links - Was: Re: Integration of


From: Olivier Berger
Subject: [O] Navigatable and exportable bib/notes links - Was: Re: Integration of RefTeX and LaTeX export
Date: Fri, 23 Mar 2012 17:14:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi.

FWIW, I've been inspired by your code and some other posts on the topic
of bibliographic references / notes management with org-mode and have
summarized the results in [0].

The end result : links like [[note:abibref]] or [[bib:abibref]] which
respectively point to a bibliography notes or a bibtex section in a
.bib, and which both can be exported to latex as regular \cite{abibref}
references would do.

Hope this helps.

Best regards,

[0] 
http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/

Nick Dokos <address@hidden> writes:

> I'm pretty sure the second function is not quoted properly in your
> org-add-link-type so it ends up actually getting called at the time of
> the org-add-link-type is called.
>
> Try the following:
>
>
>
> --8<---------------cut here---------------start------------->8---
> (defun rt-follow-handler (path)
>   (message "dummy handler called, path = %s" path)
>   (let ((arg (concat "\\cite{" path "}")))
>     (reftex-view-crossref arg)))
>
> (defun rt-export-handler  (path desc format)
>   (message "my handler is called")
>   (cond ((eq format 'latex)
>        (if (or (not desc) (equal 0 (search "rtcite:" desc)))
>            (format "\\cite{%s}" path)
>          (format "\\cite[%s]{%s}" desc path)))))
>
> (require 'org)
> (org-add-link-type "rtcite" 
>                  (function rt-follow-handler)
>                  (function rt-export-handler))
> --8<---------------cut here---------------end--------------->8---
>
>
>
> By way of explanation:
>
> I had this as part of a minimal .emacs and it seems to work more or
> less OK: I replaced the error call with a message call, because it
> actually triggered and blew up :-) The rt-export-handler needs tweaking
> but you 'll know what to do better than I do when you see the latex
> output.
>
> I had to (require 'org) to pick up the definition of org-add-link-type:
> that seems to be a missing autoload somewhere.
>
> And finally I like to quote functions with function, not quote, for
> compiled-code reasons, but in most cases, it won't make any difference:
> use quotes if you prefer.
>
> Nick
>

-- 
Olivier BERGER 
(OpenPGP: 4096R/7C5BB6A5)
http://www.olivierberger.com/weblog/




reply via email to

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