summaryrefslogtreecommitdiff
path: root/biblio
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-17 03:01:58 +0000
committerNorbert Preining <norbert@preining.info>2023-05-17 03:01:58 +0000
commit92ffb9032b85f818a8d3b469ad4d3889c2a44ba1 (patch)
tree54bc1ce009357117a376baa5ffa223f904acee4f /biblio
parent95bdae3d8a40af1f2f82f786dc29d3761fe431f1 (diff)
CTAN sync 202305170301
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.pdfbin343290 -> 343404 bytes
-rwxr-xr-xbiblio/bibtex/utils/bibcop/bibcop.pl101
-rw-r--r--biblio/ctan-bibdata/ctan.bib44
-rw-r--r--biblio/ctan-bibdata/ctan.pdfbin3673546 -> 3673155 bytes
6 files changed, 121 insertions, 28 deletions
diff --git a/biblio/bibtex/utils/bibcop/bibcop.1 b/biblio/bibtex/utils/bibcop/bibcop.1
index 19bb874117..93e3ccd28e 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.1
+++ b/biblio/bibtex/utils/bibcop/bibcop.1
@@ -1,4 +1,4 @@
-.TH bibcop 1 "2023-02-13"
+.TH bibcop 1 "2023-05-16"
.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 e688e2379e..a1a5a08c99 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-02-13 0.0.9 Style Checker of Bibliography Files]
+[2023-05-16 0.0.10 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 09a4e1e5d0..be16c4e36d 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 eb337fc365..cfe8e3ac47 100755
--- a/biblio/bibtex/utils/bibcop/bibcop.pl
+++ b/biblio/bibtex/utils/bibcop/bibcop.pl
@@ -40,6 +40,8 @@ my %blessed = (
'misc' => ['title', 'author', 'year', 'eprint?', 'archiveprefix?', 'primaryclass?', 'publisher?', 'organization?', 'doi?', 'url?'],
);
+my %minors = map { $_ => 1 } qw/in of at to by the a an and or as if up via yet nor but off on for into/;
+
# Check the presence of mandatory tags.
sub check_mandatory_tags {
my (%entry) = @_;
@@ -71,7 +73,6 @@ sub check_mandatory_tags {
sub check_capitalization {
my (%entry) = @_;
my %tags = map { $_ => 1 } qw/title booktitle journal publisher organization/;
- my %minors = map { $_ => 1 } qw/in of at to by the a an and or as if up via yet nor but off on for into/;
foreach my $tag (keys %entry) {
if (not exists $tags{$tag}) {
next;
@@ -241,13 +242,13 @@ sub check_typography {
}
}
foreach my $s (@space_before) {
- if ($value =~ /^.*[^\s]\Q$s\E.*$/) {
+ if ($value =~ /^.*[^\{\s]\Q$s\E.*$/) {
return "In the '$tag', put a space before the $symbols{$s}"
}
}
foreach my $s (@space_after) {
my $p = join('', @no_space_before);
- if ($value =~ /^.*\Q$s\E[^\s\Q$p\E].*$/) {
+ if ($value =~ /^.*\Q$s\E[^\}\s\Q$p\E].*$/) {
return "In the '$tag', put a space after the $symbols{$s}"
}
}
@@ -435,6 +436,92 @@ sub process_entry {
return @errors;
}
+sub fix_author {
+ my ($value) = @_;
+ my @authors = split(/\s?and\s?/, $value);
+ foreach my $author (@authors) {
+ $author =~ s/^\s+|\s+$//g;
+ $author =~ s/ ([A-Z])($| )/ $1.$2/g;
+ }
+ return join(' and ', @authors);
+}
+
+sub fix_number {
+ my ($value) = @_;
+ $value =~ s/^0+//g;
+ return $value;
+}
+
+sub fix_capitalization {
+ my ($value) = @_;
+ my @words = split(/\s+/, $value);
+ my $pos = 0;
+ foreach my $word (@words) {
+ $pos += 1;
+ if (not $word =~ /^[A-Za-z]/) {
+ next;
+ }
+ if (exists $minors{$word}) {
+ next;
+ }
+ if (exists $minors{lc($word)} and $pos gt 1) {
+ $word = lc($word);
+ next;
+ }
+ if ($word =~ /^[a-z].*/) {
+ $word =~ s/^([a-z])/\U$1/g;
+ }
+ if (index($word, '-') != -1) {
+ $word =~ s/-([a-z])/-\U$1/g;
+ }
+ }
+ return join(' ', @words);
+}
+
+sub fix_title {
+ my ($value) = @_;
+ $value = fix_capitalization($value);
+ return $value;
+}
+
+sub fix_pages {
+ my ($value) = @_;
+ if ($value =~ /^[1-9][0-9]*$/) {
+ return $value;
+ }
+ my ($left, $right) = split(/---|--|-|—|\s/, $value);
+ $left =~ s/^0+//g;
+ $right =~ s/^0+//g;
+ return $left . '--' . $right;
+}
+
+sub fix_booktitle {
+ my ($value) = @_;
+ $value = fix_capitalization($value);
+ if (index($value, 'Proceedings ') != 0) {
+ $value = 'Proceedings of the ' . $value;
+ }
+ return $value;
+}
+
+sub fix_journal {
+ my ($value) = @_;
+ $value = fix_capitalization($value);
+ return $value;
+}
+
+sub fix_publisher {
+ my ($value) = @_;
+ $value = fix_capitalization($value);
+ return $value;
+}
+
+sub fix_organization {
+ my ($value) = @_;
+ $value = fix_capitalization($value);
+ return $value;
+}
+
# Parse the incoming .bib file and return an array
# of hash-maps, where each one is a bibentry.
sub entries {
@@ -640,7 +727,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.9');
+ info('0.0.10');
} else {
my ($file) = grep { not($_ =~ /^--.*$/) } @ARGV;
if (not $file) {
@@ -667,6 +754,12 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
next;
}
my $value = clean_tex($entry{$tag});
+ my $fixer = "fix_$tag";
+ my $fixed = $value;
+ if (defined &{$fixer}) {
+ no strict 'refs';
+ $value = $fixer->($value);
+ }
if ($tag =~ /title|booktitle|journal/) {
$value = '{' . $value . '}';
}
diff --git a/biblio/ctan-bibdata/ctan.bib b/biblio/ctan-bibdata/ctan.bib
index fa34983986..14d8b51f99 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 16-05-2023, 02:00:59
+%% created at 17-05-2023, 02:00:14
%%
%% This file is provided under the terms of the LPPL v1.3 or
@@ -937,8 +937,8 @@
title = {The \texttt{adobeornaments} package},
subtitle = {Using ornaments in Adobe Fonts with Lua\LaTeX{} or \XeLaTeX{}},
author = {Elijah Z Granet},
- date = {2023-05-15},
- version = {1.0.0},
+ date = {2023-05-16},
+ version = {1.0.1},
license = {lppl1.3c,cc-by-sa-3},
mirror = {https://mirror.ctan.org/macros/unicodetex/latex/adobeornaments},
url = {https://ctan.org/pkg/adobeornaments},
@@ -6741,8 +6741,8 @@
title = {The \texttt{bibcop} package},
subtitle = {Style checker for .bib files},
author = {Yegor Bugayenko},
- date = {2023-02-13},
- version = {0.0.9},
+ date = {2023-05-16},
+ version = {0.0.10},
license = {mit},
mirror = {https://mirror.ctan.org/biblio/bibtex/utils/bibcop},
url = {https://ctan.org/pkg/bibcop},
@@ -13685,8 +13685,8 @@
subtitle = {A minimalist set of commands (expl3 based) to describe
Document and Class level commands/functions},
author = {Alceu Frigeri},
- date = {2023-05-13},
- version = {1.0},
+ date = {2023-05-16},
+ version = {1.1},
license = {lppl1.3c,gpl},
mirror = {https://mirror.ctan.org/macros/latex/contrib/codedescribe},
url = {https://ctan.org/pkg/codedescribe},
@@ -23832,7 +23832,7 @@
title = {The \texttt{expl3} package},
subtitle = {Wrapper package for experimental \LaTeX{}3},
author = {{The \LaTeX{} Project Team}},
- date = {2023-05-11},
+ date = {2023-05-16},
version = {},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/contrib/l3kernel},
@@ -36183,8 +36183,8 @@
title = {The \texttt{kpfonts-otf} package},
subtitle = {OTF version of the Kp-fonts},
author = {Daniel Flipo},
- date = {2023-03-31},
- version = {0.51},
+ date = {2023-05-16},
+ version = {0.52},
license = {ofl,lppl1.3},
mirror = {https://mirror.ctan.org/fonts/kpfonts-otf},
url = {https://ctan.org/pkg/kpfonts-otf},
@@ -36473,7 +36473,7 @@
title = {The \texttt{l3docstrip} package},
subtitle = {Strip documentation in \LaTeX{}3 source},
author = {{The \LaTeX{} Project Team}},
- date = {2023-05-11},
+ date = {2023-05-16},
version = {},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/contrib/l3kernel},
@@ -36495,7 +36495,7 @@
title = {The \texttt{l3kernel} package},
subtitle = {LaTeX3 programming conventions},
author = {{The \LaTeX{} Project Team}},
- date = {2023-05-11},
+ date = {2023-05-16},
version = {},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/contrib/l3kernel},
@@ -36528,7 +36528,7 @@
title = {The \texttt{l3regex} package},
subtitle = {Regular expression facilities for \LaTeX{}},
author = {{The \LaTeX{} Project Team}},
- date = {2023-05-11},
+ date = {2023-05-16},
version = {},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/contrib/l3kernel/l3regex.dtx},
@@ -56625,7 +56625,7 @@
title = {The \texttt{ptlatexcommands} package},
subtitle = {\LaTeX{} to commands in Portuguese},
author = {Geraldo Pereira de Morais Junior},
- date = {2023-05-15},
+ date = {2023-05-16},
version = {0.1},
license = {mit},
mirror = {https://mirror.ctan.org/macros/latex/contrib/ptlatexcommands},
@@ -63961,8 +63961,8 @@
title = {The \texttt{starray} package},
subtitle = {A structured array (of properties) based on expl3},
author = {Alceu Frigeri},
- date = {2023-05-13},
- version = {1.0},
+ date = {2023-05-16},
+ version = {1.1},
license = {lppl1.3c,gpl},
mirror = {https://mirror.ctan.org/macros/latex/contrib/starray},
url = {https://ctan.org/pkg/starray},
@@ -65720,8 +65720,8 @@
title = {The \texttt{tagpdf} package},
subtitle = {Tools for experimenting with tagging using pdf\LaTeX{} and LuaLaTeX},
author = {Ulrike Fischer},
- date = {2023-04-25},
- version = {0.98f},
+ date = {2023-05-16},
+ version = {0.98g},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/contrib/tagpdf},
url = {https://ctan.org/pkg/tagpdf},
@@ -68025,8 +68025,8 @@
title = {The \texttt{textcsc} package},
subtitle = {Simple commands for caps-to-small-caps text},
author = {Elijah Z Granet},
- date = {2023-04-24},
- version = {1.1.0},
+ date = {2023-05-16},
+ version = {1.2.0},
license = {lppl1.3,cc-by-sa-3},
mirror = {https://mirror.ctan.org/macros/unicodetex/latex/textcsc},
url = {https://ctan.org/pkg/textcsc},
@@ -69143,8 +69143,8 @@
title = {The \texttt{tikz-nfold} package},
subtitle = {Triple, quadruple, and n-fold paths with TikZ},
author = {Jonathan Schulz},
- date = {2023-05-04},
- version = {0.1.1},
+ date = {2023-05-16},
+ version = {0.1.2},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/graphics/pgf/contrib/tikz-nfold},
url = {https://ctan.org/pkg/tikz-nfold},
diff --git a/biblio/ctan-bibdata/ctan.pdf b/biblio/ctan-bibdata/ctan.pdf
index a29ad5b286..2acb554f18 100644
--- a/biblio/ctan-bibdata/ctan.pdf
+++ b/biblio/ctan-bibdata/ctan.pdf
Binary files differ