texlive[64754] trunk: crossrefware (19oct22)
commits+karl at tug.org
commits+karl at tug.org
Wed Oct 19 22:56:11 CEST 2022
Revision: 64754
http://tug.org/svn/texlive?view=revision&revision=64754
Author: karl
Date: 2022-10-19 22:56:11 +0200 (Wed, 19 Oct 2022)
Log Message:
-----------
crossrefware (19oct22)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
trunk/Build/source/texk/texlive/linked_scripts/crossrefware/biburl2doi.pl
trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
trunk/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl
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/bibdoiadd.1
trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.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/man/man1/biburl2doi.1
trunk/Master/texmf-dist/doc/man/man1/biburl2doi.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/README
trunk/Master/texmf-dist/doc/support/crossrefware/crossrefware.pdf
trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl
trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl
trunk/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl
trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl
trunk/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -86,7 +86,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -85,7 +85,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -52,7 +52,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
@@ -61,7 +61,11 @@
=cut
-use strict;
+use strict; use warnings;
+use Cwd;
+use File::Basename;
+use File::Spec;
+
BEGIN {
# find files relative to our installed location within TeX Live
chomp(my $TLMaster = `kpsewhich -var-value=TEXMFROOT`); # TL root
@@ -68,6 +72,13 @@
if (length($TLMaster)) {
unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
}
+ # find development bibtexperllibs in sibling checkout to this script,
+ # even if $0 is a symlink. All irrelevant when using from an installation.
+ my $real0 = Cwd::abs_path($0);
+ my $scriptdir = File::Basename::dirname($real0);
+ my $dev_btxperllibs = Cwd::abs_path("$scriptdir/../bibtexperllibs");
+ # we need the lib/ subdirectories inside ...
+ unshift (@INC, glob ("$dev_btxperllibs/*/lib")) if -d $dev_btxperllibs;
}
use IO::File;
use BibTeX::Parser;
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/biburl2doi.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/biburl2doi.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/biburl2doi.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -39,7 +39,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2021 Boris Veytsman
+Copyright (C) 2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -52,7 +52,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -88,7 +88,6 @@
$abbrevTitle = "ABBR. TTL."; # optional
$coden = "CODEN"; # optional
-
For a given run, all C<.rpi> data read is assumed to belong to the
journal that is specified in the configuration file. More precisely, the
configuration data is written as a C<journal_metadata> element, with
@@ -247,10 +246,10 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2012-2021 Boris Veytsman
+Copyright (C) 2012-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
-terms of the GNU General Public License
+terms of the GNU General Public License (any version)
L<https://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
extent permitted by law.
@@ -313,13 +312,13 @@
END
my $VERSION = <<END;
-ltx2crossrefxml (crossrefware) 2.51
+ltx2crossrefxml (crossrefware) 2.52
This is free software: you are free to change and redistribute it, under
the terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html (any version).
There is NO WARRANTY, to the extent permitted by law.
-Written by Boris Veytsman.
+Written by Boris Veytsman with many additions by Karl Berry
END
use Getopt::Long;
my %opts;
@@ -390,7 +389,11 @@
foreach my $issue (keys %{$papers{$year}->{$volume}}) {
PrintIssueHead($year, $volume, $issue);
my $paperList = $papers{$year}->{$volume}->{$issue};
- foreach my $paper (@{$paperList}) {
+ #warn "papers for year=$year, volume=$volume, issue=$issue\n";
+ # Nice to have the issue.xml in some stable order, so sort
+ # by starting page. Doesn't matter if it's not perfect.
+ foreach my $paper (sort { $a->{startpage} cmp $b->{startpage} }
+ @{$paperList}) {
PrintPaper($paper);
}
}
@@ -456,6 +459,7 @@
open (RPI, $rpifile)
or die "open($rpifile) failed: $! (did you process $file?)\n";
my %data;
+ #warn "reading rpi file: $rpifile\n";
while (<RPI>) {
chomp;
if (/^%([^=]*)\s*=\s*(.*)\s*$/) {
@@ -478,7 +482,8 @@
# Die if the fields we use unconditionally are empty. Not all of
# them are required by the schema, but we can wait to generalize.
- foreach my $field (qw(title year volume issue startpage endpage doi)) {
+ foreach my $field (qw(title year volume issue startpage endpage doi
+ paperUrl)) {
if (! $data{$field}) {
die ("$0: field must not be empty: $field\n "
. &debug_hash_as_string("whole hash", %data));
@@ -485,6 +490,7 @@
}
}
+ #warn &debug_hash_as_string("new issue $data{volume}:$data{issue}", %data);
push @{$papers{$data{year}}->{$data{volume}}->{$data{issue}}}, \%data;
}
@@ -558,10 +564,10 @@
# We look in the .rpi files too, which will generally have none.
if (@result == 0 && $bibfile =~ /\.bbl$/) {
- warn "$0: no \\bibitems found in: $bibfile\n";
+ warn "$0: *** no \\bibitems found in: $bibfile\n";
} elsif ($insidebibliography) {
- warn "$0: no \\end{thebibliography} found in: $bibfile\n";
- warn "$0: so the last bib entry is missing.\n";
+ warn "$0: *** no \\end{thebibliography} found in: $bibfile\n";
+ warn "$0: so the last bib entry is missing!\n";
}
return @result;
}
@@ -587,6 +593,7 @@
###############################################################
sub PrintPaper {
my $paper = shift;
+ #warn (&debug_hash_as_string ("doing paper", $paper));
my $title = SanitizeText($paper->{title});
my $url = GetURL($paper);
my $publication_type = GetPublicationType($paper->{publicationType});
@@ -736,11 +743,15 @@
. " $orig_author\n");
}
+ # for both author types, organization and person, we have to output
+ # the sequence number and the contributor role, which we assume to
+ # be author.
+ my $author_elts = qq!sequence="$seq" contributor_role="author"!;
# for organizations, nothing to do but output it.
if ($organization) {
my $line = SanitizeText($author);
print OUT <<END;
- <organization>$line</organization>
+ <organization $author_elts>$line</organization>
END
return;
}
@@ -747,11 +758,12 @@
# what's left is the common case of a person, not an organization.
print OUT <<END;
- <person_name sequence="$seq" contributor_role="author">
+ <person_name $author_elts>
END
-
+ # must split the person's name.
my $person=new BibTeX::Parser::Author ($author);
+ #warn (debug_list_as_string ($author, $person));
if ($person->first) {
my $line = $person->first;
@@ -883,3 +895,16 @@
return "$str\n";
}
+
+##############################################################
+# debug_list_as_string($LABEL, LIST)
+#
+# Same but for lists.
+##############################################################
+sub debug_list_as_string {
+ my ($label) = shift;
+ my (@list) = (ref $_[0] && $_[0] =~ /.*ARRAY.*/) ? @{$_[0]} : @_;
+
+ my $str = "$label [" . join (",", @list) . "]";
+ return "$str\n";
+}
Modified: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/man/man1/bbl2bib.1 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bbl2bib 1"
-.TH bbl2bib 1 "2021-10-02" "" "LATEX CROSSREFWARE"
+.TH bbl2bib 1 "2022-10-18" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -205,7 +205,7 @@
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2021 Boris Veytsman
+Copyright (C) 2014\-2022 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the \s-1GNU\s0 General Public License
Modified: trunk/Master/texmf-dist/doc/man/man1/bbl2bib.man1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.1 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bibdoiadd 1"
-.TH bibdoiadd 1 "2021-10-02" "" "LATEX CROSSREFWARE"
+.TH bibdoiadd 1 "2022-10-18" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -206,7 +206,7 @@
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2021 Boris Veytsman
+Copyright (C) 2014\-2022 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the \s-1GNU\s0 General Public License
Modified: trunk/Master/texmf-dist/doc/man/man1/bibdoiadd.man1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/man/man1/bibmradd.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibmradd.1 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/man/man1/bibmradd.1 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bibmradd 1"
-.TH bibmradd 1 "2021-10-02" "" "LATEX CROSSREFWARE"
+.TH bibmradd 1 "2022-10-18" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -174,7 +174,7 @@
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2021 Boris Veytsman
+Copyright (C) 2014\-2022 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the \s-1GNU\s0 General Public License
Modified: trunk/Master/texmf-dist/doc/man/man1/bibmradd.man1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/man/man1/biburl2doi.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/biburl2doi.1 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/man/man1/biburl2doi.1 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "biburl2doi 1"
-.TH biburl2doi 1 "2021-10-02" "" "LATEX CROSSREFWARE"
+.TH biburl2doi 1 "2022-10-18" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -162,7 +162,7 @@
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2021 Boris Veytsman
+Copyright (C) 2022 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the \s-1GNU\s0 General Public License
Modified: trunk/Master/texmf-dist/doc/man/man1/biburl2doi.man1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/man/man1/bibzbladd.1 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bibzbladd 1"
-.TH bibzbladd 1 "2021-10-02" "" "LATEX CROSSREFWARE"
+.TH bibzbladd 1 "2022-10-18" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -174,7 +174,7 @@
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2021 Boris Veytsman
+Copyright (C) 2014\-2022 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the \s-1GNU\s0 General Public License
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 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/man/man1/ltx2crossrefxml.1 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ltx2crossrefxml 1"
-.TH ltx2crossrefxml 1 "2021-10-02" "" "LATEX CROSSREFWARE"
+.TH ltx2crossrefxml 1 "2022-10-18" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -377,9 +377,9 @@
Boris Veytsman <https://github.com/borisveytsman/crossrefware>
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2012\-2021 Boris Veytsman
+Copyright (C) 2012\-2022 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
-terms of the \s-1GNU\s0 General Public License
+terms of the \s-1GNU\s0 General Public License (any version)
<https://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/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/crossrefware/README 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/doc/support/crossrefware/README 2022-10-19 20:56:11 UTC (rev 64754)
@@ -1,5 +1,5 @@
Crossrefware Bundle
- version 2021-10-02
+ version 2022-10-10
Scripts useful for working with Crossref, MathSciNet and Zentralblatt MATH.
@@ -30,8 +30,17 @@
Changes:
-2021-10-02 - changed TEXSELFAUTOPARENT to TEXMFROOT
+2022-09-11 - add "***" prefix to bib warnings.
+2022-07-28 - find dev checkout of bibtexperllibs.
+
+2022-05-25 - consistently output both sequence number and contributor role.
+
+2022-11-01 - sort xml output by starting page, to be more or less stable.
+
+2021-10-02 - version 2.51 released.
+ - changed TEXSELFAUTOPARENT to TEXMFROOT
+
2021-01-18 - all conversions moved from ltx2crossrefxml to LaTeX::ToUnicode.
- config file can provide a hook for processing.
Modified: trunk/Master/texmf-dist/doc/support/crossrefware/crossrefware.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -86,7 +86,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -85,7 +85,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bibmradd.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -52,7 +52,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
@@ -61,7 +61,11 @@
=cut
-use strict;
+use strict; use warnings;
+use Cwd;
+use File::Basename;
+use File::Spec;
+
BEGIN {
# find files relative to our installed location within TeX Live
chomp(my $TLMaster = `kpsewhich -var-value=TEXMFROOT`); # TL root
@@ -68,6 +72,13 @@
if (length($TLMaster)) {
unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
}
+ # find development bibtexperllibs in sibling checkout to this script,
+ # even if $0 is a symlink. All irrelevant when using from an installation.
+ my $real0 = Cwd::abs_path($0);
+ my $scriptdir = File::Basename::dirname($real0);
+ my $dev_btxperllibs = Cwd::abs_path("$scriptdir/../bibtexperllibs");
+ # we need the lib/ subdirectories inside ...
+ unshift (@INC, glob ("$dev_btxperllibs/*/lib")) if -d $dev_btxperllibs;
}
use IO::File;
use BibTeX::Parser;
Modified: trunk/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -39,7 +39,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2021 Boris Veytsman
+Copyright (C) 2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -52,7 +52,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
Modified: trunk/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl 2022-10-19 20:55:38 UTC (rev 64753)
+++ trunk/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl 2022-10-19 20:56:11 UTC (rev 64754)
@@ -88,7 +88,6 @@
$abbrevTitle = "ABBR. TTL."; # optional
$coden = "CODEN"; # optional
-
For a given run, all C<.rpi> data read is assumed to belong to the
journal that is specified in the configuration file. More precisely, the
configuration data is written as a C<journal_metadata> element, with
@@ -247,10 +246,10 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2012-2021 Boris Veytsman
+Copyright (C) 2012-2022 Boris Veytsman
This is free software. You may redistribute copies of it under the
-terms of the GNU General Public License
+terms of the GNU General Public License (any version)
L<https://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
extent permitted by law.
@@ -313,13 +312,13 @@
END
my $VERSION = <<END;
-ltx2crossrefxml (crossrefware) 2.51
+ltx2crossrefxml (crossrefware) 2.52
This is free software: you are free to change and redistribute it, under
the terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html (any version).
There is NO WARRANTY, to the extent permitted by law.
-Written by Boris Veytsman.
+Written by Boris Veytsman with many additions by Karl Berry
END
use Getopt::Long;
my %opts;
@@ -390,7 +389,11 @@
foreach my $issue (keys %{$papers{$year}->{$volume}}) {
PrintIssueHead($year, $volume, $issue);
my $paperList = $papers{$year}->{$volume}->{$issue};
- foreach my $paper (@{$paperList}) {
+ #warn "papers for year=$year, volume=$volume, issue=$issue\n";
+ # Nice to have the issue.xml in some stable order, so sort
+ # by starting page. Doesn't matter if it's not perfect.
+ foreach my $paper (sort { $a->{startpage} cmp $b->{startpage} }
+ @{$paperList}) {
PrintPaper($paper);
}
}
@@ -456,6 +459,7 @@
open (RPI, $rpifile)
or die "open($rpifile) failed: $! (did you process $file?)\n";
my %data;
+ #warn "reading rpi file: $rpifile\n";
while (<RPI>) {
chomp;
if (/^%([^=]*)\s*=\s*(.*)\s*$/) {
@@ -478,7 +482,8 @@
# Die if the fields we use unconditionally are empty. Not all of
# them are required by the schema, but we can wait to generalize.
- foreach my $field (qw(title year volume issue startpage endpage doi)) {
+ foreach my $field (qw(title year volume issue startpage endpage doi
+ paperUrl)) {
if (! $data{$field}) {
die ("$0: field must not be empty: $field\n "
. &debug_hash_as_string("whole hash", %data));
@@ -485,6 +490,7 @@
}
}
+ #warn &debug_hash_as_string("new issue $data{volume}:$data{issue}", %data);
push @{$papers{$data{year}}->{$data{volume}}->{$data{issue}}}, \%data;
}
@@ -558,10 +564,10 @@
# We look in the .rpi files too, which will generally have none.
if (@result == 0 && $bibfile =~ /\.bbl$/) {
- warn "$0: no \\bibitems found in: $bibfile\n";
+ warn "$0: *** no \\bibitems found in: $bibfile\n";
} elsif ($insidebibliography) {
- warn "$0: no \\end{thebibliography} found in: $bibfile\n";
- warn "$0: so the last bib entry is missing.\n";
+ warn "$0: *** no \\end{thebibliography} found in: $bibfile\n";
+ warn "$0: so the last bib entry is missing!\n";
}
return @result;
}
@@ -587,6 +593,7 @@
###############################################################
sub PrintPaper {
my $paper = shift;
+ #warn (&debug_hash_as_string ("doing paper", $paper));
my $title = SanitizeText($paper->{title});
my $url = GetURL($paper);
my $publication_type = GetPublicationType($paper->{publicationType});
@@ -736,11 +743,15 @@
. " $orig_author\n");
}
+ # for both author types, organization and person, we have to output
+ # the sequence number and the contributor role, which we assume to
+ # be author.
+ my $author_elts = qq!sequence="$seq" contributor_role="author"!;
# for organizations, nothing to do but output it.
if ($organization) {
my $line = SanitizeText($author);
print OUT <<END;
- <organization>$line</organization>
+ <organization $author_elts>$line</organization>
END
return;
}
@@ -747,11 +758,12 @@
# what's left is the common case of a person, not an organization.
print OUT <<END;
- <person_name sequence="$seq" contributor_role="author">
+ <person_name $author_elts>
END
-
+ # must split the person's name.
my $person=new BibTeX::Parser::Author ($author);
+ #warn (debug_list_as_string ($author, $person));
if ($person->first) {
my $line = $person->first;
@@ -883,3 +895,16 @@
return "$str\n";
}
+
+##############################################################
+# debug_list_as_string($LABEL, LIST)
+#
+# Same but for lists.
+##############################################################
+sub debug_list_as_string {
+ my ($label) = shift;
+ my (@list) = (ref $_[0] && $_[0] =~ /.*ARRAY.*/) ? @{$_[0]} : @_;
+
+ my $str = "$label [" . join (",", @list) . "]";
+ return "$str\n";
+}
More information about the tex-live-commits
mailing list.