From 7a041f7df60e851c212faf08c49567c277806e32 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 4 Feb 2024 21:10:39 +0000 Subject: crossrefware (4feb24) git-svn-id: svn://tug.org/texlive/trunk@69700 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/crossrefware/bbl2bib.pl | 2 +- .../texmf-dist/scripts/crossrefware/bibdoiadd.pl | 2 +- .../texmf-dist/scripts/crossrefware/biburl2doi.pl | 2 +- .../texmf-dist/scripts/crossrefware/bibzbladd.pl | 2 +- .../scripts/crossrefware/ltx2crossrefxml.pl | 28 ++++++++++++++-------- 5 files changed, 22 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist/scripts') diff --git a/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl b/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl index 2babf10a378..2e3df9b6856 100755 --- a/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl +++ b/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl @@ -86,7 +86,7 @@ Boris Veytsman =head1 COPYRIGHT AND LICENSE -Copyright (C) 2014-2022 Boris Veytsman +Copyright (C) 2014-2021 Boris Veytsman This is free software. You may redistribute copies of it under the terms of the GNU General Public License diff --git a/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl b/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl index c41cd31b4ff..bace84c0002 100755 --- a/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl +++ b/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl @@ -85,7 +85,7 @@ Boris Veytsman =head1 COPYRIGHT AND LICENSE -Copyright (C) 2014-2022 Boris Veytsman +Copyright (C) 2014-2021 Boris Veytsman This is free software. You may redistribute copies of it under the terms of the GNU General Public License diff --git a/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl b/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl index 9482ba29315..33f7c674904 100755 --- a/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl +++ b/Master/texmf-dist/scripts/crossrefware/biburl2doi.pl @@ -39,7 +39,7 @@ Boris Veytsman =head1 COPYRIGHT AND LICENSE -Copyright (C) 2022 Boris Veytsman +Copyright (C) 2021 Boris Veytsman This is free software. You may redistribute copies of it under the terms of the GNU General Public License diff --git a/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl b/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl index 4593e7e1721..c05a1137f76 100755 --- a/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl +++ b/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl @@ -52,7 +52,7 @@ Boris Veytsman =head1 COPYRIGHT AND LICENSE -Copyright (C) 2014-2022 Boris Veytsman +Copyright (C) 2014-2021 Boris Veytsman This is free software. You may redistribute copies of it under the terms of the GNU General Public License diff --git a/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl b/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl index 76df0427b66..5d8e16b3838 100755 --- a/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl +++ b/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl @@ -230,8 +230,15 @@ this same format. Feature request: if anyone is interested in figuring out how to generate structured citations -(L) -instead of these flat text dumps, that would be great. +(L) +instead of these flat text dumps, that would be great. Except the schema +seems to support much less than described at +L? +Anyway, the most viable approach is probably to change tugboat.bst to +output no-op TeX commands like \tubibauthor, \tubibtitle, etc. (a la +biblatex), and use those commands to discern the various crossref field +values. We can't start from the .bib because then we'd have to +reimplement Bib(La)TeX. =head1 EXAMPLES @@ -246,7 +253,7 @@ Boris Veytsman L =head1 COPYRIGHT AND LICENSE -Copyright (C) 2012-2022 Boris Veytsman +Copyright (C) 2012-2024 Boris Veytsman This is free software. You may redistribute copies of it under the terms of the GNU General Public License (any version) @@ -318,7 +325,7 @@ 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 with many additions by Karl Berry +Written by Boris Veytsman. END use Getopt::Long; my %opts; @@ -347,7 +354,7 @@ END binmode(OUT, ":utf8") } - + our $ERROR_COUNT = 0; our $depositorName = 'DEPOSITOR_NAME'; our $depositorEmail = 'DEPOSITOR_EMAIL'; our $registrant = 'REGISTRANT'; @@ -361,7 +368,6 @@ END # https://data.crossref.org/reports/help/schema_doc/4.4.2/schema_4_4_2.html#doi_batch_id our $batchId="ltx2crossref-$timestamp-$$"; - if ($opts{c}) { if (-r $opts{c}) { # if config arg is absolute, fine; if not, prepend "./" as slightly @@ -392,7 +398,7 @@ END #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} } + foreach my $paper (sort { $a->{startpage} <=> $b->{startpage} } @{$paperList}) { PrintPaper($paper); } @@ -401,7 +407,7 @@ END } PrintTail(); - exit(0); + exit($ERROR_COUNT); ##################################################### @@ -520,7 +526,8 @@ sub AddBibliography { # # allow empty \bibitem key for the sake of handwritten bbls. # Similarly, might be more stuff on the line when handwritten. - if (s/^\s*\\bibitem(?:\[.*?\])?+\s*\{(.*?)\}//) { + # Ignore a TeX %comment following. + if (s/^\s*\\bibitem(?:\[.*?\])?+\s*\{(.*?)\}\s*(%.*$)?//) { my $newkey = $1; if ($insidebibliography) { if ($currpaper) { @@ -564,10 +571,11 @@ sub AddBibliography { # 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; check if ok\n"; } elsif ($insidebibliography) { warn "$0: *** no \\end{thebibliography} found in: $bibfile\n"; warn "$0: so the last bib entry is missing!\n"; + $ERROR_COUNT++; } return @result; } -- cgit v1.2.3