Hi Rasmus, 2013ko martxoak 7an, Rasmus Pank Roulund-ek idatzi zuen: > > In my book it would seem 'natural' to strive towards the following: > > 1. It should be Bibtex-based. I.e. Bibtex should be the 'database' > or storage for citation information. It may be stored in > Org-Bibtex-whatever, but Bibtex should be the natural base. > 2. Citation selection should be possible via Reftex.
In principle this is true, but I think RefTeX is deeply intertwined with the assumption that it is running in a LaTeX buffer. Going through its code and making it major-mode-agnostic is a worthy project all of its own. But it might take less effort and be more long-run maintainable to just wire up the bibtex.el bundled with emacs, CompletionUI (http://www.emacswiki.org/CompletionUI) and YAsnippet (http://emacswiki.org/emacs/Yasnippet). > 3. It should look nice in the buffer. For instance, with the > current link hacks I am shown the pre or post notes in place of > the citation. Ideally, it should be able to specify a > reftex-cite-format string on how to display stuff in the buffer. > Notes should be viewable in an non-disturbing way. > Ideally, I would want to see something like: > (POSTFIX, Jensen, 1906, SUFFIX) > or > Jensen (POSTFIX, 1906, SUFFIX) > (If my memory serves me correctly this is how BibLatex places > notes). One could do this with font-lock and the new citation syntax I proposed in my other email. We would need two alists. One would pair citation lookup types with functions to resolve them to a location, and to get their properties. The other would pair display types with two functions: one to return a format string that would be displayed by font-lock instead of the citation markup, and one to return the code to export the citation. So, a citation like [cite:doi:parens:some-doi:key=val&key2=val2] would be displayed by: 1. call (org-lookup-cite-doi "some-doi") -> (:author "Foo" :title "bar" ...) 2. call (org-display-cite-parens '(:author "Foo" :title "bar" ...)) -> "(Foo 2000)" 3. (font-lock puts an overlay over the citation markup, with the returned string) If you click on the citation, org would open the location (URL or local file) returned by (org-resolve-cite-doi "some-doi") A citation could exported by calling (org-export-cite-parens 'doi "some-doi" (:author "foo" :title "bar") current-backend). This function could just return \parencite{foo} if exporting to latex and the citation was already in a bibtex file. But it could also just return “Foo 2000” as a static string for dumb backends like ASCII, or write the information to a temporary bibtex file (so that latex can atomatically use the bibliographic info looked up from a DOI citation). In any event, this is a big, complicated project. Step zero for me (and many people, I guess) is to get a slightly less hackish way to export Bibtex-based citations to latex, and the other pieces can be built on top of that. -- Aaron Ecay