emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Citation syntax: a revised proposal


From: John Kitchin
Subject: Re: [O] Citation syntax: a revised proposal
Date: Mon, 16 Feb 2015 14:16:02 -0500

That is probably something like it. I meant sorted by year (others may
prefer author), which also means looking up in the database, decorating,
and then sorting, but that doesn't fundamentally change your idea. Then,
from the sorted list, you have to regenerate the org-syntax and replace
the original text with the new string. hard may be an overstatment. I
just have the experience from org-ref that there were often corner cases
that I did not anticipate, with an even simpler syntax. I would hope the
new syntax and data structure make this easier, but I will reserve
judgment until it exists and we can try it.

I am confident some ambitious soul will set out to make a citation using
every possible variation, and then want to do something like sort it,
and expect it to be done correctly, and will file bug reports if it is
not. If not hard, it will definitely be more difficult! Still, as long
as it is possible, it is only hard one time, and then it is
done. Possible is the key. That said, there is a famous statment that it
is twice as hard to debug code as to write it, so if you your cleverest
at writing the code you are by definition not clever enough to debug it!

Like I said, this community is very clever at solving these kinds of
issues, so probably it is not a reason to not try something.

Rasmus writes:

> John Kitchin <address@hidden> writes:
>
>> They are probably minor, but for example I am not sure how easy it would
>> be to sort a multicite with all of the syntax options. I guess it can be
>> done, I just do not see it clearly. It may not be necessary to do this
>> either.
>
> Out of curiosity:
>
> Why would this be hard?  Would it amount to more than replacing identity
> in the below snippet with something that gets the true author?  You can
> split out global pre and post note beforehand and reinsert it.  I'm
> probably missing something.
>
> (sort '((:key "foo" :pre "pre")
>         (:key "bar" :post "pp. 22")
>         (:key "baz"))
>       (lambda (a b) (string-collate-lessp
>                 (funcall 'identity (plist-get a :key))
>                 (funcall 'identity (plist-get b :key)))))
>
> —Rasmus

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

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