|
Lines 651-683
sub marc2bibtex {
Link Here
|
| 651 |
|
651 |
|
| 652 |
# Authors |
652 |
# Authors |
| 653 |
my $author; |
653 |
my $author; |
| 654 |
my @texauthors; |
654 |
my @texauthors; |
| 655 |
my ( $mintag, $maxtag, $fields_filter ); |
655 |
my @authorFields = ('100','110','111','700','710','711'); |
| 656 |
if ( $marcflavour eq "UNIMARC" ) { |
656 |
@authorFields = ('700','701','702','710','711','721') if ( $marcflavour eq "UNIMARC" ); |
| 657 |
$mintag = "700"; |
657 |
|
| 658 |
$maxtag = "712"; |
658 |
foreach my $field ( @authorFields ) { |
| 659 |
$fields_filter = '7..'; |
|
|
| 660 |
} |
| 661 |
else { |
| 662 |
$mintag = "700"; |
| 663 |
$maxtag = "720"; |
| 664 |
$fields_filter = '7..'; |
| 665 |
} |
| 666 |
foreach my $field ( $record->field($fields_filter) ) { |
| 667 |
next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; |
| 668 |
# author formatted surname, firstname |
659 |
# author formatted surname, firstname |
| 669 |
my $texauthor = ''; |
660 |
my $texauthor = ''; |
| 670 |
if ( $marcflavour eq "UNIMARC" ) { |
661 |
if ( $marcflavour eq "UNIMARC" ) { |
| 671 |
$texauthor = join ', ', |
662 |
$texauthor = join ', ', |
| 672 |
( $field->subfield('a'), $field->subfield('b') ); |
663 |
( $record->subfield($field,"a"), $record->subfield($field,"b") ); |
| 673 |
} |
664 |
} else { |
| 674 |
else { |
665 |
$texauthor = $record->subfield($field,"a"); |
| 675 |
$texauthor = $field->subfield('a'); |
666 |
} |
| 676 |
} |
667 |
push @texauthors, $texauthor if $texauthor; |
| 677 |
push @texauthors, $texauthor if $texauthor; |
|
|
| 678 |
} |
668 |
} |
| 679 |
$author = join ' and ', @texauthors; |
669 |
$author = join ' and ', @texauthors; |
| 680 |
|
670 |
|
| 681 |
# Defining the conversion hash according to the marcflavour |
671 |
# Defining the conversion hash according to the marcflavour |
| 682 |
my %bh; |
672 |
my %bh; |
| 683 |
if ( $marcflavour eq "UNIMARC" ) { |
673 |
if ( $marcflavour eq "UNIMARC" ) { |
|
Lines 726-732
sub marc2bibtex {
Link Here
|
| 726 |
} |
716 |
} |
| 727 |
|
717 |
|
| 728 |
$tex .= "\@book{"; |
718 |
$tex .= "\@book{"; |
| 729 |
$tex .= join(",\n", $id, map { $bh{$_} ? qq(\t$_ = "$bh{$_}") : () } keys %bh); |
719 |
$tex .= join(",\n", $id, map { $bh{$_} ? qq(\t$_ = {$bh{$_}}) : () } keys %bh); |
| 730 |
$tex .= "\n}\n"; |
720 |
$tex .= "\n}\n"; |
| 731 |
|
721 |
|
| 732 |
return $tex; |
722 |
return $tex; |
| 733 |
- |
|
|