diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-25 22:06:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-25 22:06:44 +0000 |
commit | ff79e08c4e182a0ca600f033c8baa842056f92f9 (patch) | |
tree | a5cf18fac0e1ce9a0193c9b5c08070bf18e366e1 /Master/texmf-dist/scripts | |
parent | f9e5222a931d1b2671fa84b5c93a4605c00c2373 (diff) |
bibtexperllibs (25mar16)
git-svn-id: svn://tug.org/texlive/trunk@40139 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
3 files changed, 35 insertions, 43 deletions
diff --git a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm index 607e661e112..5f0354f403b 100644 --- a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm +++ b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm @@ -1,6 +1,6 @@ package BibTeX::Parser; { - $BibTeX::Parser::VERSION = '0.68'; + $BibTeX::Parser::VERSION = '0.69'; } # ABSTRACT: A pure perl BibTeX parser use warnings; @@ -265,9 +265,6 @@ __END__ BibTeX::Parser - A pure perl BibTeX parser -=head1 VERSION - -version 0.66 =head1 SYNOPSIS @@ -302,15 +299,7 @@ Parses BibTeX files. } } -=for stopwords jr von - -=head1 NAME - -BibTeX::Parser - A pure perl BibTeX parser - -=head1 VERSION -version 0.65 =head1 FUNCTIONS @@ -346,6 +335,11 @@ L<BibTeX::Parser::Author> =back +=head1 VERSION + +version 0.69 + + =head1 AUTHOR Gerhard Gossen <gerhard.gossen@googlemail.com> and @@ -353,7 +347,7 @@ Boris Veytsman <boris@varphi.com> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2013-2015 by Gerhard Gossen and Boris Veytsman +This software is copyright (c) 2013-2016 by Gerhard Gossen and Boris Veytsman This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm index fbd532211b4..c19bd885776 100644 --- a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm +++ b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm @@ -1,6 +1,6 @@ package BibTeX::Parser::Author; { - $BibTeX::Parser::Author::VERSION = '0.68'; + $BibTeX::Parser::Author::VERSION = '0.69'; } use warnings; @@ -309,11 +309,7 @@ __END__ =head1 NAME -BibTeX::Parser::Author - -=head1 VERSION - -version 0.65 +BibTeX::Author - Contains a single author for a BibTeX document. =head1 SYNOPSIS @@ -333,13 +329,7 @@ by a BibTeX::Parser. my ($first, $von, $last, $jr) = BibTeX::Author->split($fullname); -=head1 NAME -BibTeX::Author - Contains a single author for a BibTeX document. - -=head1 VERSION - -version 0.66 =head1 FUNCTIONS @@ -401,6 +391,11 @@ Anything in a "special characters" is on brace level 0. Thus the following tokens are considered von parts: C<von>, C<\NOOP{von}Von>, and the following token is not: C<{von}> +=head1 VERSION + +version 0.69 + + =head1 AUTHOR Gerhard Gossen <gerhard.gossen@googlemail.com> and @@ -408,7 +403,7 @@ Boris Veytsman <boris@varphi.com> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2013--2015 by Gerhard Gossen and Boris Veytsman. +This software is copyright (c) 2013--2016 by Gerhard Gossen and Boris Veytsman. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm index 6986f0a6608..9e6ab110c0c 100644 --- a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm +++ b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm @@ -1,6 +1,6 @@ package BibTeX::Parser::Entry; { - $BibTeX::Parser::Entry::VERSION = '0.68'; + $BibTeX::Parser::Entry::VERSION = '0.69'; } use warnings; @@ -218,6 +218,10 @@ sub raw_bibtex { sub to_string { my $self = shift; + my %options=@_; + if (!exists($options{canonize_names})) { + $options{canonize_names}=1; + } my @fields = grep {!/^_/} keys %$self; @fields = sort { $self->{_fieldnums}->{$a} <=> @@ -225,11 +229,11 @@ sub to_string { my $result = '@'.$self->type."{".$self->key.",\n"; foreach my $field (@fields) { my $value = $self->field($field); - if ($field eq 'author') { + if ($field eq 'author' && $options{canonize_names}) { my @names = ($self->author); $value = join(' and ', @names); } - if ($field eq 'editor') { + if ($field eq 'editor' && $options{canonize_names}) { my @names = ($self->editors); $value = join(' and ', @names); } @@ -246,11 +250,7 @@ __END__ =head1 NAME -BibTeX::Parser::Entry - -=head1 VERSION - -version 0.66 +BibTeX::Parser::Entry - Contains a single entry of a BibTeX document. =head1 SYNOPSIS @@ -275,13 +275,7 @@ by a BibTeX::Parser. -=head1 NAME - -BibTeX::Parser::Entry - Contains a single entry of a BibTeX document. - -=head1 VERSION -version 0.66 =head1 FUNCTIONS @@ -353,9 +347,18 @@ Returns a true value if this entry has a value for $fieldname. Return raw BibTeX entry (if available). -=head2 to_string () +=head2 to_string ([options]) + +Returns a text of the BibTeX entry in BibTeX format. Options is +a hash. Currently only the option C<canonize_names> +is supported. If true (the default), authors' and editors' +names are translated into canonical bibtex form. The command +C<$entry-E<gt>to_string(canonize_names=E<gt>0)> overrides this behavior. + +=head1 VERSION + +version 0.69 -Returns a text of the BibTeX entry in BibTeX format =head1 AUTHOR @@ -364,7 +367,7 @@ Boris Veytsman <boris@varphi.com> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2013-2015 by Gerhard Gossen and Boris Veytsman +This software is copyright (c) 2013-2016 by Gerhard Gossen and Boris Veytsman This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. |