texlive[43866] trunk: crossrefware (14apr17)

commits+karl at tug.org commits+karl at tug.org
Mon Apr 17 00:25:15 CEST 2017


Revision: 43866
          http://tug.org/svn/texlive?view=revision&revision=43866
Author:   karl
Date:     2017-04-17 00:25:15 +0200 (Mon, 17 Apr 2017)
Log Message:
-----------
crossrefware (14apr17)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
    trunk/Build/source/texk/texlive/linked_scripts/Makefile.in
    trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
    trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
    trunk/Build/source/texk/texlive/linked_scripts/scripts.lst
    trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1
    trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1
    trunk/Master/texmf-dist/doc/man/man1/bibzbladd.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.1
    trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.man1.pdf
    trunk/Master/texmf-dist/doc/support/crossrefware/Makefile
    trunk/Master/texmf-dist/doc/support/crossrefware/README
    trunk/Master/texmf-dist/doc/support/crossrefware/crossrefware.pdf
    trunk/Master/texmf-dist/doc/support/crossrefware/head.ltx
    trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl
    trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl
    trunk/Master/texmf-dist/tex/latex/crossrefware/bibdoiadd.cfg
    trunk/Master/tlpkg/tlpsrc/crossrefware.tlpsrc

Added Paths:
-----------
    trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
    trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
    trunk/Master/bin/amd64-freebsd/bbl2bib
    trunk/Master/bin/amd64-freebsd/bibmradd
    trunk/Master/bin/amd64-netbsd/bbl2bib
    trunk/Master/bin/amd64-netbsd/bibmradd
    trunk/Master/bin/armel-linux/bbl2bib
    trunk/Master/bin/armel-linux/bibmradd
    trunk/Master/bin/armhf-linux/bbl2bib
    trunk/Master/bin/armhf-linux/bibmradd
    trunk/Master/bin/i386-cygwin/bbl2bib
    trunk/Master/bin/i386-cygwin/bibmradd
    trunk/Master/bin/i386-freebsd/bbl2bib
    trunk/Master/bin/i386-freebsd/bibmradd
    trunk/Master/bin/i386-linux/bbl2bib
    trunk/Master/bin/i386-linux/bibmradd
    trunk/Master/bin/i386-netbsd/bbl2bib
    trunk/Master/bin/i386-netbsd/bibmradd
    trunk/Master/bin/i386-solaris/bbl2bib
    trunk/Master/bin/i386-solaris/bibmradd
    trunk/Master/bin/powerpc-linux/bbl2bib
    trunk/Master/bin/powerpc-linux/bibmradd
    trunk/Master/bin/sparc-solaris/bbl2bib
    trunk/Master/bin/sparc-solaris/bibmradd
    trunk/Master/bin/universal-darwin/bbl2bib
    trunk/Master/bin/universal-darwin/bibmradd
    trunk/Master/bin/win32/bbl2bib.exe
    trunk/Master/bin/win32/bibmradd.exe
    trunk/Master/bin/x86_64-cygwin/bbl2bib
    trunk/Master/bin/x86_64-cygwin/bibmradd
    trunk/Master/bin/x86_64-darwin/bbl2bib
    trunk/Master/bin/x86_64-darwin/bibmradd
    trunk/Master/bin/x86_64-linux/bbl2bib
    trunk/Master/bin/x86_64-linux/bibmradd
    trunk/Master/bin/x86_64-solaris/bbl2bib
    trunk/Master/bin/x86_64-solaris/bibmradd
    trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1
    trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/bibmradd.1
    trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf
    trunk/Master/texmf-dist/doc/support/crossrefware/ltx2crossrefxml.exe
    trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
    trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl

Modified: trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/Makefile.am	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Build/source/texk/texlive/linked_scripts/Makefile.am	2017-04-16 22:25:15 UTC (rev 43866)
@@ -97,7 +97,9 @@
 	cjk-gs-integrate/cjk-gs-integrate.pl \
 	context/perl/mptopdf.pl \
 	convbkmk/convbkmk.rb \
+	crossrefware/bbl2bib.pl \
 	crossrefware/bibdoiadd.pl \
+	crossrefware/bibmradd.pl \
 	crossrefware/bibzbladd.pl \
 	crossrefware/ltx2crossrefxml.pl \
 	ctanify/ctanify \

Modified: trunk/Build/source/texk/texlive/linked_scripts/Makefile.in
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/Makefile.in	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Build/source/texk/texlive/linked_scripts/Makefile.in	2017-04-16 22:25:15 UTC (rev 43866)
@@ -312,7 +312,9 @@
 	cjk-gs-integrate/cjk-gs-integrate.pl \
 	context/perl/mptopdf.pl \
 	convbkmk/convbkmk.rb \
+	crossrefware/bbl2bib.pl \
 	crossrefware/bibdoiadd.pl \
+	crossrefware/bibmradd.pl \
 	crossrefware/bibzbladd.pl \
 	crossrefware/ltx2crossrefxml.pl \
 	ctanify/ctanify \

Added: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl	                        (rev 0)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1,259 @@
+#!/usr/bin/env perl
+
+=pod
+
+=head1 NAME
+
+bbl2bib.pl - convert thebibliography environment to a bib file
+
+=head1 SYNOPSIS
+
+bbl2bib.pl [B<-o> I<output>] I<file>
+
+=head1 OPTIONS
+
+=over 4
+
+
+
+=item B<-o> I<output>
+
+Output file.  If this option is not used, the name for the 
+output file is formed by changing the extension to C<.bib>
+
+
+=back
+
+=head1 DESCRIPTION
+
+The script tries to reconstruct a C<bib> file from the corresponding
+C<thebibliography> environment.  One can argue that this operation is
+akin to reconstructing a cow from the steak.  The way the script does
+it is searching for the entry in the MR database, and
+creating the corresponding BibTeX fields.
+
+The script reads a TeX or Bbl file and extracts from it the
+C<thebibliography> environment.  For each bibitem it creates a plain
+text bibliography entry, and then  tries to match it in
+the database.  
+=head1 INPUT FILE
+
+We assume some structure of the input file:
+
+=over 4
+
+=item 1.
+
+The bibliography is contained between the lines
+
+   \begin{thebibliography}...
+
+and
+
+   \end{thebibliography}
+
+=item 2.
+
+Each bibliography item starts from the line 
+
+   \bibitem[...]{....}
+
+=back
+
+
+
+=head1 EXAMPLES
+
+   bbl2bib  -o - file.tex > result.bib
+   bbl2bib  -o result.bib file.bbl
+   bbl2bib  file.tex
+
+=head1 AUTHOR
+
+Boris Veytsman
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014-2017  Boris Veytsman
+
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+L<http://www.gnu.org/licenses/gpl.html>.  There is NO WARRANTY, to the
+extent permitted by law.
+
+=cut
+
+use strict;
+BEGIN {
+    # find files relative to our installed location within TeX Live
+    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
+    if (length($TLMaster)) {
+	unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
+    }
+}
+use IO::File;
+use BibTeX::Parser;
+use FileHandle;
+use LaTeX::ToUnicode qw (convert);
+use Getopt::Std;
+use URI::Escape;
+use LWP::Simple;
+
+my $USAGE="USAGE: $0 [-o output] file\n";
+my $VERSION = <<END;
+bbl2bib v2.1
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
+extent permitted by law.
+$USAGE
+END
+our %opts;
+getopts('c:o:s:hV',\%opts) or die $USAGE;
+
+if ($opts{h} || $opts{V}){
+    print $VERSION;
+    exit 0;
+}
+
+################################################################
+# Defaults and parameters
+################################################################
+
+my $inputfile = shift;
+
+my $outputfile = $inputfile;
+
+$outputfile =~ s/\.([^\.]*)$/.bib/;
+
+if (exists $opts{o}) {
+    $outputfile = $opts{o};
+}
+
+
+
+my $input= IO::File->new($inputfile) or 
+    die "Cannot find Bbl or TeX file $inputfile\n$USAGE\n";
+my $output = IO::File->new("> $outputfile") or 
+    die "Cannot write to $outputfile\n$USAGE\n";
+
+my $userAgent = LWP::UserAgent->new;
+
+
+# Bibitem is a hash with the entries 'key', 'text', 'mr',
+#  'zbl'
+my $bibitem;
+
+while (<$input>) {
+    if (!(/\\begin\{thebibliography\}/../\\end\{thebibliography\}/) ||
+	/\\begin\{thebibliography\}/ || /\\end\{thebibliography\}/) {
+	next;
+    }
+    if (/\\bibitem(\[[^\]]*\])?\{([^\}]*)\}/) {
+	ProcessBibitem($bibitem);
+	$bibitem = undef;
+	$bibitem->{key}=$2;
+	$bibitem->{text}="";
+    }
+    if (!/^\s*$/) {
+	$bibitem -> {text} .= $_;
+    }
+}
+ProcessBibitem($bibitem);
+
+
+exit 0;
+
+sub ProcessBibitem {
+    my $bibitem = shift;
+    my $key = $bibitem->{key};
+    my $text=$bibitem->{text};
+    if (!length($text) || $text =~ /^\s+$/s) {
+	return;
+    }
+
+    my $printtext = $text;
+    $printtext =~ s/^(.)/% $1/mg;
+    print $output "$printtext";
+    $text =~ s/\n/ /mg;
+    $text =~ s/\\bibitem(\[[^\]]*\])?\{[^\}]*\}//;
+
+    # Arxiv entry?
+    if ($text =~ s/\\arxiv\{([^\}]+)\}\.?//) {
+	$bibitem->{arxiv}=$1;
+    }
+
+    # Mr number exists?
+    if ($text =~ s/\\mr\{([^\}]+)\}\.?//) {
+	$bibitem->{mr}=$1;
+    }
+
+    # zbl  number exists?
+    if ($text =~ s/\\zbl\{([^\}]+)\}\.?//) {
+	$bibitem->{zbl}=$1;
+    }
+
+    # doi  number exists?
+    if ($text =~ s/\\doi\{([^\}]+)\}\.?//) {
+	$bibitem->{doi}=$1;
+    }
+
+    $bibitem->{bib} = SearchMref($bibitem);
+    PrintBibitem($bibitem);
+    return;
+}
+
+
+sub SearchMref {
+    my $bibitem = shift;
+    my $mirror = "http://www.ams.org/mathscinet-mref";
+    my $string=uri_escape_utf8($bibitem->{text});
+    my $response = $userAgent->get("$mirror?ref=$string&dataType=bibtex") ->
+	decoded_content();
+    if ($response =~ /<pre>(.*)<\/pre>/s) {
+	my $bib= $1;
+	my $fh = new FileHandle;
+	open $fh, "<", \$bib;
+	my $parser = new BibTeX::Parser($fh);
+	my $entry = $parser->next;
+	if ($entry->parse_ok()) {
+	    $entry->key($bibitem->{key});
+	    return ($entry);
+	}
+    }
+}
+
+
+
+
+sub PrintBibitem {
+    print "\n";
+    my $bibitem = shift;
+    if (!ref($bibitem->{bib})) {
+	return;
+    }
+    my $entry=$bibitem->{bib};
+    if ($bibitem->{mr} && ! $entry->field('mrnumber')) {
+	$entry->field('mrnumber', $bibitem->{mr});
+    }
+    if ($entry->field('mrnumber')) {
+	my $mr=$entry->field('mrnumber');
+	while (length($mr)<7) {
+	    $mr = "0$mr";
+	}
+	$mr=$entry->field('mrnumber', $mr);
+    }
+    if ($bibitem->{zbl} && ! $entry->field('zblnumber')) {
+	$entry->field('zblnumber', $bibitem->{zbl});
+    }
+    if ($bibitem->{doi} && ! $entry->field('doi')) {
+	$entry->field('doi', $bibitem->{doi});
+    }
+    if ($bibitem->{arxiv} && ! $entry->field('arxiv')) {
+	$entry->field('arxiv', $bibitem->{arxiv});
+    }
+	
+    print $entry->to_string(), "\n\n";
+}
+
+


