emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Olivier Berger <oberger@ouvaton.org>
To: emacs-orgmode@gnu.org
Subject: Navigatable and exportable bib/notes links - Was: Re: Integration of RefTeX and LaTeX export
Date: Fri, 23 Mar 2012 17:14:30 +0100	[thread overview]
Message-ID: <8762dvpa55.fsf_-_@asustour.olivierberger.com> (raw)
In-Reply-To: 29415.1329456681@alphaville

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 <nicholas.dokos@hp.com> 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/

      parent reply	other threads:[~2012-03-23 16:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 20:59 Integration of RefTeX and LaTeX export Andreas Willig
2012-02-16 22:08 ` Thomas S. Dye
2012-02-17  4:46   ` Andreas Willig
2012-02-17  5:31     ` Nick Dokos
2012-02-17  7:39       ` Andreas Willig
2012-02-17  8:10         ` Andreas Willig
2012-02-17  8:36           ` Andreas Willig
2012-02-17 17:59             ` Nick Dokos
2012-02-17 19:12               ` Achim Gratz
2012-02-17 19:17                 ` Nick Dokos
2012-03-23 16:14       ` Olivier Berger [this message]

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=8762dvpa55.fsf_-_@asustour.olivierberger.com \
    --to=oberger@ouvaton.org \
    --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).