Menu

#17 Small problems w/ endnote export

open
nobody
None
3
2001-07-25
2001-07-24
No

When trying to export to endnote, I encounter the
following problems:
- 'reverseauthor = 1' does not apply to the first
author
- surplus spaces appear in the output
- %AuthorAddress appears at top of entries with an
affiliation
(- contents of Annote field end up in "URL" field)

All these bugs have been reproduced on the current CVS
version, but I think they are not specific to that
version.

In detail:
1)
Using 'reverseauthor = 1' (which is the default in
bp-endnote.pl, and the default for Endnote users), I
get an author list like this:
%A J. L. Andersson
%A Hutton, C.
%A Ashburner, J.
It seems to me that the first author should appear as:
%A Andersson, J. L.

2)
Fields that are enclosed in braces in BibTeX, have
additional leading and trailing spaces. That is:
pages = { 354-61 },
gets translated to:
%P 354-61
(with two spaces instead of one between 'P' and
'354...'.)
This is more annoying in the case of other fields, like
the title, where sorting by title will be disturbed.

3)
Records that contain an affiliation, start out with:
%AuthorAddress Department of ....
(two spaces here, too, BTW).
This gets imported to Endnote as a reference whose
first author is 'uthorAddress...', which is mildly
annoying. This bug exists for older versions of sixpack
without the seperate field 'Affiliation', too.

Note that the Endnote documentation lists %+ as code
for the author address. Editing bp-endnote.ps to
contain '+' in the order list of options ('opt_order'),
and "'+' , 'AuthorAddress'," in the
'%ref_to_can_fields' solves this problem, in that the
appropriate '%+ Department of ...' field appears in the
export output. Thus, the author field is not garbled
anymore. However, Endnote seems to ignore the %+... so
the affiliation will still not get imported.

4)
This is probably not a bug. But wouldn't the contents
of 'annote' be better in the 'note' field in Endnote,
rather than in the 'URL' filed? A matter of taste, I
guess.
BTW, I noted, that the Endnote documentation lists %Z
as the note tag, but %O seems to work just as well.

Discussion

  • Jan Warnking

    Jan Warnking - 2001-07-25
    • priority: 5 --> 3
     
  • Derek Todd

    Derek Todd - 2001-10-19

    Logged In: YES
    user_id=64985

    In answer to point 1), I think the solution is to add

    786a787
    > $name =~ s/^\s//;

    in file bp-bibtex.pl (sixpack-0.99.010831)

     
  • Derek Todd

    Derek Todd - 2001-10-19

    Logged In: YES
    user_id=64985

    Some context might be helpful!

    sub bibtex_name_to_canon {
    local($name) = @_;
    local($n);
    local($vonlast, $von, $last, $jr, $first, $part);
    local(@savechars);
    local($saveptr) = '00';
    local($canon_name) = '';

    $name =~ s/\s+/ /g;
    $name =~ s/^\s//;

    # Move each item enclosed in braces to an atomic character.
    while ($name =~ s/(\{[^\}]*\})/$bib'cs_temp$saveptr/) {
    push(@savechars, $1);
    $saveptr++;
    }

     
  • Derek Todd

    Derek Todd - 2001-10-19

    Logged In: YES
    user_id=64985

    Of course, if I'd looked at point 2, I'd have realised that
    they are probably aspects of the same problem; i.e. a space
    being inserted at the start of the entry.

    doh!!!

     
  • Derek Todd

    Derek Todd - 2001-10-19

    Logged In: YES
    user_id=64985

    So, rather than the previous change to bp-bibtex.pl I
    suggested, This should fix both points 1 and 2...

    bp-bibtex.pl

    533a534,539
    > # Leading and trailing spaces are undesirable.
    > $val =~ s/^\s*//;
    > $val =~ s/\s*$//;
    >
    >
    >

    Context;

    sub explode {
    local($rec) = @_;
    local(%be_entry);
    local(@e_values);
    local($fld, $val);

    @e_values = split(/,\s*(\w+)\s*=\s*/, $rec);
    ($be_entry{'TYPE'}, $be_entry{'CITEKEY'}) =
    ( shift(@e_values) =~ /^\s*\@\s*(\w+)\s*[{(]\s*(\S+)/ );
    &bib'goterror("error exploding bibtex record") unless
    scalar(@e_values) > 1;
    # XXXXX 17 Dec 96, Changed ,?\s+[ to ,?\s*[
    $e_values[$#e_values] =~ s/\s*,?\s*[})]\s*$//; # zap the
    final delimiter
    while (@e_values) {
    ($fld, $val) = splice(@e_values, 0, 2);
    $fld =~ tr/A-Z/a-z/;
    $val =~ s/^\s*\{((.|\n)*)\}\s*$/$1/
    || $val =~ s/^\s*\"((.|\n)*)\"\s*$/$1/;
    # XXXXX Check to see if squeezing spaces here is ok.
    $val =~ s/\s+/ /g;
    # Leading and trailing spaces are undesirable.
    $val =~ s/^\s*//;
    $val =~ s/\s*$//;

     

Log in to post a comment.

MongoDB Logo MongoDB