Changeset 9582 for trunk/gsdl
- Timestamp:
- 2005-04-07T14:04:37+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BibTexPlug.pm
r9120 r9582 117 117 # BibTex names are taken from the "Local Guide to Latex" Graeme 118 118 # McKinstry. Metadata names are consistent with ReferPlug. 119 120 # The author metadata will be stored as one "Creator" entry, but will 121 # also be split up into several individual "Author" fields. 119 122 120 123 my %field = ( … … 203 206 204 207 # otherwise, parse the metadata out of this line 205 next unless ($line =~ /^\s*(\w+)\s +=\s+(.*)/);208 next unless ($line =~ /^\s*(\w+)\s*=\s*(.*)/); 206 209 $entryname = lc($1); 207 210 $value = $2; … … 261 264 262 265 # take care of "et al."... 263 $value =~ s/(\s+et\.?\s+al\.?)\s*$//; 264 my $etal=$1; 265 $etal="" if (!defined ($etal)); 266 my $etal=''; 267 if ($value =~ s/\s+(and\s+others|et\.?\s+al\.?)\s*$//i) { 268 $etal=' <em>et. al.</em>'; 269 } 266 270 # und here for german language... 267 271 # don't use brackets in pattern, else the matched bit becomes … … 322 326 } 323 327 my $wholename="$first $von $last $jr"; 324 $wholename =~ s/ $//; $wholename =~ s/\s+/ /g; 328 $wholename =~ s/\s+/ /g; # squeeze multiple spaces 329 $wholename =~ s/ $//; 325 330 push (@formattedlist, $wholename); 326 331 my $fullname = "$last"; … … 330 335 331 336 # Add each name to set of Authors 332 # force utf8 pragma so that \w matches in this scope333 use utf8;334 337 $doc_obj->add_utf8_metadata ($cursection, "Author", $fullname); 335 338 } … … 353 356 } 354 357 355 356 358 # Add the various fields as metadata 357 359 $doc_obj->add_utf8_metadata ($cursection, $name, $value); 360 } 361 362 # for books and journals... 363 if (!exists $metadata{'title'}) { 364 my $name=$field{'title'}; # get Greenstone metadata name 365 my $value; 366 if (exists $metadata{'booktitle'}) { 367 $value=$metadata{'booktitle'}; 368 } elsif (exists $metadata{'journal'}) { 369 $value=$metadata{'journal'}; 370 } 371 if ($value) { 372 $doc_obj->add_utf8_metadata ($cursection, $name, $value); 373 } 358 374 } 359 375
Note:
See TracChangeset
for help on using the changeset viewer.