On 31 Dec 2007, at 4:31 PM, 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. >>>
A problem of sorting support in templates is that it is 'static': you have to hard code the possible sortings, there is no way to pass an arbitrary sort key in a template. Also, it would be useless and counter intuitive in templates used for export, as it overrides the natural order from the items or the table. Having said this, it would be possible to make a few sorting mechanisms (such as author search) available, as we do in Skim. In fact I just added one. >>> 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. > That's why a cite key is useful. I'd call it more a problem of the approach of not using cite keys. > 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. And cannot possibly deal with this. The information is simply not available. > 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. > As noted above, this is not possible in the templating mechanism. In your script, the publications come from the text, so it's not something extracted from BibDesk. So I don't really understand what you mean here. I don't see anything here that BibDesk could/should ever handle. > 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 Apart from the sorting by some fixed keys, I don't see anything that BibDesk can ever do to help with this. Christiaan ------------------------------------------------------------------------- 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
