Hi Jim,

Have you considered leveraging the styles work of CSL, which is the  
styling language used by Zotero in their Word and OpenOffice  
integration (but developed through the xbiblio project)?  They've  
definitely implemented the author-date sorting algorithm that you are  
talking about.

CSL is a set of xslt styles, and combined with a datasource (like  
BibDesk could be) it can format both in-text citations and sorted,  
formatted bibliographies that your scripts could drop into appropriate  
place in Pages.  It's implemented currently in javascript and there is  
a Ruby implementation being developed, which might be the right target  
(driven by your applescripts).

Getting this working would open up a slew of styles, rather than  
devoting effort to hacking sorting into the BibDesk templating system  
(which is great as far as it goes).

<http://zotero.org/styles>

Check out the thinking here:

<http://netapps.muohio.edu/blogs/darcusb/darcusb/archives/2007/11/16/csl-news 
 >

And the xbiblio mailing list is a good place to get more info:

<http://sourceforge.net/mailarchive/forum.php?forum_name=xbiblio-devel>

--J

On Dec 31, 2007, at 10:31 AM, James Harrison wrote:

> On Dec 30, 2007, at 9:59 PM, Adam R. Maxwell wrote:
>> On Dec 30, 2007, at 9:42 AM, James Harrison wrote:
>>
>>>
>>> I have an author-date version of CiteInPages 
>>> (http://jhh.med.virginia.edu/main/CiteInPages
>>> )...
>>>
>>> I'm looking for a standard alphabetical sort based on author name
>>> and my (naive) preference would be to call a sort from a template
>>> (perhaps as a collection modifier) or, as a second choice, to set
>>> the sort by defining a property in the script and passing the
>>> instruction to BibDesk. Either would allow the user to have some
>>> control over the sort and would be faster than implementing a sort
>>> in Applescript.
>>>
>>> I don't see a method to specify the sort order of exported
>>> references in the BibDesk docs or Applescript library, but I may
>>> just be missing it. I'd be grateful if anyone could point me in the
>>> right direction or clue me to best practices for sorting references
>>> out of BibDesk.
>>
>> I don't see any way to do this at present, but I'm pretty clueless
>> about AS. You might want to file a feature request so we don't
>> forget about it; sorting author names is fairly complicated. It
>> might also help to know how it fits into your code (I'd assume you
>> have a list of pubs that you want to sort)?
>>
>> Google turned up this: http://www.apple.com/applescript/sbrt/sbrt-05.html
>> which might help in the meantime.
>
> Thanks, I came across the same reference; it's currently incorporated
> as a stopgap and seems to work OK.
>
> There are a couple of other edge conditions in author-date citations
> that turn out to be challenging in an Applescript implementation:
>
> 1. When first authors with the same last name and publication year but
> different first names appear in a bibliography list, the in-text
> citations should show the initials of both those authors. Citations
> for the rest of the references should show just the last names as  
> usual.
>
> 2. When there are several publications in a year with the same first
> several authors, the in-text citations and the bibliographies should
> distinguish those publications by, for example, an "a," "b," "c," and
> so forth after the year.
>
> Thus the form of particular in-text and bibliography citations depends
> on the content of the complete bibliography list, and you need the
> complete bibliography before the strings for the citations and
> bibliography listings can be finalized. As far as I can tell, the
> current templating system doesn't deal with this. I could try to
> handle it in Applescript, but that means that I'd either need to
> bypass the templating system and build the citations and
> bibliographies in the script, or heavily process the returned
> templated text looking for author and date similarities and inserting
> characters as needed. Applescript isn't well-suited to these types of
> applications (it would be slow) and I'd like to avoid requiring
> installation of third party software, ie, scripting additions for
> regular expressions. In addition, the templating system offers
> substantial flexibility to users and handles things like "et al" very
> well. I'd like to maintain and avoid constraining those useful
> features. If I have to go with one of these approaches, I'll probably
> opt to continue to use templated text and switch to Python/Appscript
> for the main part of the script, which would handle the processing
> needs but would be a bit awkward in other ways.
>
> An alternative might be to address this issue within BibDesk. The
> complete idea would be to allow a list of publications to be extracted
> from BibDesk via Applescript in a particular primary and secondary
> sort order based on existing fields (authors and year, for example).
> Each publication would also include a templated citation string and
> bibliography string, based on citation and bibliography templates
> specified at extraction time. There would be a switch (or template
> tag) that allowed citation and bibliography strings to include
> additional designators such as initials or characters after the year
> to deal with the name conflicts noted above.
>
> I know this would be a significant effort and so I'm just putting it
> out as an idea to test the response. If the developers think it's
> worth putting in a feature request, I'm happy to do it either as one
> feature or as several, as you recommend.
>
> Jim Harrison
> UVa
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bibdesk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to