summaryrefslogtreecommitdiff
path: root/biblio
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-21 03:01:40 +0000
committerNorbert Preining <norbert@preining.info>2023-05-21 03:01:40 +0000
commitacbf029eb7f81c05b715461ab1ce2ab7e4f6ce09 (patch)
tree1b2e5899af7b651ddc4cb4ff54c08b182cd344e7 /biblio
parent9cdcfcf8d9333b1d9b34b61ddc21910bbcc04491 (diff)
CTAN sync 202305210301
Diffstat (limited to 'biblio')
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.12
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.dtx2
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.pdfbin347218 -> 347214 bytes
-rwxr-xr-xbiblio/bibtex/utils/bibcop/bibcop.pl73
-rw-r--r--biblio/ctan-bibdata/ctan.bib26
-rw-r--r--biblio/ctan-bibdata/ctan.pdfbin3674536 -> 3676559 bytes
6 files changed, 76 insertions, 27 deletions
diff --git a/biblio/bibtex/utils/bibcop/bibcop.1 b/biblio/bibtex/utils/bibcop/bibcop.1
index 85a0e54099..9d18f8c6c2 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.1
+++ b/biblio/bibtex/utils/bibcop/bibcop.1
@@ -1,4 +1,4 @@
-.TH bibcop 1 "2023-05-18"
+.TH bibcop 1 "2023-05-20"
.SH NAME
bibcop \- Style Checker and Fixer of BibTeX Files (.bib)
.SH SYNOPSIS
diff --git a/biblio/bibtex/utils/bibcop/bibcop.dtx b/biblio/bibtex/utils/bibcop/bibcop.dtx
index d29137b21b..1a062352bc 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.dtx
+++ b/biblio/bibtex/utils/bibcop/bibcop.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{bibcop}
%<*package>
-[2023-05-18 0.0.11 Style Checker of Bibliography Files]
+[2023-05-20 0.0.12 Style Checker of Bibliography Files]
%</package>
%<*driver>
\documentclass{ltxdoc}
diff --git a/biblio/bibtex/utils/bibcop/bibcop.pdf b/biblio/bibtex/utils/bibcop/bibcop.pdf
index feaa27f284..9dd65149c7 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.pdf
+++ b/biblio/bibtex/utils/bibcop/bibcop.pdf
Binary files differ
diff --git a/biblio/bibtex/utils/bibcop/bibcop.pl b/biblio/bibtex/utils/bibcop/bibcop.pl
index 178e0047bb..1aa36d4f74 100755
--- a/biblio/bibtex/utils/bibcop/bibcop.pl
+++ b/biblio/bibtex/utils/bibcop/bibcop.pl
@@ -92,13 +92,25 @@ sub check_capitalization {
}
$pos = $pos + 1;
if (exists $minors{$word}) {
- next;
+ if ($pos eq 1) {
+ return "The minor word in the '$tag' must be upper-cased since it is the first one"
+ }
+ if (not $words[$pos - 2] =~ /^.*:$/) {
+ next;
+ }
+ return "The minor word in the '$tag' must be upper-cased, because it follows the colon"
}
- if (exists $minors{lc($word)} and $pos gt 1) {
- return "All minor words in the '$tag' must be lower-cased, while '$word' (no.$pos) is not"
+ if (exists $minors{lc($word)}) {
+ if ($pos eq 1) {
+ next;
+ }
+ if ($words[$pos - 2] =~ /^.*:$/) {
+ next;
+ }
+ return "All minor words in the '$tag' must be lower-cased, while @{[as_position($pos)]} word '$word' is not"
}
if ($word =~ /^[a-z].*/) {
- return "All major words in the '$tag' must be capitalized, while '$word' (no.$pos) is not"
+ return "All major words in the '$tag' must be capitalized, while @{[as_position($pos)]} word '$word' is not"
}
}
}
@@ -117,11 +129,19 @@ sub check_author {
if (index($author, '{') != -1) {
return;
}
- if (not $author =~ /^[A-Z][^ ]+(,( [A-Z][^ ]+)+)?( and [A-Z][^ ]+(,( [A-Z][^ ]+)+)?)*( and others)?$/) {
- return "The format of the 'author' is wrong, use something like 'Knuth, Donald E. and Duane, Bibby'"
- }
- if ($author =~ /.*[A-Z]([ ,]|$).*/) {
- return "A shortened name must have a tailing dot, as in 'Knuth, Donald E.'"
+ my @authors = split(/\s+and\s+/, $author);
+ my $pos = 0;
+ for my $a (@authors) {
+ $pos += 1;
+ if ($a eq 'others') {
+ next;
+ }
+ if (not $a =~ /^[A-Z][^ .]+( [A-Z][^ .]+)*(,( [A-Z][^ ]+)+)?$/) {
+ return "The format of @{[as_position($pos)]} 'author' is wrong, use something like 'Knuth, Donald E. and Duane, Bibby'"
+ }
+ if ($author =~ /.*[A-Z]([ ,]|$).*/) {
+ return "A shortened name must have a tailing dot in @{[as_position($pos)]} 'author', as in 'Knuth, Donald E.'"
+ }
}
}
@@ -689,6 +709,22 @@ sub clean_tex {
return $tex;
}
+# Turn a number into a position, like 1 -> 1st, 2 -> 2nd, 3 -> 3rd, 4 -> 4th, and so on.
+sub as_position {
+ my ($i) = @_;
+ my $txt;
+ if ($i == 1) {
+ $txt = '1st';
+ } elsif ($i == 2) {
+ $txt = '2nd';
+ } elsif ($i == 3) {
+ $txt = '3rd';
+ } else {
+ $txt = "${i}th";
+ }
+ return "the $txt";
+}
+
# Take a bibentry and print all its tags as a comma-separated string.
sub listed_tags {
my (%entry) = @_;
@@ -708,11 +744,10 @@ sub error {
my ($txt) = @_;
if (exists $args{'--latex'}) {
print "\\PackageError{bibcop}{$txt}{}\n";
- exit 0;
} else {
print STDERR $txt . "\n";
- exit 1;
}
+ fail();
}
# Print DEBUG message to the console.
@@ -746,6 +781,14 @@ sub warning {
}
}
+sub fail {
+ if (exists $args{'--latex'}) {
+ exit(0);
+ } else {
+ exit(1);
+ }
+}
+
if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
info("Bibcop is a Style Checker of BibTeX Files\n\n" .
"Usage:\n" .
@@ -765,7 +808,7 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
" --latex Report errors in LaTeX format using \\PackageWarningNoLine command\n\n" .
"If any issues, report to GitHub: https://github.com/yegor256/bibcop");
} elsif (exists $args{'--version'} or exists $args{'-v'}) {
- info('0.0.11');
+ info('0.0.12');
} else {
my ($file) = grep { not($_ =~ /^--.*$/) } @ARGV;
if (not $file) {
@@ -812,13 +855,19 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
}
} else {
debug((@entries+0) . ' entries found in ' . $file);
+ my $found = 0;
for my $i (0..(@entries+0 - 1)) {
my %entry = %{ $entries[$i] };
debug("Checking $entry{':name'} (no.$i)...");
foreach my $err (process_entry(%entry)) {
warning("$err, in the '$entry{':name'}' entry");
+ $found += 1;
}
}
+ if ($found gt 0) {
+ debug("$found problem(s) found");
+ fail();
+ }
}
}
diff --git a/biblio/ctan-bibdata/ctan.bib b/biblio/ctan-bibdata/ctan.bib
index 977e3a9ada..cc7bfc855f 100644
--- a/biblio/ctan-bibdata/ctan.bib
+++ b/biblio/ctan-bibdata/ctan.bib
@@ -1,7 +1,7 @@
%% bib file of all CTAN packages
%% (C) Herbert Voß
%%
-%% created at 20-05-2023, 02:00:14
+%% created at 21-05-2023, 02:01:39
%%
%% This file is provided under the terms of the LPPL v1.3 or
@@ -6741,8 +6741,8 @@
title = {The \texttt{bibcop} package},
subtitle = {Style checker for .bib files},
author = {Yegor Bugayenko},
- date = {2023-05-18},
- version = {0.0.11},
+ date = {2023-05-20},
+ version = {0.0.12},
license = {mit},
mirror = {https://mirror.ctan.org/biblio/bibtex/utils/bibcop},
url = {https://ctan.org/pkg/bibcop},
@@ -31926,8 +31926,8 @@
title = {The \texttt{huawei} package},
subtitle = {Template for Huawei documents},
author = {Yegor Bugayenko},
- date = {2022-12-13},
- version = {0.15.0},
+ date = {2023-05-20},
+ version = {0.16.0},
license = {mit},
mirror = {https://mirror.ctan.org/macros/latex/contrib/huawei},
url = {https://ctan.org/pkg/huawei},
@@ -37917,8 +37917,8 @@
title = {The \texttt{latexindent} package},
subtitle = {Indent a \LaTeX{} document, highlighting the programming structure},
author = {Chris Hughes},
- date = {2023-05-01},
- version = {3.21},
+ date = {2023-05-20},
+ version = {3.21.1},
license = {gpl3},
mirror = {https://mirror.ctan.org/support/latexindent},
url = {https://ctan.org/pkg/latexindent},
@@ -39192,8 +39192,8 @@
title = {The \texttt{lineno} package},
subtitle = {Line numbers on paragraphs},
author = {Stephan Böttcher and Uwe Lück and Karl Wette},
- date = {2023-05-18},
- version = {5.2},
+ date = {2023-05-20},
+ version = {5.3},
license = {lppl1.3a},
mirror = {https://mirror.ctan.org/macros/latex/contrib/lineno},
url = {https://ctan.org/pkg/lineno},
@@ -63988,8 +63988,8 @@
title = {The \texttt{starray} package},
subtitle = {A structured array (of properties) based on expl3},
author = {Alceu Frigeri},
- date = {2023-05-19},
- version = {1.1},
+ date = {2023-05-20},
+ version = {1.2},
license = {lppl1.3c,gpl},
mirror = {https://mirror.ctan.org/macros/latex/contrib/starray},
url = {https://ctan.org/pkg/starray},
@@ -67427,8 +67427,8 @@
title = {The \texttt{TeXLab} package},
subtitle = {\LaTeX{} Language Server},
author = {Eric Förster},
- date = {2023-05-06},
- version = {5.5.1},
+ date = {2023-05-20},
+ version = {5.6.0},
license = {gpl3},
mirror = {https://mirror.ctan.org/support/texlab},
url = {https://ctan.org/pkg/texlab},
diff --git a/biblio/ctan-bibdata/ctan.pdf b/biblio/ctan-bibdata/ctan.pdf
index 297e65527e..14279bff7d 100644
--- a/biblio/ctan-bibdata/ctan.pdf
+++ b/biblio/ctan-bibdata/ctan.pdf
Binary files differ