Changeset 3112
- Timestamp:
- 2002-05-13T17:06:05+12:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BibTexPlug.pm
r2901 r3112 166 166 $entryname = lc($1); 167 167 $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 } 171 173 $value = &process_latex($value); 172 174 … … 212 214 # The author metadata will be stored as one "Creator" entry, but we 213 215 # also want to split it into several individual "Author" fields in 214 # "Last ename, Firstnames" format so we can browse it.216 # "Lastname, Firstnames" format so we can browse it. 215 217 if ($entryname eq "author") { #added also comparison with editor 216 218 … … 421 423 # ring 422 424 # 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), 423 434 # macron 424 435 '=a' => chr(0xc4).chr(0x81), … … 476 487 'h' => chr(0xc4).chr(0xa7), 477 488 # 'H' => chr(0xc4).chr(0xa6), # !! this normally(!!?) means Hung. umlaut 489 'i' => chr(0xc4).chr(0xb1), # dotless lowercase i 478 490 'l' => chr(0xc5).chr(0x82), 479 491 'L' => chr(0xc5).chr(0x81), … … 492 504 493 505 # remove {} around a single character (eg \'{e}) 494 $text =~ s@(\\[`'=" ]){(\w)}@$1$2@;506 $text =~ s@(\\[`'="\.]){(\w)}@$1$2@g; 495 507 496 508 # remove {} around a single character for special 1 letter commands - … … 512 524 } 513 525 526 # remove latex commands 527 $text =~ s@\\\w+{([^}]*)}@$1@g; 528 514 529 # 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 520 533 521 534 # maths mode $...$ - this is not interpreted in any way at the moment...
Note:
See TracChangeset
for help on using the changeset viewer.