Ignore:
Timestamp:
2002-05-13T17:06:05+12:00 (22 years ago)
Author:
jrm21
Message:

minor changes to formatted values (eg if enclosed in { and } ) and added a
few extra accented characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/BibTexPlug.pm

    r2901 r3112  
    166166    $entryname = lc($1);
    167167    $value = $2;
    168     # tidy up, removing " at start and end 
    169     $value =~ s/^"//;
    170     $value =~ s/(",)\s*$//;
     168    $value =~ s/,?\s*$//; # remove trailing comma and space
     169    if ($value =~ /^"/ && $value =~ /"$/) {
     170        # remove surrounding " marks
     171        $value =~ s/^"//; $value =~ s/"$//;
     172    }
    171173    $value = &process_latex($value);
    172174
     
    212214    # The author metadata will be stored as one "Creator" entry, but we
    213215    # also want to split it into several individual "Author" fields in
    214     # "Lastename, Firstnames" format so we can browse it.
     216    # "Lastname, Firstnames" format so we can browse it.
    215217    if ($entryname eq "author") { #added also comparison with editor
    216218       
     
    421423     # ring
    422424     # dot
     425     '\.c' => chr(0xc4).chr(0x8b),
     426     '\.C' => chr(0xc4).chr(0x8a),
     427     '\.e' => chr(0xc4).chr(0x97),
     428     '\.E' => chr(0xc4).chr(0x96),
     429     '\.g' => chr(0xc4).chr(0xa1),
     430     '\.G' => chr(0xc4).chr(0xa0),
     431     '\.I' => chr(0xc4).chr(0xb0),
     432     '\.z' => chr(0xc5).chr(0xbc),
     433     '\.Z' => chr(0xc5).chr(0xbb),
    423434     # macron
    424435     '=a' => chr(0xc4).chr(0x81),
     
    476487     'h' => chr(0xc4).chr(0xa7),
    477488#    'H' => chr(0xc4).chr(0xa6), # !! this normally(!!?) means Hung. umlaut
     489     'i' => chr(0xc4).chr(0xb1), # dotless lowercase i
    478490     'l' => chr(0xc5).chr(0x82),
    479491     'L' => chr(0xc5).chr(0x81),
     
    492504
    493505    # remove {} around a single character (eg \'{e})
    494     $text =~ s@(\\[`'="]){(\w)}@$1$2@;
     506    $text =~ s@(\\[`'="\.]){(\w)}@$1$2@g;
    495507
    496508    # remove {} around a single character for special 1 letter commands -
     
    512524    }
    513525
     526    # remove latex commands
     527    $text =~ s@\\\w+{([^}]*)}@$1@g;
     528
    514529    # remove latex groupings { } (but not \{ or \} )
    515     # note - need it like this for first char match - eg {xx}{yy}
    516     while ($text =~ s@([^\\]){([^}]*?[^\\])}@$1$2@g) {}
    517 
    518     # remove latex commands
    519     $text =~ s@\\\w+{(.*)}@$1@g;
     530    $text =~ s/([^\\])\{/$1/g;
     531    $text =~ s/([^\\])\}/$1/g;
     532    $text =~ s/^{//; # remove { if first char
    520533
    521534    # maths mode $...$ - this is not interpreted in any way at the moment...
Note: See TracChangeset for help on using the changeset viewer.