Property changes on: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-bibdoiadd [B<-c> I<config_file>] [B<-f>] [B<-o> I<output>] I<bib_file>
+bibdoiadd [B<-c> I<config_file>] [B<-e> 1|0] [B<-f>] [B<-o> I<output>] I<bib_file>
 
 =head1 OPTIONS
 
@@ -19,6 +19,12 @@
 Configuration file.  If this file is absent, some defaults are used.
 See below for its format.
 
+=item B<-e>
+
+If 1 (default), add empty doi if a doi cannot be found.  This prevents
+repeated searches for the same entries if you add new entries to the
+file.  Calling C<-e 0> suppresses this behavior.
+
 =item B<-f>
 
 Force checking doi number even if one is present
@@ -59,7 +65,7 @@
 
    $field = value ;
 
-The important parameters are C<$mode> (C<'free'> or C<'paid'>,
+The important parameters are C<$mode> (C<'free'> or C<'paid'>),
 C<$email> (for free users) and C<$username> & C<$password> for paid
 members.
 
@@ -66,8 +72,8 @@
 
 =head1 EXAMPLES
 
-   bibdoiadd -c bibdoiadd.cfg citations.bib > result.bib
-   bibdoiadd -c bibdoiadd.cfg citations.bib -o result.bib
+   bibdoiadd -c bibdoiadd.cfg -o - citations.bib > result.bib
+   bibdoiadd -c bibdoiadd.cfg -o result.bib citations.bib 
 
 =head1 AUTHOR
 
@@ -75,7 +81,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014-2016  Boris Veytsman
+Copyright (C) 2014-2017  Boris Veytsman
 
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
@@ -99,9 +105,9 @@
 use URI::Escape;
 use LWP::Simple;
 
-my $USAGE="USAGE: $0 [-c config] [-f] [-o output] file\n";
+my $USAGE="USAGE: $0 [-c config] [-e 1|0] [-f] [-o output] file\n";
 my $VERSION = <<END;
-bibdoiadd v2.0
+bibdoiadd v2.1
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
 http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
@@ -108,8 +114,8 @@
 extent permitted by law.
 $USAGE
 END
-my %opts;
-getopts('fc:o:hV',\%opts) or die $USAGE;
+our %opts;
+getopts('fe:c:o:hV',\%opts) or die $USAGE;
 
 if ($opts{h} || $opts{V}){
     print $VERSION;
@@ -126,13 +132,16 @@
 
 $outputfile =~ s/\.([^\.]*)$/_doi.$1/;
 
-if ($opts{o}) {
+if (exists $opts{o}) {
     $outputfile = $opts{o};
 }
 
 my $forceSearch=$opts{f};
+my $forceEmpty = 1;
+if (exists $opts{e}) {
+    $forceEmpty = $opts{e};
+}		
 
-
 our $mode='free';
 our $email;
 our $username;
@@ -196,7 +205,7 @@
     
 
      my $doi = GetDoi($prefix, $entry);
-     if (length($doi)) {
+     if (length($doi) || $forceEmpty) {
  	$entry->field('doi',$doi);
      }
     print $output $entry->to_string(), "\n\n";

Added: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl	                        (rev 0)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1,210 @@
+#!/usr/bin/env perl
+
+=pod
+
+=head1 NAME
+
+bibmradd.pl - add MR numbers to papers in a given bib file
+
+=head1 SYNOPSIS
+
+bibmradd  [-d] [B<-f>] [B<-e> 1|0] [B<-o> I<output>] I<bib_file>
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-d>
+
+Debug mode
+
+=item B<-e>
+
+If 1 (default), add an empty mrnumber if a mr cannot be found.  This
+prevents repeated searches for the same entries if you add new entries
+to the file.  Calling C<-e 0> suppresses this behavior.
+
+
+=item B<-f>
+
+Force searching for MR numbers even if the entry already has one.
+
+=item B<-o> I<output>
+
+Output file.  If this option is not used, the name for the 
+output file is formed by adding C<_mr> to the input file
+
+=back
+
+=head1 DESCRIPTION
+
+The script reads a BibTeX file.  It checks whether the entries have
+mrnumberss.  If not, tries to contact internet to get the numbers.  The
+result is a BibTeX file with the fields 
+C<mrnumber=...> added.  
+
+The name of the output file is either set by the B<-o> option or 
+is derived by adding the suffix C<_mr> to the output file.
+
+=head1 AUTHOR
+
+Boris Veytsman
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014-2017  Boris Veytsman
+
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+L<http://www.gnu.org/licenses/gpl.html>.  There is NO WARRANTY, to the
+extent permitted by law.
+
+=cut
+
+use strict;
+BEGIN {
+    # find files relative to our installed location within TeX Live
+    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
+    if (length($TLMaster)) {
+	unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
+    }
+}
+use IO::File;
+use BibTeX::Parser;
+use Getopt::Std;
+use URI::Escape;
+use LWP::UserAgent;
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
+
+my $USAGE="USAGE: $0  [-d] [-e 1|0] [-f] [-o output] file\n";
+my $VERSION = <<END;
+bibmradd v2.1
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
+extent permitted by law.
+$USAGE
+END
+my %opts;
+getopts('de:fo:hV',\%opts) or die $USAGE;
+
+if ($opts{h} || $opts{V}){
+    print $VERSION;
+    exit 0;
+}
+
+################################################################
+# Defaults and parameters
+################################################################
+
+my $inputfile = shift;
+
+my $outputfile = $inputfile;
+
+$outputfile =~ s/\.([^\.]*)$/_mr.$1/;
+
+if ($opts{o}) {
+    $outputfile = $opts{o};
+}
+
+my $forceSearch=$opts{f};
+
+my $forceEmpty = 1;
+if (exists $opts{e}) {
+    $forceEmpty = $opts{e};
+}		
+
+my $debug = $opts{d};
+
+my $input= IO::File->new($inputfile) or 
+    die "Cannot find BibTeX file $inputfile\n$USAGE\n";
+my $output = IO::File->new("> $outputfile") or 
+    die "Cannot write to $outputfile\n$USAGE\n";
+
+my $parser=new BibTeX::Parser($input);
+
+
+
+# Creating the HTTP parameters
+my $mirror =
+    "http://www.ams.org/mathscinet-mref";
+my $userAgent = LWP::UserAgent->new;
+
+while (my $entry = $parser->next ) {
+    if (!$entry->parse_ok()) {
+	print STDERR "Cannot understand entry: ";
+	$entry->print(*STDERR);
+	print STDERR "Skipping this entry\n";
+	next;
+    }
+    if ($entry->has('mrnumber') && !$forceSearch) {
+	print $output $entry->raw_bibtex(), "\n\n";
+	if ($debug) {
+	    print STDERR "DEBUG:  entry ", $entry->key(), 
+	    " has mrnumber ", $entry->field('mrnumber'), 
+	    " and no forced search is requested\n";
+	}
+	next;
+    }
+    
+
+     # Now we have an entry with no MR.  Let us get to work.
+    if ($debug) {
+	print STDERR "DEBUG:  Searching for mr number for entry ",
+	$entry->key, "\n";
+    }
+     my $mr = GetMr($entry, $userAgent, $mirror);
+     if (length($mr) || $forceEmpty) {
+ 	$entry->field('mrnumber', $mr);
+     }
+    print $output $entry->to_string(), "\n\n";
+
+}
+
+$input->close();
+$output->close();
+exit 0;
+
+###############################################################
+#  Getting one MR
+###############################################################
+
+sub GetMr {
+    my $entry=shift;
+    my $userAgent=shift;
+    my $mirror=shift;
+    
+    my @query;
+
+    my $string=uri_escape_utf8($entry->to_string());
+    
+    if ($debug) {
+	print STDERR "DEBUG:  query: $mirror?ref=$string&dataType=bibtex\n" ;
+    }
+
+
+    my $response = $userAgent->get("$mirror?ref=$string&dataType=bibtex");
+    if ($debug) {
+	print STDERR "DEBUG:  response: ",
+	$response->decoded_content, "\n";
+    }
+    
+    if ($response->decoded_content =~ /MRNUMBER\s*=\s*{(.*)}/m) {
+	my $mr=$1;
+	# Somehow mref deletes leading zeros.  They are needed!
+	while (length($mr)<7) {
+	    $mr = "0$mr";
+	}
+	if ($debug) {
+	    print STDERR "DEBUG:  got MR: $mr\n",
+	}
+	return $mr;
+     } else {
+	if ($debug) {
+	    print STDERR "DEBUG: Did not get MR\n",
+	}
+ 	return ("");
+    }
+
+}
+	


Property changes on: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -8,12 +8,23 @@
 
 =head1 SYNOPSIS
 
-bibzbladd  [B<-f>] [B<-o> I<output>] I<bib_file>
+bibzbladd  [-d] [B<-f>] [B<-e> 1|0] [B<-o> I<output>] I<bib_file>
 
 =head1 OPTIONS
 
 =over 4
 
+=item B<-d>
+
+Debug mode
+
+=item B<-e>
+
+If 1 (default), add an empty zblnumber if a zbl cannot be found.  This
+prevents repeated searches for the same entries if you add new entries
+to the file.  Calling C<-e 0> suppresses this behavior.
+
+
 =item B<-f>
 
 Force searching for Zbl numbers even if the entry already has one.
@@ -41,7 +52,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014-2016  Boris Veytsman
+Copyright (C) 2014-2017  Boris Veytsman
 
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
@@ -63,10 +74,11 @@
 use Getopt::Std;
 use URI::Escape;
 use LWP::UserAgent;
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
 
-my $USAGE="USAGE: $0  [-f] [-o output] file\n";
+my $USAGE="USAGE: $0  [-d] [-e 1|0] [-f] [-o output] file\n";
 my $VERSION = <<END;
-bibzbladd v2.0
+bibzbladd v2.1
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
 http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
@@ -74,7 +86,7 @@
 $USAGE
 END
 my %opts;
-getopts('fo:hV',\%opts) or die $USAGE;
+getopts('de:fo:hV',\%opts) or die $USAGE;
 
 if ($opts{h} || $opts{V}){
     print $VERSION;
@@ -97,6 +109,13 @@
 
 my $forceSearch=$opts{f};
 
+my $forceEmpty = 1;
+if (exists $opts{e}) {
+    $forceEmpty = $opts{e};
+}		
+
+my $debug = $opts{d};
+
 my $input= IO::File->new($inputfile) or 
     die "Cannot find BibTeX file $inputfile\n$USAGE\n";
 my $output = IO::File->new("> $outputfile") or 
@@ -118,19 +137,24 @@
 	print STDERR "Skipping this entry\n";
 	next;
     }
-    if (!($entry->type() eq 'ARTICLE')) {
-	print $output $entry->raw_bibtex(), "\n\n";
-	next;
-    }
     if ($entry->has('zblnumber') && !$forceSearch) {
 	print $output $entry->raw_bibtex(), "\n\n";
+	if ($debug) {
+	    print STDERR "DEBUG:  entry ", $entry->key(), 
+	    " has zblnumber ", $entry->field('zblnumber'), 
+	    " and no forced search is requested\n";
+	}
 	next;
     }
     
 
      # Now we have an entry with no Zbl.  Let us get to work.
+    if ($debug) {
+	print STDERR "DEBUG:  Searching for zbl number for entry ",
+	$entry->key, "\n";
+    }
      my $zbl = GetZbl($entry, $userAgent, $mirror);
-     if (length($zbl)) {
+     if (length($zbl) || $forceEmpty) {
  	$entry->field('zblnumber',$zbl);
      }
     print $output $entry->to_string(), "\n\n";
@@ -154,12 +178,26 @@
 
     my $string=uri_escape_utf8($entry->to_string());
     
+    if ($debug) {
+	print STDERR "DEBUG:  query: $mirror?bibtex=$string\n" ;
+    }
 
 
     my $response = $userAgent->get("$mirror?bibtex=$string");
+    if ($debug) {
+	print STDERR "DEBUG:  response: ",
+	$response->decoded_content, "\n";
+    }
+    
     if ($response->decoded_content =~ /^\s*"zbl_id":\s*"(.*)",\s*$/m) {
+	if ($debug) {
+	    print STDERR "DEBUG:  got zbl: $1\n",
+	}
 	return $1;
      } else {
+	if ($debug) {
+	    print STDERR "DEBUG: Did not get zbl\n",
+	}
  	return ("");
     }
 

Modified: trunk/Build/source/texk/texlive/linked_scripts/scripts.lst
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/scripts.lst	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Build/source/texk/texlive/linked_scripts/scripts.lst	2017-04-16 22:25:15 UTC (rev 43866)
@@ -42,7 +42,9 @@
 cjk-gs-integrate/cjk-gs-integrate.pl
 context/perl/mptopdf.pl
 convbkmk/convbkmk.rb
+crossrefware/bbl2bib.pl
 crossrefware/bibdoiadd.pl
+crossrefware/bibmradd.pl
 crossrefware/bibzbladd.pl
 crossrefware/ltx2crossrefxml.pl
 ctanify/ctanify

Added: trunk/Master/bin/amd64-freebsd/bbl2bib
===================================================================
--- trunk/Master/bin/amd64-freebsd/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/amd64-freebsd/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/amd64-freebsd/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-freebsd/bibmradd
===================================================================
--- trunk/Master/bin/amd64-freebsd/bibmradd	                        (rev 0)
+++ trunk/Master/bin/amd64-freebsd/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/amd64-freebsd/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-netbsd/bbl2bib
===================================================================
--- trunk/Master/bin/amd64-netbsd/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/amd64-netbsd/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/amd64-netbsd/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-netbsd/bibmradd
===================================================================
--- trunk/Master/bin/amd64-netbsd/bibmradd	                        (rev 0)
+++ trunk/Master/bin/amd64-netbsd/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/amd64-netbsd/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armel-linux/bbl2bib
===================================================================
--- trunk/Master/bin/armel-linux/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/armel-linux/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/armel-linux/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armel-linux/bibmradd
===================================================================
--- trunk/Master/bin/armel-linux/bibmradd	                        (rev 0)
+++ trunk/Master/bin/armel-linux/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/armel-linux/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armhf-linux/bbl2bib
===================================================================
--- trunk/Master/bin/armhf-linux/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/armhf-linux/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/armhf-linux/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armhf-linux/bibmradd
===================================================================
--- trunk/Master/bin/armhf-linux/bibmradd	                        (rev 0)
+++ trunk/Master/bin/armhf-linux/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/armhf-linux/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-cygwin/bbl2bib
===================================================================
--- trunk/Master/bin/i386-cygwin/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/i386-cygwin/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-cygwin/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-cygwin/bibmradd
===================================================================
--- trunk/Master/bin/i386-cygwin/bibmradd	                        (rev 0)
+++ trunk/Master/bin/i386-cygwin/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-cygwin/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-freebsd/bbl2bib
===================================================================
--- trunk/Master/bin/i386-freebsd/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/i386-freebsd/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-freebsd/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-freebsd/bibmradd
===================================================================
--- trunk/Master/bin/i386-freebsd/bibmradd	                        (rev 0)
+++ trunk/Master/bin/i386-freebsd/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-freebsd/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-linux/bbl2bib
===================================================================
--- trunk/Master/bin/i386-linux/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/i386-linux/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-linux/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-linux/bibmradd
===================================================================
--- trunk/Master/bin/i386-linux/bibmradd	                        (rev 0)
+++ trunk/Master/bin/i386-linux/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-linux/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-netbsd/bbl2bib
===================================================================
--- trunk/Master/bin/i386-netbsd/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/i386-netbsd/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-netbsd/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-netbsd/bibmradd
===================================================================
--- trunk/Master/bin/i386-netbsd/bibmradd	                        (rev 0)
+++ trunk/Master/bin/i386-netbsd/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-netbsd/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-solaris/bbl2bib
===================================================================
--- trunk/Master/bin/i386-solaris/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/i386-solaris/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-solaris/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-solaris/bibmradd
===================================================================
--- trunk/Master/bin/i386-solaris/bibmradd	                        (rev 0)
+++ trunk/Master/bin/i386-solaris/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-solaris/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/powerpc-linux/bbl2bib
===================================================================
--- trunk/Master/bin/powerpc-linux/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/powerpc-linux/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/powerpc-linux/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/powerpc-linux/bibmradd
===================================================================
--- trunk/Master/bin/powerpc-linux/bibmradd	                        (rev 0)
+++ trunk/Master/bin/powerpc-linux/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/powerpc-linux/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/sparc-solaris/bbl2bib
===================================================================
--- trunk/Master/bin/sparc-solaris/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/sparc-solaris/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/sparc-solaris/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/sparc-solaris/bibmradd
===================================================================
--- trunk/Master/bin/sparc-solaris/bibmradd	                        (rev 0)
+++ trunk/Master/bin/sparc-solaris/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/sparc-solaris/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/universal-darwin/bbl2bib
===================================================================
--- trunk/Master/bin/universal-darwin/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/universal-darwin/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/universal-darwin/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/universal-darwin/bibmradd
===================================================================
--- trunk/Master/bin/universal-darwin/bibmradd	                        (rev 0)
+++ trunk/Master/bin/universal-darwin/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/universal-darwin/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/win32/bbl2bib.exe
===================================================================
(Binary files differ)

Index: trunk/Master/bin/win32/bbl2bib.exe
===================================================================
--- trunk/Master/bin/win32/bbl2bib.exe	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/bin/win32/bbl2bib.exe	2017-04-16 22:25:15 UTC (rev 43866)

Property changes on: trunk/Master/bin/win32/bbl2bib.exe
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/bin/win32/bibmradd.exe
===================================================================
(Binary files differ)

Index: trunk/Master/bin/win32/bibmradd.exe
===================================================================
--- trunk/Master/bin/win32/bibmradd.exe	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/bin/win32/bibmradd.exe	2017-04-16 22:25:15 UTC (rev 43866)

Property changes on: trunk/Master/bin/win32/bibmradd.exe
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/bin/x86_64-cygwin/bbl2bib
===================================================================
--- trunk/Master/bin/x86_64-cygwin/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/x86_64-cygwin/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-cygwin/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-cygwin/bibmradd
===================================================================
--- trunk/Master/bin/x86_64-cygwin/bibmradd	                        (rev 0)
+++ trunk/Master/bin/x86_64-cygwin/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-cygwin/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-darwin/bbl2bib
===================================================================
--- trunk/Master/bin/x86_64-darwin/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/x86_64-darwin/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-darwin/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-darwin/bibmradd
===================================================================
--- trunk/Master/bin/x86_64-darwin/bibmradd	                        (rev 0)
+++ trunk/Master/bin/x86_64-darwin/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-darwin/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-linux/bbl2bib
===================================================================
--- trunk/Master/bin/x86_64-linux/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/x86_64-linux/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-linux/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-linux/bibmradd
===================================================================
--- trunk/Master/bin/x86_64-linux/bibmradd	                        (rev 0)
+++ trunk/Master/bin/x86_64-linux/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-linux/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-solaris/bbl2bib
===================================================================
--- trunk/Master/bin/x86_64-solaris/bbl2bib	                        (rev 0)
+++ trunk/Master/bin/x86_64-solaris/bbl2bib	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bbl2bib.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-solaris/bbl2bib
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-solaris/bibmradd
===================================================================
--- trunk/Master/bin/x86_64-solaris/bibmradd	                        (rev 0)
+++ trunk/Master/bin/x86_64-solaris/bibmradd	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/crossrefware/bibmradd.pl
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-solaris/bibmradd
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1,202 @@
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+.    ds C`
+.    ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
+..
+.        if !\nF==2 \{
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
+.\}
+.rr rF
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "bbl2bib 1"
+.TH bbl2bib 1 "2017-04-10" "" "CROSSREF LIBRARY"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+bbl2bib.pl \- convert thebibliography environment to a bib file
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+bbl2bib.pl [\fB\-o\fR \fIoutput\fR] \fIfile\fR
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-o\fR \fIoutput\fR" 4
+.IX Item "-o output"
+Output file.  If this option is not used, the name for the 
+output file is formed by changing the extension to \f(CW\*(C`.bib\*(C'\fR
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The script tries to reconstruct a \f(CW\*(C`bib\*(C'\fR file from the corresponding
+\&\f(CW\*(C`thebibliography\*(C'\fR environment.  One can argue that this operation is
+akin to reconstructing a cow from the steak.  The way the script does
+it is searching for the entry in the \s-1MR\s0 database, and
+creating the corresponding BibTeX fields.
+.PP
+The script reads a TeX or Bbl file and extracts from it the
+\&\f(CW\*(C`thebibliography\*(C'\fR environment.  For each bibitem it creates a plain
+text bibliography entry, and then  tries to match it in
+the database.  
+=head1 \s-1INPUT FILE\s0
+.PP
+We assume some structure of the input file:
+.IP "1." 4
+The bibliography is contained between the lines
+.Sp
+.Vb 1
+\&   \ebegin{thebibliography}...
+.Ve
+.Sp
+and
+.Sp
+.Vb 1
+\&   \eend{thebibliography}
+.Ve
+.IP "2." 4
+Each bibliography item starts from the line
+.Sp
+.Vb 1
+\&   \ebibitem[...]{....}
+.Ve
+.SH "EXAMPLES"
+.IX Header "EXAMPLES"
+.Vb 3
+\&   bbl2bib  \-o \- file.tex > result.bib
+\&   bbl2bib  \-o result.bib file.bbl
+\&   bbl2bib  file.tex
+.Ve
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Boris Veytsman
+.SH "COPYRIGHT AND LICENSE"
+.IX Header "COPYRIGHT AND LICENSE"
+Copyright (C) 2014\-2017  Boris Veytsman
+.PP
+This is free software.  You may redistribute copies of it under the
+terms of the \s-1GNU\s0 General Public License
+<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO WARRANTY,\s0 to the
+extent permitted by law.


Property changes on: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf	2017-04-16 22:25:15 UTC (rev 43866)

Property changes on: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -38,6 +38,8 @@
 .    ds PI \(*p
 .    ds L" ``
 .    ds R" ''
+.    ds C`
+.    ds C'
 'br\}
 .\"
 .\" Escape single quotes in literal strings from groff's Unicode transform.
@@ -48,17 +50,24 @@
 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
 .\" entries marked with X<> in POD.  Of course, you'll have to process the
 .\" output yourself in some meaningful fashion.
-.ie \nF \{\
-.    de IX
-.    tm Index:\\$1\t\\n%\t"\\$2"
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
 ..
-.    nr % 0
-.    rr F
-.\}
-.el \{\
-.    de IX
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
 ..
+.        if !\nF==2 \{
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
 .\}
+.rr rF
 .\"
 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
@@ -124,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "bibdoiadd 1"
-.TH bibdoiadd 1 "2016-02-14" "" "CROSSREF LIBRARY"
+.TH bibdoiadd 1 "2017-04-12" "" "CROSSREF LIBRARY"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -133,7 +142,7 @@
 bibdoiadd.pl \- add DOI numbers to papers in a given bib file
 .SH "SYNOPSIS"
 .IX Header "SYNOPSIS"
-bibdoiadd [\fB\-c\fR \fIconfig_file\fR] [\fB\-f\fR] [\fB\-o\fR \fIoutput\fR] \fIbib_file\fR
+bibdoiadd [\fB\-c\fR \fIconfig_file\fR] [\fB\-e\fR 1|0] [\fB\-f\fR] [\fB\-o\fR \fIoutput\fR] \fIbib_file\fR
 .SH "OPTIONS"
 .IX Header "OPTIONS"
 .IP "\fB\-c\fR \fIconfig_file\fR" 4
@@ -140,6 +149,11 @@
 .IX Item "-c config_file"
 Configuration file.  If this file is absent, some defaults are used.
 See below for its format.
+.IP "\fB\-e\fR" 4
+.IX Item "-e"
+If 1 (default), add empty doi if a doi cannot be found.  This prevents
+repeated searches for the same entries if you add new entries to the
+file.  Calling \f(CW\*(C`\-e 0\*(C'\fR suppresses this behavior.
 .IP "\fB\-f\fR" 4
 .IX Item "-f"
 Force checking doi number even if one is present
@@ -151,7 +165,7 @@
 .IX Header "DESCRIPTION"
 The script reads a BibTeX file.  It checks whether the entries have
 DOIs.  If now, tries to contact http://www.crossref.org to get the
-corresponding \s-1DOI\s0.  The result is a BibTeX file with the fields
+corresponding \s-1DOI. \s0 The result is a BibTeX file with the fields
 \&\f(CW\*(C`doi=...\*(C'\fR added.
 .PP
 The name of the output file is either set by the \fB\-o\fR option or 
@@ -175,14 +189,14 @@
 \&   $field = value ;
 .Ve
 .PP
-The important parameters are \f(CW$mode\fR (\f(CW\*(Aqfree\*(Aq\fR or \f(CW\*(Aqpaid\*(Aq\fR,
+The important parameters are \f(CW$mode\fR (\f(CW\*(Aqfree\*(Aq\fR or \f(CW\*(Aqpaid\*(Aq\fR),
 \&\f(CW$email\fR (for free users) and \f(CW$username\fR & \f(CW$password\fR for paid
 members.
 .SH "EXAMPLES"
 .IX Header "EXAMPLES"
 .Vb 2
-\&   bibdoiadd \-c bibdoiadd.cfg citations.bib > result.bib
-\&   bibdoiadd \-c bibdoiadd.cfg citations.bib \-o result.bib
+\&   bibdoiadd \-c bibdoiadd.cfg \-o \- citations.bib > result.bib
+\&   bibdoiadd \-c bibdoiadd.cfg \-o result.bib citations.bib
 .Ve
 .SH "AUTHOR"
 .IX Header "AUTHOR"
@@ -189,9 +203,9 @@
 Boris Veytsman
 .SH "COPYRIGHT AND LICENSE"
 .IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2016  Boris Veytsman
+Copyright (C) 2014\-2017  Boris Veytsman
 .PP
 This is free software.  You may redistribute copies of it under the
 terms of the \s-1GNU\s0 General Public License
-<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO\s0 \s-1WARRANTY\s0, to the
+<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO WARRANTY,\s0 to the
 extent permitted by law.

Modified: trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.man1.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/man/man1/bibmradd.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibmradd.1	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/man/man1/bibmradd.1	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1,182 @@
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+.    ds C`
+.    ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
+..
+.        if !\nF==2 \{
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
+.\}
+.rr rF
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "bibmradd 1"
+.TH bibmradd 1 "2017-04-03" "" "CROSSREF LIBRARY"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+bibmradd.pl \- add MR numbers to papers in a given bib file
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+bibmradd  [\-d] [\fB\-f\fR] [\fB\-e\fR 1|0] [\fB\-o\fR \fIoutput\fR] \fIbib_file\fR
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+Debug mode
+.IP "\fB\-e\fR" 4
+.IX Item "-e"
+If 1 (default), add an empty mrnumber if a mr cannot be found.  This
+prevents repeated searches for the same entries if you add new entries
+to the file.  Calling \f(CW\*(C`\-e 0\*(C'\fR suppresses this behavior.
+.IP "\fB\-f\fR" 4
+.IX Item "-f"
+Force searching for \s-1MR\s0 numbers even if the entry already has one.
+.IP "\fB\-o\fR \fIoutput\fR" 4
+.IX Item "-o output"
+Output file.  If this option is not used, the name for the 
+output file is formed by adding \f(CW\*(C`_mr\*(C'\fR to the input file
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The script reads a BibTeX file.  It checks whether the entries have
+mrnumberss.  If not, tries to contact internet to get the numbers.  The
+result is a BibTeX file with the fields 
+\&\f(CW\*(C`mrnumber=...\*(C'\fR added.
+.PP
+The name of the output file is either set by the \fB\-o\fR option or 
+is derived by adding the suffix \f(CW\*(C`_mr\*(C'\fR to the output file.
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Boris Veytsman
+.SH "COPYRIGHT AND LICENSE"
+.IX Header "COPYRIGHT AND LICENSE"
+Copyright (C) 2014\-2017  Boris Veytsman
+.PP
+This is free software.  You may redistribute copies of it under the
+terms of the \s-1GNU\s0 General Public License
+<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO WARRANTY,\s0 to the
+extent permitted by law.


Property changes on: trunk/Master/texmf-dist/doc/man/man1/bibmradd.1
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf	2017-04-16 22:25:15 UTC (rev 43866)

Property changes on: trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -38,6 +38,8 @@
 .    ds PI \(*p
 .    ds L" ``
 .    ds R" ''
+.    ds C`
+.    ds C'
 'br\}
 .\"
 .\" Escape single quotes in literal strings from groff's Unicode transform.
@@ -48,17 +50,24 @@
 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
 .\" entries marked with X<> in POD.  Of course, you'll have to process the
 .\" output yourself in some meaningful fashion.
-.ie \nF \{\
-.    de IX
-.    tm Index:\\$1\t\\n%\t"\\$2"
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
 ..
-.    nr % 0
-.    rr F
-.\}
-.el \{\
-.    de IX
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
 ..
+.        if !\nF==2 \{
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
 .\}
+.rr rF
 .\"
 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
@@ -124,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "bibzbladd 1"
-.TH bibzbladd 1 "2016-02-14" "" "CROSSREF LIBRARY"
+.TH bibzbladd 1 "2017-04-12" "" "CROSSREF LIBRARY"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -133,9 +142,17 @@
 bibzbladd.pl \- add Zbl numbers to papers in a given bib file
 .SH "SYNOPSIS"
 .IX Header "SYNOPSIS"
-bibzbladd  [\fB\-f\fR] [\fB\-o\fR \fIoutput\fR] \fIbib_file\fR
+bibzbladd  [\-d] [\fB\-f\fR] [\fB\-e\fR 1|0] [\fB\-o\fR \fIoutput\fR] \fIbib_file\fR
 .SH "OPTIONS"
 .IX Header "OPTIONS"
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+Debug mode
+.IP "\fB\-e\fR" 4
+.IX Item "-e"
+If 1 (default), add an empty zblnumber if a zbl cannot be found.  This
+prevents repeated searches for the same entries if you add new entries
+to the file.  Calling \f(CW\*(C`\-e 0\*(C'\fR suppresses this behavior.
 .IP "\fB\-f\fR" 4
 .IX Item "-f"
 Force searching for Zbl numbers even if the entry already has one.
@@ -157,9 +174,9 @@
 Boris Veytsman
 .SH "COPYRIGHT AND LICENSE"
 .IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2016  Boris Veytsman
+Copyright (C) 2014\-2017  Boris Veytsman
 .PP
 This is free software.  You may redistribute copies of it under the
 terms of the \s-1GNU\s0 General Public License
-<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO\s0 \s-1WARRANTY\s0, to the
+<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO WARRANTY,\s0 to the
 extent permitted by law.

Modified: trunk/Master/texmf-dist/doc/man/man1/bibzbladd.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.1	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.1	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -38,6 +38,8 @@
 .    ds PI \(*p
 .    ds L" ``
 .    ds R" ''
+.    ds C`
+.    ds C'
 'br\}
 .\"
 .\" Escape single quotes in literal strings from groff's Unicode transform.
@@ -48,17 +50,24 @@
 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
 .\" entries marked with X<> in POD.  Of course, you'll have to process the
 .\" output yourself in some meaningful fashion.
-.ie \nF \{\
-.    de IX
-.    tm Index:\\$1\t\\n%\t"\\$2"
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
 ..
-.    nr % 0
-.    rr F
-.\}
-.el \{\
-.    de IX
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
 ..
+.        if !\nF==2 \{
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
 .\}
+.rr rF
 .\"
 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
@@ -124,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "ltx2crossrefxml 1"
-.TH ltx2crossrefxml 1 "2016-02-14" "" "CROSSREF LIBRARY"
+.TH ltx2crossrefxml 1 "2017-03-28" "" "CROSSREF LIBRARY"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -176,5 +185,5 @@
 .PP
 This is free software.  You may redistribute copies of it under the
 terms of the \s-1GNU\s0 General Public License
-<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO\s0 \s-1WARRANTY\s0, to the
+<http://www.gnu.org/licenses/gpl.html>.  There is \s-1NO WARRANTY,\s0 to the
 extent permitted by law.

Modified: trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/crossrefware/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/support/crossrefware/Makefile	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/support/crossrefware/Makefile	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,7 +1,9 @@
 SCRIPTS = \
 	ltx2crossrefxml.pl \
 	bibdoiadd.pl \
-	bibzbladd.pl
+	bibzbladd.pl \
+	bibmradd.pl \
+	bbl2bib.pl
 
 
 MAN1 = ${SCRIPTS:%.pl=%.1}
@@ -20,7 +22,8 @@
 
 
 clean:
-	$(RM) *.aux *.toc *.log *.tex *.idx *.ilg *.ind *.out *.zip *.tgz
+	$(RM) *.aux *.toc *.log *.tex *.idx *.ilg *.ind *.out *.zip *.tgz \
+	*~
 
 distclean: clean
 	$(RM) *.pdf *.1 *.3
@@ -37,5 +40,5 @@
 	pod2latex -modify -full -prefile head.ltx -out $@ $+
 
 archive: all clean
-	cd ..; tar -czvf crossrefware.tgz crossref --exclude CVS \
-	--exclude test --exclude *.bib
\ No newline at end of file
+	cd ..; tar -czvf crossrefware.tgz  --exclude 'CVS' \
+	--exclude 'test' --exclude *.bib crossref

Modified: trunk/Master/texmf-dist/doc/support/crossrefware/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/crossrefware/README	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/support/crossrefware/README	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,11 +1,16 @@
 			 Crossrefware Bundle
-			     version 2.0
+			     version 2.1
 
 
-Scripts useful for working with crossref.org and Zentralblatt MATH.
+Scripts useful for working with Crossref, MathSciNet and Zentralblatt MATH.
 
+This work was commissioned by The Saint Lois University and The
+Princeton University (Mathematics Department)
+
 bibdoiadd.pl       - add DOI numbers to papers in a given bib file
 bibzbladd.pl       - add Zbl numbers to papers in a given bib file
+bibmradd.pl        - add MR  numbers to papers in a given bib file
+bbl2bib.pl         - convert `thebibliography' environment to a bib file
 ltx2crossrefxml.pl - a tool for creation of XML files for submitting to crossref.org
 
 The scripts use bibtexperllibs libraries from CTAN
@@ -21,6 +26,11 @@
 
 Changes:
 
+        Version 2.1:  New options to add empty doi and zbl when doi or zbl
+		      are not found to prevent repeated searches.
+		      Added bibmradd.pl
+		      Added bbl2bib.pl
+
         Version 2.0:  Moved to BibTeX::Parser suite.
                       Now we use new Zbmath interface.
                       Now we use bibtexperllibs libraries

Modified: trunk/Master/texmf-dist/doc/support/crossrefware/crossrefware.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/crossrefware/head.ltx
===================================================================
--- trunk/Master/texmf-dist/doc/support/crossrefware/head.ltx	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/support/crossrefware/head.ltx	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,18 +1,39 @@
 \documentclass{article}
 \usepackage{makeidx}
-\usepackage{librecaslon}
+\usepackage[osf]{mathpazo}
 \usepackage[hidelinks]{hyperref}
 \makeindex
 \begin{document}
-\title{Crossrefware documentation}
-\author{Boris Veytsman}
+\sloppy
+\title{Crossrefware documentation\thanks{This work was commissioned by
+  The Saint Lois University and The Princeton University (Mathematics
+  Department)}}
+\author{Boris Veytsman\thanks{borisv at lk.net, boris at varphi.com}}
 \maketitle
 \tableofcontents
 
+\section{Introduction}
+
 These scripts can be used to submit files to Crossref, check and add
-doi numbers and ZbMath numbers to papers.
+doi numbers, MathSciNet numbers and ZbMath numbers to papers, and to
+convert `bbl' files to `bib' files.
 
-
 I am grateful to Josko Plazonic from Princeton Math Dept whose
 (unpublished) Python script was an inspiration for this suite.
 
+The script \path{ltx2crossrefxml} is used to extract the information
+from a \LaTeX\ file and generate an XML file suitable for submission
+to Crossref (the organization that keeps DOI numbering system).  
+
+Several scripts, \path{bibdoiadd}, \path{bibmradd} and \path{bibmradd}
+take a \path{bib} file, and add to each entry a DOI, MR or ZBL number
+correspondingly, if they can find this entry in the corresponding
+database.   
+
+Script \path{bbl2bib} tries to reconstruct a \path{bib} file from the
+corresponding \path{thebibliography} environment.  One can argue that
+this operation is akin to reconstructing a cow from the steak.  The
+way the script does it is searching for the entry in the MR database,
+and creating the corresponding Bib\TeX\ fields.
+
+Below are manual pages for these scripts.  

Added: trunk/Master/texmf-dist/doc/support/crossrefware/ltx2crossrefxml.exe
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/support/crossrefware/ltx2crossrefxml.exe
===================================================================
--- trunk/Master/texmf-dist/doc/support/crossrefware/ltx2crossrefxml.exe	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/doc/support/crossrefware/ltx2crossrefxml.exe	2017-04-16 22:25:15 UTC (rev 43866)

Property changes on: trunk/Master/texmf-dist/doc/support/crossrefware/ltx2crossrefxml.exe
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl	                        (rev 0)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1,259 @@
+#!/usr/bin/env perl
+
+=pod
+
+=head1 NAME
+
+bbl2bib.pl - convert thebibliography environment to a bib file
+
+=head1 SYNOPSIS
+
+bbl2bib.pl [B<-o> I<output>] I<file>
+
+=head1 OPTIONS
+
+=over 4
+
+
+
+=item B<-o> I<output>
+
+Output file.  If this option is not used, the name for the 
+output file is formed by changing the extension to C<.bib>
+
+
+=back
+
+=head1 DESCRIPTION
+
+The script tries to reconstruct a C<bib> file from the corresponding
+C<thebibliography> environment.  One can argue that this operation is
+akin to reconstructing a cow from the steak.  The way the script does
+it is searching for the entry in the MR database, and
+creating the corresponding BibTeX fields.
+
+The script reads a TeX or Bbl file and extracts from it the
+C<thebibliography> environment.  For each bibitem it creates a plain
+text bibliography entry, and then  tries to match it in
+the database.  
+=head1 INPUT FILE
+
+We assume some structure of the input file:
+
+=over 4
+
+=item 1.
+
+The bibliography is contained between the lines
+
+   \begin{thebibliography}...
+
+and
+
+   \end{thebibliography}
+
+=item 2.
+
+Each bibliography item starts from the line 
+
+   \bibitem[...]{....}
+
+=back
+
+
+
+=head1 EXAMPLES
+
+   bbl2bib  -o - file.tex > result.bib
+   bbl2bib  -o result.bib file.bbl
+   bbl2bib  file.tex
+
+=head1 AUTHOR
+
+Boris Veytsman
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014-2017  Boris Veytsman
+
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+L<http://www.gnu.org/licenses/gpl.html>.  There is NO WARRANTY, to the
+extent permitted by law.
+
+=cut
+
+use strict;
+BEGIN {
+    # find files relative to our installed location within TeX Live
+    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
+    if (length($TLMaster)) {
+	unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
+    }
+}
+use IO::File;
+use BibTeX::Parser;
+use FileHandle;
+use LaTeX::ToUnicode qw (convert);
+use Getopt::Std;
+use URI::Escape;
+use LWP::Simple;
+
+my $USAGE="USAGE: $0 [-o output] file\n";
+my $VERSION = <<END;
+bbl2bib v2.1
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
+extent permitted by law.
+$USAGE
+END
+our %opts;
+getopts('c:o:s:hV',\%opts) or die $USAGE;
+
+if ($opts{h} || $opts{V}){
+    print $VERSION;
+    exit 0;
+}
+
+################################################################
+# Defaults and parameters
+################################################################
+
+my $inputfile = shift;
+
+my $outputfile = $inputfile;
+
+$outputfile =~ s/\.([^\.]*)$/.bib/;
+
+if (exists $opts{o}) {
+    $outputfile = $opts{o};
+}
+
+
+
+my $input= IO::File->new($inputfile) or 
+    die "Cannot find Bbl or TeX file $inputfile\n$USAGE\n";
+my $output = IO::File->new("> $outputfile") or 
+    die "Cannot write to $outputfile\n$USAGE\n";
+
+my $userAgent = LWP::UserAgent->new;
+
+
+# Bibitem is a hash with the entries 'key', 'text', 'mr',
+#  'zbl'
+my $bibitem;
+
+while (<$input>) {
+    if (!(/\\begin\{thebibliography\}/../\\end\{thebibliography\}/) ||
+	/\\begin\{thebibliography\}/ || /\\end\{thebibliography\}/) {
+	next;
+    }
+    if (/\\bibitem(\[[^\]]*\])?\{([^\}]*)\}/) {
+	ProcessBibitem($bibitem);
+	$bibitem = undef;
+	$bibitem->{key}=$2;
+	$bibitem->{text}="";
+    }
+    if (!/^\s*$/) {
+	$bibitem -> {text} .= $_;
+    }
+}
+ProcessBibitem($bibitem);
+
+
+exit 0;
+
+sub ProcessBibitem {
+    my $bibitem = shift;
+    my $key = $bibitem->{key};
+    my $text=$bibitem->{text};
+    if (!length($text) || $text =~ /^\s+$/s) {
+	return;
+    }
+
+    my $printtext = $text;
+    $printtext =~ s/^(.)/% $1/mg;
+    print $output "$printtext";
+    $text =~ s/\n/ /mg;
+    $text =~ s/\\bibitem(\[[^\]]*\])?\{[^\}]*\}//;
+
+    # Arxiv entry?
+    if ($text =~ s/\\arxiv\{([^\}]+)\}\.?//) {
+	$bibitem->{arxiv}=$1;
+    }
+
+    # Mr number exists?
+    if ($text =~ s/\\mr\{([^\}]+)\}\.?//) {
+	$bibitem->{mr}=$1;
+    }
+
+    # zbl  number exists?
+    if ($text =~ s/\\zbl\{([^\}]+)\}\.?//) {
+	$bibitem->{zbl}=$1;
+    }
+
+    # doi  number exists?
+    if ($text =~ s/\\doi\{([^\}]+)\}\.?//) {
+	$bibitem->{doi}=$1;
+    }
+
+    $bibitem->{bib} = SearchMref($bibitem);
+    PrintBibitem($bibitem);
+    return;
+}
+
+
+sub SearchMref {
+    my $bibitem = shift;
+    my $mirror = "http://www.ams.org/mathscinet-mref";
+    my $string=uri_escape_utf8($bibitem->{text});
+    my $response = $userAgent->get("$mirror?ref=$string&dataType=bibtex") ->
+	decoded_content();
+    if ($response =~ /<pre>(.*)<\/pre>/s) {
+	my $bib= $1;
+	my $fh = new FileHandle;
+	open $fh, "<", \$bib;
+	my $parser = new BibTeX::Parser($fh);
+	my $entry = $parser->next;
+	if ($entry->parse_ok()) {
+	    $entry->key($bibitem->{key});
+	    return ($entry);
+	}
+    }
+}
+
+
+
+
+sub PrintBibitem {
+    print "\n";
+    my $bibitem = shift;
+    if (!ref($bibitem->{bib})) {
+	return;
+    }
+    my $entry=$bibitem->{bib};
+    if ($bibitem->{mr} && ! $entry->field('mrnumber')) {
+	$entry->field('mrnumber', $bibitem->{mr});
+    }
+    if ($entry->field('mrnumber')) {
+	my $mr=$entry->field('mrnumber');
+	while (length($mr)<7) {
+	    $mr = "0$mr";
+	}
+	$mr=$entry->field('mrnumber', $mr);
+    }
+    if ($bibitem->{zbl} && ! $entry->field('zblnumber')) {
+	$entry->field('zblnumber', $bibitem->{zbl});
+    }
+    if ($bibitem->{doi} && ! $entry->field('doi')) {
+	$entry->field('doi', $bibitem->{doi});
+    }
+    if ($bibitem->{arxiv} && ! $entry->field('arxiv')) {
+	$entry->field('arxiv', $bibitem->{arxiv});
+    }
+	
+    print $entry->to_string(), "\n\n";
+}
+
+


Property changes on: trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-bibdoiadd [B<-c> I<config_file>] [B<-f>] [B<-o> I<output>] I<bib_file>
+bibdoiadd [B<-c> I<config_file>] [B<-e> 1|0] [B<-f>] [B<-o> I<output>] I<bib_file>
 
 =head1 OPTIONS
 
@@ -19,6 +19,12 @@
 Configuration file.  If this file is absent, some defaults are used.
 See below for its format.
 
+=item B<-e>
+
+If 1 (default), add empty doi if a doi cannot be found.  This prevents
+repeated searches for the same entries if you add new entries to the
+file.  Calling C<-e 0> suppresses this behavior.
+
 =item B<-f>
 
 Force checking doi number even if one is present
@@ -59,7 +65,7 @@
 
    $field = value ;
 
-The important parameters are C<$mode> (C<'free'> or C<'paid'>,
+The important parameters are C<$mode> (C<'free'> or C<'paid'>),
 C<$email> (for free users) and C<$username> & C<$password> for paid
 members.
 
@@ -66,8 +72,8 @@
 
 =head1 EXAMPLES
 
-   bibdoiadd -c bibdoiadd.cfg citations.bib > result.bib
-   bibdoiadd -c bibdoiadd.cfg citations.bib -o result.bib
+   bibdoiadd -c bibdoiadd.cfg -o - citations.bib > result.bib
+   bibdoiadd -c bibdoiadd.cfg -o result.bib citations.bib 
 
 =head1 AUTHOR
 
@@ -75,7 +81,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014-2016  Boris Veytsman
+Copyright (C) 2014-2017  Boris Veytsman
 
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
@@ -99,9 +105,9 @@
 use URI::Escape;
 use LWP::Simple;
 
-my $USAGE="USAGE: $0 [-c config] [-f] [-o output] file\n";
+my $USAGE="USAGE: $0 [-c config] [-e 1|0] [-f] [-o output] file\n";
 my $VERSION = <<END;
-bibdoiadd v2.0
+bibdoiadd v2.1
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
 http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
@@ -108,8 +114,8 @@
 extent permitted by law.
 $USAGE
 END
-my %opts;
-getopts('fc:o:hV',\%opts) or die $USAGE;
+our %opts;
+getopts('fe:c:o:hV',\%opts) or die $USAGE;
 
 if ($opts{h} || $opts{V}){
     print $VERSION;
@@ -126,13 +132,16 @@
 
 $outputfile =~ s/\.([^\.]*)$/_doi.$1/;
 
-if ($opts{o}) {
+if (exists $opts{o}) {
     $outputfile = $opts{o};
 }
 
 my $forceSearch=$opts{f};
+my $forceEmpty = 1;
+if (exists $opts{e}) {
+    $forceEmpty = $opts{e};
+}		
 
-
 our $mode='free';
 our $email;
 our $username;
@@ -196,7 +205,7 @@
     
 
      my $doi = GetDoi($prefix, $entry);
-     if (length($doi)) {
+     if (length($doi) || $forceEmpty) {
  	$entry->field('doi',$doi);
      }
     print $output $entry->to_string(), "\n\n";

Added: trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl	                        (rev 0)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -0,0 +1,210 @@
+#!/usr/bin/env perl
+
+=pod
+
+=head1 NAME
+
+bibmradd.pl - add MR numbers to papers in a given bib file
+
+=head1 SYNOPSIS
+
+bibmradd  [-d] [B<-f>] [B<-e> 1|0] [B<-o> I<output>] I<bib_file>
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-d>
+
+Debug mode
+
+=item B<-e>
+
+If 1 (default), add an empty mrnumber if a mr cannot be found.  This
+prevents repeated searches for the same entries if you add new entries
+to the file.  Calling C<-e 0> suppresses this behavior.
+
+
+=item B<-f>
+
+Force searching for MR numbers even if the entry already has one.
+
+=item B<-o> I<output>
+
+Output file.  If this option is not used, the name for the 
+output file is formed by adding C<_mr> to the input file
+
+=back
+
+=head1 DESCRIPTION
+
+The script reads a BibTeX file.  It checks whether the entries have
+mrnumberss.  If not, tries to contact internet to get the numbers.  The
+result is a BibTeX file with the fields 
+C<mrnumber=...> added.  
+
+The name of the output file is either set by the B<-o> option or 
+is derived by adding the suffix C<_mr> to the output file.
+
+=head1 AUTHOR
+
+Boris Veytsman
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014-2017  Boris Veytsman
+
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+L<http://www.gnu.org/licenses/gpl.html>.  There is NO WARRANTY, to the
+extent permitted by law.
+
+=cut
+
+use strict;
+BEGIN {
+    # find files relative to our installed location within TeX Live
+    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
+    if (length($TLMaster)) {
+	unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
+    }
+}
+use IO::File;
+use BibTeX::Parser;
+use Getopt::Std;
+use URI::Escape;
+use LWP::UserAgent;
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
+
+my $USAGE="USAGE: $0  [-d] [-e 1|0] [-f] [-o output] file\n";
+my $VERSION = <<END;
+bibmradd v2.1
+This is free software.  You may redistribute copies of it under the
+terms of the GNU General Public License
+http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
+extent permitted by law.
+$USAGE
+END
+my %opts;
+getopts('de:fo:hV',\%opts) or die $USAGE;
+
+if ($opts{h} || $opts{V}){
+    print $VERSION;
+    exit 0;
+}
+
+################################################################
+# Defaults and parameters
+################################################################
+
+my $inputfile = shift;
+
+my $outputfile = $inputfile;
+
+$outputfile =~ s/\.([^\.]*)$/_mr.$1/;
+
+if ($opts{o}) {
+    $outputfile = $opts{o};
+}
+
+my $forceSearch=$opts{f};
+
+my $forceEmpty = 1;
+if (exists $opts{e}) {
+    $forceEmpty = $opts{e};
+}		
+
+my $debug = $opts{d};
+
+my $input= IO::File->new($inputfile) or 
+    die "Cannot find BibTeX file $inputfile\n$USAGE\n";
+my $output = IO::File->new("> $outputfile") or 
+    die "Cannot write to $outputfile\n$USAGE\n";
+
+my $parser=new BibTeX::Parser($input);
+
+
+
+# Creating the HTTP parameters
+my $mirror =
+    "http://www.ams.org/mathscinet-mref";
+my $userAgent = LWP::UserAgent->new;
+
+while (my $entry = $parser->next ) {
+    if (!$entry->parse_ok()) {
+	print STDERR "Cannot understand entry: ";
+	$entry->print(*STDERR);
+	print STDERR "Skipping this entry\n";
+	next;
+    }
+    if ($entry->has('mrnumber') && !$forceSearch) {
+	print $output $entry->raw_bibtex(), "\n\n";
+	if ($debug) {
+	    print STDERR "DEBUG:  entry ", $entry->key(), 
+	    " has mrnumber ", $entry->field('mrnumber'), 
+	    " and no forced search is requested\n";
+	}
+	next;
+    }
+    
+
+     # Now we have an entry with no MR.  Let us get to work.
+    if ($debug) {
+	print STDERR "DEBUG:  Searching for mr number for entry ",
+	$entry->key, "\n";
+    }
+     my $mr = GetMr($entry, $userAgent, $mirror);
+     if (length($mr) || $forceEmpty) {
+ 	$entry->field('mrnumber', $mr);
+     }
+    print $output $entry->to_string(), "\n\n";
+
+}
+
+$input->close();
+$output->close();
+exit 0;
+
+###############################################################
+#  Getting one MR
+###############################################################
+
+sub GetMr {
+    my $entry=shift;
+    my $userAgent=shift;
+    my $mirror=shift;
+    
+    my @query;
+
+    my $string=uri_escape_utf8($entry->to_string());
+    
+    if ($debug) {
+	print STDERR "DEBUG:  query: $mirror?ref=$string&dataType=bibtex\n" ;
+    }
+
+
+    my $response = $userAgent->get("$mirror?ref=$string&dataType=bibtex");
+    if ($debug) {
+	print STDERR "DEBUG:  response: ",
+	$response->decoded_content, "\n";
+    }
+    
+    if ($response->decoded_content =~ /MRNUMBER\s*=\s*{(.*)}/m) {
+	my $mr=$1;
+	# Somehow mref deletes leading zeros.  They are needed!
+	while (length($mr)<7) {
+	    $mr = "0$mr";
+	}
+	if ($debug) {
+	    print STDERR "DEBUG:  got MR: $mr\n",
+	}
+	return $mr;
+     } else {
+	if ($debug) {
+	    print STDERR "DEBUG: Did not get MR\n",
+	}
+ 	return ("");
+    }
+
+}
+	


Property changes on: trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl	2017-04-16 22:25:15 UTC (rev 43866)
@@ -8,12 +8,23 @@
 
 =head1 SYNOPSIS
 
-bibzbladd  [B<-f>] [B<-o> I<output>] I<bib_file>
+bibzbladd  [-d] [B<-f>] [B<-e> 1|0] [B<-o> I<output>] I<bib_file>
 
 =head1 OPTIONS
 
 =over 4
 
+=item B<-d>
+
+Debug mode
+
+=item B<-e>
+
+If 1 (default), add an empty zblnumber if a zbl cannot be found.  This
+prevents repeated searches for the same entries if you add new entries
+to the file.  Calling C<-e 0> suppresses this behavior.
+
+
 =item B<-f>
 
 Force searching for Zbl numbers even if the entry already has one.
@@ -41,7 +52,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014-2016  Boris Veytsman
+Copyright (C) 2014-2017  Boris Veytsman
 
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
@@ -63,10 +74,11 @@
 use Getopt::Std;
 use URI::Escape;
 use LWP::UserAgent;
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
 
-my $USAGE="USAGE: $0  [-f] [-o output] file\n";
+my $USAGE="USAGE: $0  [-d] [-e 1|0] [-f] [-o output] file\n";
 my $VERSION = <<END;
-bibzbladd v2.0
+bibzbladd v2.1
 This is free software.  You may redistribute copies of it under the
 terms of the GNU General Public License
 http://www.gnu.org/licenses/gpl.html.  There is NO WARRANTY, to the
@@ -74,7 +86,7 @@
 $USAGE
 END
 my %opts;
-getopts('fo:hV',\%opts) or die $USAGE;
+getopts('de:fo:hV',\%opts) or die $USAGE;
 
 if ($opts{h} || $opts{V}){
     print $VERSION;
@@ -97,6 +109,13 @@
 
 my $forceSearch=$opts{f};
 
+my $forceEmpty = 1;
+if (exists $opts{e}) {
+    $forceEmpty = $opts{e};
+}		
+
+my $debug = $opts{d};
+
 my $input= IO::File->new($inputfile) or 
     die "Cannot find BibTeX file $inputfile\n$USAGE\n";
 my $output = IO::File->new("> $outputfile") or 
@@ -118,19 +137,24 @@
 	print STDERR "Skipping this entry\n";
 	next;
     }
-    if (!($entry->type() eq 'ARTICLE')) {
-	print $output $entry->raw_bibtex(), "\n\n";
-	next;
-    }
     if ($entry->has('zblnumber') && !$forceSearch) {
 	print $output $entry->raw_bibtex(), "\n\n";
+	if ($debug) {
+	    print STDERR "DEBUG:  entry ", $entry->key(), 
+	    " has zblnumber ", $entry->field('zblnumber'), 
+	    " and no forced search is requested\n";
+	}
 	next;
     }
     
 
      # Now we have an entry with no Zbl.  Let us get to work.
+    if ($debug) {
+	print STDERR "DEBUG:  Searching for zbl number for entry ",
+	$entry->key, "\n";
+    }
      my $zbl = GetZbl($entry, $userAgent, $mirror);
-     if (length($zbl)) {
+     if (length($zbl) || $forceEmpty) {
  	$entry->field('zblnumber',$zbl);
      }
     print $output $entry->to_string(), "\n\n";
@@ -154,12 +178,26 @@
 
     my $string=uri_escape_utf8($entry->to_string());
     
+    if ($debug) {
+	print STDERR "DEBUG:  query: $mirror?bibtex=$string\n" ;
+    }
 
 
     my $response = $userAgent->get("$mirror?bibtex=$string");
+    if ($debug) {
+	print STDERR "DEBUG:  response: ",
+	$response->decoded_content, "\n";
+    }
+    
     if ($response->decoded_content =~ /^\s*"zbl_id":\s*"(.*)",\s*$/m) {
+	if ($debug) {
+	    print STDERR "DEBUG:  got zbl: $1\n",
+	}
 	return $1;
      } else {
+	if ($debug) {
+	    print STDERR "DEBUG: Did not get zbl\n",
+	}
  	return ("");
     }
 

Modified: trunk/Master/texmf-dist/tex/latex/crossrefware/bibdoiadd.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crossrefware/bibdoiadd.cfg	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/texmf-dist/tex/latex/crossrefware/bibdoiadd.cfg	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,7 +1,8 @@
-$mode = 'paid';  # Other option is 'free'
+#$mode = 'paid';  # Other option is 'free'
+$mode = 'free';  # Other option is 'paid'
 $email = 'user at company.domain';
-$username = 'XXXXXX';  # For paid users
-$password = 'XXXXXX';  # For paid users
+#$username = 'XXXXXX';  # For paid users
+#$password = 'XXXXXX';  # For paid users
 
 
 

Modified: trunk/Master/tlpkg/tlpsrc/crossrefware.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/crossrefware.tlpsrc	2017-04-16 22:21:38 UTC (rev 43865)
+++ trunk/Master/tlpkg/tlpsrc/crossrefware.tlpsrc	2017-04-16 22:25:15 UTC (rev 43866)
@@ -1,6 +1,12 @@
+binpattern f bin/${ARCH}/bbl2bib
+docpattern +f texmf-dist/doc/man/man1/bbl2bib.*
+#
 binpattern f bin/${ARCH}/bibdoiadd
 docpattern +f texmf-dist/doc/man/man1/bibdoiadd.*
 #
+binpattern f bin/${ARCH}/bibmradd
+docpattern +f texmf-dist/doc/man/man1/bibmradd.*
+#
 binpattern f bin/${ARCH}/bibzbladd
 docpattern +f texmf-dist/doc/man/man1/bibzbladd.*
 #



More information about the tex-live-commits mailing list