texlive[46044] Master/texmf-dist: bibtexperllibs (10dec17)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 11 23:25:02 CET 2017


Revision: 46044
          http://tug.org/svn/texlive?view=revision&revision=46044
Author:   karl
Date:     2017-12-11 23:25:02 +0100 (Mon, 11 Dec 2017)
Log Message:
-----------
bibtexperllibs (10dec17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParser.3pm
    trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserAuthor.3pm
    trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserEntry.3pm
    trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm
    trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm
    trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib
    trunk/Master/texmf-dist/source/support/bibtexperllibs/Makefile
    trunk/Master/texmf-dist/source/support/bibtexperllibs/README

Added Paths:
-----------
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t
    trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib

Modified: trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParser.3pm
===================================================================
--- trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParser.3pm	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParser.3pm	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -132,8 +132,8 @@
 .rm #[ #] #H #V #F C
 .\" ========================================================================
 .\"
-.IX Title "BibTeX::Parser 3pm"
-.TH BibTeX::Parser 3pm "2017-03-18" "perl v5.20.2" "User Contributed Perl Documentation"
+.IX Title "BibTeX::Parser 3"
+.TH BibTeX::Parser 3 "2017-12-09" "perl v5.18.2" "User Contributed Perl Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -200,7 +200,7 @@
 BibTeX::Parser::Author
 .SH "VERSION"
 .IX Header "VERSION"
-version 1.00
+version 1.01
 .SH "AUTHOR"
 .IX Header "AUTHOR"
 Gerhard Gossen <gerhard.gossen at googlemail.com> and

Modified: trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserAuthor.3pm
===================================================================
--- trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserAuthor.3pm	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserAuthor.3pm	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -132,8 +132,8 @@
 .rm #[ #] #H #V #F C
 .\" ========================================================================
 .\"
-.IX Title "BibTeX::Parser::Author 3pm"
-.TH BibTeX::Parser::Author 3pm "2017-03-18" "perl v5.20.2" "User Contributed Perl Documentation"
+.IX Title "BibTeX::Parser::Author 3"
+.TH BibTeX::Parser::Author 3 "2017-12-09" "perl v5.18.2" "User Contributed Perl Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -203,7 +203,7 @@
 the following token is not: \f(CW\*(C`{von}\*(C'\fR
 .SH "VERSION"
 .IX Header "VERSION"
-version 1.00
+version 1.01
 .SH "AUTHOR"
 .IX Header "AUTHOR"
 Gerhard Gossen <gerhard.gossen at googlemail.com> and

Modified: trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserEntry.3pm
===================================================================
--- trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserEntry.3pm	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/doc/support/bibtexperllibs/BibTeXParserEntry.3pm	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -132,8 +132,8 @@
 .rm #[ #] #H #V #F C
 .\" ========================================================================
 .\"
-.IX Title "BibTeX::Parser::Entry 3pm"
-.TH BibTeX::Parser::Entry 3pm "2017-03-18" "perl v5.20.2" "User Contributed Perl Documentation"
+.IX Title "BibTeX::Parser::Entry 3"
+.TH BibTeX::Parser::Entry 3 "2017-12-09" "perl v5.18.2" "User Contributed Perl Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -216,19 +216,41 @@
 .SS "has($fieldname)"
 .IX Subsection "has($fieldname)"
 Returns a true value if this entry has a value for \f(CW$fieldname\fR.
+.SS "pre ()"
+.IX Subsection "pre ()"
+Return the text in BibTeX file before the entry
 .SS "raw_bibtex ()"
 .IX Subsection "raw_bibtex ()"
 Return raw BibTeX entry (if available).
 .SS "to_string ([options])"
 .IX Subsection "to_string ([options])"
-Returns a text of the BibTeX entry in BibTeX format.  Options is
-a hash.  Currently only the option \f(CW\*(C`canonize_names\*(C'\fR
-is supported.  If true (the default), authors' and editors' 
+Returns a text of the BibTeX entry in BibTeX format.  Options are
+a hash.
+.ie n .IP """canonize_names""" 4
+.el .IP "\f(CWcanonize_names\fR" 4
+.IX Item "canonize_names"
+If true (the default), authors' and editors' 
 names are translated into canonical bibtex form.  The command 
 \&\f(CW\*(C`$entry\->to_string(canonize_names=>0)\*(C'\fR overrides this behavior.
+.ie n .IP """field_capitalization""" 4
+.el .IP "\f(CWfield_capitalization\fR" 4
+.IX Item "field_capitalization"
+Capitalization of the field names.  
+Can take values 'Uppercase', 'Lowercase' (the default) or 'Titlecase'
+.ie n .IP """print_pre""" 4
+.el .IP "\f(CWprint_pre\fR" 4
+.IX Item "print_pre"
+False by default.  If true, the text in the Bib file before the
+entry is printed.  Note that at present we assume the text 
+before the entry \s-1NEVER\s0 has the @ symbol inside
+.ie n .IP """type_capitalization""" 4
+.el .IP "\f(CWtype_capitalization\fR" 4
+.IX Item "type_capitalization"
+Capitalization of the type names.  
+Can take values 'Uppercase' (the default), 'Lowercase' or 'Titlecase'
 .SH "VERSION"
 .IX Header "VERSION"
-version 1.00
+version 1.01
 .SH "AUTHOR"
 .IX Header "AUTHOR"
 Gerhard Gossen <gerhard.gossen at googlemail.com> and

Modified: trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,6 +1,6 @@
 package BibTeX::Parser::Author;
 {
-  $BibTeX::Parser::Author::VERSION = '1.00';
+  $BibTeX::Parser::Author::VERSION = '1.01';
 }
 
 use warnings;
@@ -393,7 +393,7 @@
 
 =head1 VERSION
 
-version 1.00
+version 1.01
 
 
 =head1 AUTHOR

Modified: trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,6 +1,6 @@
 package BibTeX::Parser::Entry;
 {
-  $BibTeX::Parser::Entry::VERSION = '1.00';
+  $BibTeX::Parser::Entry::VERSION = '1.01';
 }
 
 use warnings;
@@ -216,6 +216,15 @@
 	return $self->{_raw};
 }
 
+sub pre {
+	my $self = shift;
+	if (@_) {
+		$self->{_pre} = shift;
+	}
+	return $self->{_pre};
+}
+
+
 sub to_string {
     my $self = shift;
     my %options=@_;
@@ -222,11 +231,24 @@
     if (!exists($options{canonize_names})) {
 	$options{canonize_names}=1;
     }
-    my @fields = grep {!/^_/} keys %$self;	
+    my @fields = grep {!/^_/} keys %$self;
     @fields = sort {
 	$self->{_fieldnums}->{$a} <=> 
 	    $self->{_fieldnums}->{$b}} @fields;
-    my $result = '@'.$self->type."{".$self->key.",\n";
+    my $result = '';
+    if ($options{print_pre}) {
+	$result .= $self->pre()."\n";
+    }
+    my $type = $self->type;
+    if (exists($options{type_capitalization})) {
+	if ($options{type_capitalization} eq 'Lowercase') {
+	    $type = lc $type;
+	}
+	if ($options{type_capitalization} eq 'Titlecase') {
+	    $type = ucfirst lc $type;
+	}
+    }
+    $result .= '@'.$type."{".$self->key.",\n";    
     foreach my $field (@fields) {
 	my $value = $self->field($field);
 	if ($field eq 'author' && $options{canonize_names}) {
@@ -237,7 +259,15 @@
 	    my @names = ($self->editor);
 	    $value = join(' and ', @names);
 	}
-	$result .= "    $field = {"."$value"."},\n";
+	if (exists($options{field_capitalization})) {
+	    if ($options{field_capitalization} eq 'Uppercase') {
+		$field = uc $field;
+	    }
+	    if ($options{field_capitalization} eq 'Titlecase') {
+		$field = ucfirst  $field;
+	    }
+	}
+	$result .= "    $field = {"."$value"."},\n";	
     }
     $result .= "}";
     return $result;
@@ -343,6 +373,10 @@
 
 Returns a true value if this entry has a value for $fieldname.
 
+=head2 pre ()
+
+Return the text in BibTeX file before the entry
+
 =head2 raw_bibtex ()
 
 Return raw BibTeX entry (if available).
@@ -349,17 +383,40 @@
 
 =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' 
+Returns a text of the BibTeX entry in BibTeX format.  Options are
+a hash.  
+
+=over 4
+
+=item C<canonize_names>
+
+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.
 
+=item C<field_capitalization>
+
+Capitalization of the field names.  
+Can take values 'Uppercase', 'Lowercase' (the default) or 'Titlecase'
+
+=item C<print_pre>
+
+False by default.  If true, the text in the Bib file before the
+entry is printed.  Note that at present we assume the text 
+before the entry NEVER has the @ symbol inside
+
+=item C<type_capitalization>
+
+Capitalization of the type names.  
+Can take values 'Uppercase' (the default), 'Lowercase' or 'Titlecase'
+
+
+=back
+
 =head1 VERSION
 
-version 1.00
+version 1.01
 
-
 =head1 AUTHOR
 
 Gerhard Gossen <gerhard.gossen at googlemail.com> and

Modified: trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,6 +1,6 @@
 package BibTeX::Parser;
 {
-  $BibTeX::Parser::VERSION = '1.00';
+  $BibTeX::Parser::VERSION = '1.01';
 }
 # ABSTRACT: A pure perl BibTeX parser
 use warnings;
@@ -73,6 +73,14 @@
                 pos($_) = $position;
             }
 
+            # Remember text before the entry
+            my $pre = substr($_, 0, $start_pos-1);
+	    if ($start_pos == 0) {
+		$pre = '';
+	    }
+            $current_entry->pre($pre);
+
+
             # Remember raw bibtex code
             my $raw = substr($_, $start_pos);
             $raw =~ s/^\s+//;
@@ -141,7 +149,7 @@
     return $self->_parse_next;
 }
 
-# slurp everything till the next closing brace. Handels
+# slurp everything till the next closing brace. Handles
 # nested brackets
 sub _slurp_close_bracket {
     my $bracelevel = 0;
@@ -337,7 +345,7 @@
 
 =head1 VERSION
 
-version 1.00
+version 1.01
 
 
 =head1 AUTHOR

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,13 +1,21 @@
 Revision history for BibTeX-Parser
 
+1.01    2017-11-19 03:12:34 +0000
+        New options for to_string:
+        - print_pre - whether to print text preceding the entry
+        - type_capitalization ('Uppercase', 'Lowercase',
+                               'Titlecase')
+        - field_capitalization ('Uppercase', 'Lowercase',
+                                'Titlecase')
+
 1.00    2017-03-18 21:53:15+00:00
-	Typo corrected:  editors -> editor
+        Typo corrected:  editors -> editor
 
 0.70    2016-11-23 02:28:35+00:00
         Compatibility with perl 5.25 (Alexandr Ciornii)
 
 0.69    2016-03-24 15:13:50-04:00
-	Added option canonize_names to Entry::to_string
+        Added option canonize_names to Entry::to_string
 
 0.68    2016-03-10 13:45:31-05:00
         Now we preserve the order of entries
@@ -21,13 +29,13 @@
         No Do not remove braces from the authors' names
 
 0.65    2013-09-03 21:04:43
-	Add links in documentation.
+        Add links in documentation.
 
 0.64    2012-03-10 22:23:50
         Remove a warning about undefined value.
 
 0.63    2011-03-15 23:08:18
-	Parse files with errors (no keys, spaces in wrong positions). Bug #66325
+        Parse files with errors (no keys, spaces in wrong positions). Bug #66325
 
 0.62    2010-10-15 08:52:53
         Declare Test::More minimum version with done_testing
@@ -43,27 +51,27 @@
         Do not attempt to clean up returned values
         Author names with braces are split correctly
 
-0.4 	2010-02-09
-	Parsing of quoted author names (e.g. "{Foo and Bar, Inc.}")
+0.4     2010-02-09
+        Parsing of quoted author names (e.g. "{Foo and Bar, Inc.}")
 
-0.3.2 	2009-07-26
-	Removed dependency on Text::Balanced
+0.3.2   2009-07-26
+        Removed dependency on Text::Balanced
 
 0.3.1   2009-07-19
-	No changes, removed huge test file from dist
+        No changes, removed huge test file from dist
 
 0.3     2009-07-18
-	Better parsing of author names,
-	new Method B::P::Entry->raw_bibtex
-	Removed Module::Install from package
+        Better parsing of author names,
+        new Method B::P::Entry->raw_bibtex
+        Removed Module::Install from package
 
-0.21	2009-01-23
-	Fixed errors in synopsis.
+0.21    2009-01-23
+        Fixed errors in synopsis.
 
-0.2	2008-12-30
-	First public release.
+0.2     2008-12-30
+        First public release.
 
-0.1	2008-03-14 
+0.1     2008-03-14 
         First version, internal
 
 

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST	2017-12-11 22:25:02 UTC (rev 46044)
@@ -23,10 +23,13 @@
 t/11-split_braced.t
 t/12-von_token.t
 t/13_output.t
+t/14-extratext.t
+t/15-capitalization.t
 t/bibs/01.bib
 t/bibs/06.bib
 t/bibs/09-complex.bib
 t/bibs/10-funnyname.bib
+t/bibs/14-extratext.bib
 t/bibs/braces.bib
 t/bibs/endnote.txt
 t/bibs/engineering_village.txt

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml	2017-12-11 22:25:02 UTC (rev 46044)
@@ -20,4 +20,4 @@
   IO::String: 0
   LaTeX::ToUnicode: 0.02
   Test::More: 0
-version: 1.00
+version: 1.01

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL	2017-12-11 22:25:02 UTC (rev 46044)
@@ -29,7 +29,7 @@
   "TEST_REQUIRES" => {
     "Test::More" => "0.88"
   },
-  "VERSION" => "1.00",
+  "VERSION" => "1.01",
   "test" => {
     "TESTS" => "t/*.t"
   }

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,5 +1,5 @@
 This archive contains the distribution BibTeX-Parser,
-version 1.00:
+version 1.01:
 
   A pure perl BibTeX parser
 
@@ -8,5 +8,3 @@
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
 
-
-

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,5 +1,5 @@
 name    = BibTeX-Parser
-version = 1.00
+version = 1.01
 author  = Gerhard Gossen <gerhard.gossen at googlemail.com> and Boris Veytsman <boris at varphi.com>
 license = Perl_5
 copyright_holder = Gerhard Gossen and Boris Veytsman

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t	                        (rev 0)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t	2017-12-11 22:25:02 UTC (rev 46044)
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+
+
+use Test::More tests => 6;
+
+use BibTeX::Parser;
+use IO::File;
+
+
+my $fh = new IO::File "t/bibs/14-extratext.bib", "r" ;
+
+my $parser = new BibTeX::Parser $fh;
+
+
+
+
+while (my $entry = $parser->next) {
+
+    if($entry->key eq 'Partridge') {
+	my $result1= '@BOOK{Partridge,
+    author = {Partridge, Eric},
+    title = {Use and Abuse: a Guide to Good {E}nglish},
+    publisher = {Hamish Hamilton},
+    edition = {4},
+    year = {1970},
+}';
+	my $result2 = "First published in 1947\n$result1";
+	is($entry->to_string,$result1);
+	is($entry->to_string(print_pre=>1),$result2);
+    }
+	    
+    if ($entry->key eq 'Cooper') {
+	my $result1 = '@BOOK{Cooper,
+    author = {Cooper, Bruce M.},
+    title = {Writing Technical Reports},
+    publisher = {Penguin},
+    year = {1964},
+}';
+	my $result2 = "\n\n$result1";
+	is($entry->to_string,$result1);
+	is($entry->to_string(print_pre=>1),$result2);
+    }
+
+
+    if ($entry->key eq 'Fowler-ModernEnglish') {
+
+	my $result1 = '@BOOK{Fowler-ModernEnglish,
+    author = {Fowler, H. W.},
+    title = {[A Dictionary of] Modern {E}nglish Usage},
+    publisher = {Oxford University Press},
+    edition = {2},
+    year = {1965},
+}';
+	my $result2 = '
+
+
+First published in 1926
+'. $result1;
+	is($entry->to_string,$result1);
+	is($entry->to_string(print_pre=>1),$result2);
+    }
+}
+
+done_testing();
+

Added: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t	                        (rev 0)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t	2017-12-11 22:25:02 UTC (rev 46044)
@@ -0,0 +1,72 @@
+#!/usr/bin/perl -w
+
+use Test::More tests=>7;
+
+use BibTeX::Parser;
+use IO::File;
+
+
+my $fh = new IO::File "t/bibs/01.bib", "r" ;
+
+my $parser = new BibTeX::Parser $fh;
+
+
+
+
+while (my $entry = $parser->next) {
+    if($entry->key eq 'key01') {
+	my $result1='@ARTICLE{key01,
+    year = {1950},
+    author = {Duck, Donald and Else, Someone},
+    editor = {Itor, E. D. and Other, A. N.},
+    title = {Title text},
+    month = {January~1},
+}';
+	my $result2='@ARTICLE{key01,
+    YEAR = {1950},
+    AUTHOR = {Duck, Donald and Else, Someone},
+    EDITOR = {Itor, E. D. and Other, A. N.},
+    TITLE = {Title text},
+    MONTH = {January~1},
+}';
+	my $result3='@ARTICLE{key01,
+    Year = {1950},
+    Author = {Duck, Donald and Else, Someone},
+    Editor = {Itor, E. D. and Other, A. N.},
+    Title = {Title text},
+    Month = {January~1},
+}';
+	my $result4='@article{key01,
+    year = {1950},
+    author = {Duck, Donald and Else, Someone},
+    editor = {Itor, E. D. and Other, A. N.},
+    title = {Title text},
+    month = {January~1},
+}';
+	my $result5='@Article{key01,
+    year = {1950},
+    author = {Duck, Donald and Else, Someone},
+    editor = {Itor, E. D. and Other, A. N.},
+    title = {Title text},
+    month = {January~1},
+}';
+    is($entry->to_string,$result1);	
+    is($entry->to_string(field_capitalization=>'Lowercase'),
+			 $result1);	
+    is($entry->to_string(field_capitalization=>'Uppercase'),
+			 $result2);	
+    is($entry->to_string(field_capitalization=>'Titlecase'),
+			 $result3);	
+
+    is($entry->to_string(type_capitalization=>'Lowercase'),
+			 $result4);	
+    is($entry->to_string(type_capitalization=>'Uppercase'),
+			 $result1);	
+    is($entry->to_string(type_capitalization=>'Titlecase'),
+			 $result5);	
+    }
+
+}
+
+done_testing();
+

Added: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib	                        (rev 0)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib	2017-12-11 22:25:02 UTC (rev 46044)
@@ -0,0 +1,22 @@
+First published in 1947
+ at BOOK{Partridge,
+   AUTHOR="Eric Partridge",
+   TITLE="Use and Abuse: a Guide to Good {E}nglish",
+   PUBLISHER="Hamish Hamilton",
+   EDITION="4", YEAR="1970"}
+
+
+ at BOOK{Cooper,
+   AUTHOR="Bruce M. Cooper",
+   TITLE="Writing Technical Reports",
+   PUBLISHER="Penguin", YEAR="1964"}
+
+
+
+First published in 1926
+ at BOOK{Fowler-ModernEnglish,
+   AUTHOR="H. W. Fowler",
+   TITLE="[A Dictionary of] Modern {E}nglish Usage",
+   PUBLISHER="Oxford University Press",
+   EDITION="2", YEAR="1965"}
+


Property changes on: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,4 +1,4 @@
-$Id: english.bib,v 1.5 2017/03/19 19:14:20 boris Exp $
+$Id: english.bib,v 1.6 2017/12/10 02:43:44 boris Exp $
 
 Please notify Adrian F Clark <alien at uk.ac.essex.ese> of any additions
 or corrections to this list.

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/Makefile
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/Makefile	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/Makefile	2017-12-11 22:25:02 UTC (rev 46044)
@@ -19,4 +19,4 @@
 	for dir in ${DIRS}; do cd $$dir; ${MAKE} -f Makefile.TDS install; cd ..; done
 
 archive:
-	tar -czvf $(PACKAGE).tgz -C .. --exclude '*~' --exclude '*.tgz' --exclude CVS $(PACKAGE)
+	COPYFILE_DISABLE=1 tar -czvf $(PACKAGE).tgz -C .. --exclude '*~' --exclude '*.tgz' --exclude CVS $(PACKAGE)

Modified: trunk/Master/texmf-dist/source/support/bibtexperllibs/README
===================================================================
--- trunk/Master/texmf-dist/source/support/bibtexperllibs/README	2017-12-11 22:24:36 UTC (rev 46043)
+++ trunk/Master/texmf-dist/source/support/bibtexperllibs/README	2017-12-11 22:25:02 UTC (rev 46044)
@@ -1,5 +1,5 @@
 			   BibTeX Perl Libs
-			     Version 1.3
+			     Version 1.4
 		  Gerhard Gossen and Boris Veytsman
 
 This package provides BibTeX related Perl libraries by Gerhard Gossen,
@@ -12,6 +12,8 @@
 
 Changes:
 
+  version 1.4  Upgraded BibTeX::Parser to 1.01
+
   version 1.3  Upgraded BibTeX::Parser to 1.00
 
   version 1.2  Upgraded BibTeX::Parser to v0.70 and LaTeX::ToUnicode to 0.05



More information about the tex-live-commits mailing list