diff options
Diffstat (limited to 'biblio')
-rw-r--r-- | biblio/bibtex/utils/bibcop/bibcop.1 | 2 | ||||
-rw-r--r-- | biblio/bibtex/utils/bibcop/bibcop.dtx | 3 | ||||
-rw-r--r-- | biblio/bibtex/utils/bibcop/bibcop.pdf | bin | 347214 -> 347548 bytes | |||
-rwxr-xr-x | biblio/bibtex/utils/bibcop/bibcop.pl | 43 | ||||
-rw-r--r-- | biblio/ctan-bibdata/ctan.bib | 27 | ||||
-rw-r--r-- | biblio/ctan-bibdata/ctan.pdf | bin | 3677417 -> 3677738 bytes |
6 files changed, 56 insertions, 19 deletions
diff --git a/biblio/bibtex/utils/bibcop/bibcop.1 b/biblio/bibtex/utils/bibcop/bibcop.1 index 9d18f8c6c2..a925c67d1b 100644 --- a/biblio/bibtex/utils/bibcop/bibcop.1 +++ b/biblio/bibtex/utils/bibcop/bibcop.1 @@ -1,4 +1,4 @@ -.TH bibcop 1 "2023-05-20" +.TH bibcop 1 "2023-06-04" .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 1a062352bc..b152226fe7 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-20 0.0.12 Style Checker of Bibliography Files] +[2023-06-04 0.0.13 Style Checker of Bibliography Files] %</package> %<*driver> \documentclass{ltxdoc} @@ -422,6 +422,7 @@ booktitle = {{Proceedings of the International % \end{macrocode} % Then, we process package options: +% \changes{0.0.12}{2023/05/20}{A few package options introduced to give users an ability to disable certain style rules: \texttt{nocaps}, \texttt{nowraps}, \texttt{notags}, \texttt{noorg}, \texttt{noinproc}, and \texttt{nodoi}. Also, a command line scripts gets a new set of options, which start from \texttt{--no:}, for example \texttt{--no:caps}.} % \begin{macrocode} \RequirePackage{pgfopts} \pgfkeys{ diff --git a/biblio/bibtex/utils/bibcop/bibcop.pdf b/biblio/bibtex/utils/bibcop/bibcop.pdf Binary files differindex 9dd65149c7..091f5251a2 100644 --- a/biblio/bibtex/utils/bibcop/bibcop.pdf +++ b/biblio/bibtex/utils/bibcop/bibcop.pdf diff --git a/biblio/bibtex/utils/bibcop/bibcop.pl b/biblio/bibtex/utils/bibcop/bibcop.pl index 1aa36d4f74..8deffac263 100755 --- a/biblio/bibtex/utils/bibcop/bibcop.pl +++ b/biblio/bibtex/utils/bibcop/bibcop.pl @@ -56,6 +56,9 @@ sub check_mandatory_tags { } if (not(exists $entry{$tag})) { my $listed = listed_tags(%entry); + if ($tag eq 'doi' and exists $args{'--no:doi'}) { + next; + } return "A mandatory '$tag' tag for '\@$type' is missing among $listed" } } @@ -83,19 +86,20 @@ sub check_capitalization { if (not exists $tags{$tag}) { next; } + my $tailed = qr/^.+(:|\?)$/; my $value = $entry{$tag}; my @words = only_words($value); my $pos = 0; foreach my $word (@words) { + $pos = $pos + 1; if (not $word =~ /^[A-Za-z]/) { next; } - $pos = $pos + 1; if (exists $minors{$word}) { 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] =~ /^.*:$/) { + if (not $words[$pos - 2] =~ $tailed) { next; } return "The minor word in the '$tag' must be upper-cased, because it follows the colon" @@ -104,7 +108,7 @@ sub check_capitalization { if ($pos eq 1) { next; } - if ($words[$pos - 2] =~ /^.*:$/) { + if ($words[$pos - 2] =~ $tailed) { next; } return "All minor words in the '$tag' must be lower-cased, while @{[as_position($pos)]} word '$word' is not" @@ -261,6 +265,9 @@ sub check_typography { if ($tag =~ /^:.*/) { next; } + if ($tag eq 'doi') { + next; + } my $value = $entry{$tag}; foreach my $s (@bad_tails) { if ($s eq '.' and $tag eq 'author') { @@ -324,7 +331,13 @@ sub check_ascii { for my $pos (0..length($value)-1) { my $char = substr($value, $pos, 1); my $ord = ord($char); - if ($ord < 20 or $ord > 0x7f) { + if ($ord == 9 || $ord == 10 || $ord == 13) { + next; + } + if ($ord < 20) { + return "In the '$tag', don't use control symbol '0x" . (sprintf '%04x', $ord) . "'" + } + if ($ord > 0x7f) { return "In the '$tag', don't use Unicode symbol '0x" . (sprintf '%04x', $ord) . "'" } } @@ -489,7 +502,7 @@ sub process_entry { sub fix_author { my ($value) = @_; - my @authors = split(/\s?and\s?/, $value); + my @authors = split(/\s+and\s+/, $value); foreach my $author (@authors) { $author =~ s/^\s+|\s+$//g; $author =~ s/ ([A-Z])($| )/ $1.$2/g; @@ -797,6 +810,7 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) { " -v, --version Print the current version of the tool and exit\n" . " -?, --help Print this help screen\n" . " --fix Fix the errors and print a new version of the .bib file to the console\n" . + " -i, --in-place When used together with --fix, modifies the file in place, doesn't print it to the console\n" . " --verbose Print supplementary debugging information\n" . " --no:XXX Disable one of the following checks (e.g. --no:wraps):\n" . " tags Only some tags are allowed, while some of them are mandatory\n" . @@ -808,7 +822,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.12'); + info('0.0.13'); } else { my ($file) = grep { not($_ =~ /^--.*$/) } @ARGV; if (not $file) { @@ -818,12 +832,16 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) { my $bib; { local $/; $bib = <$fh>; } my @entries = entries($bib); if (exists $args{'--fix'}) { + my $fixed = ''; for my $i (0..(@entries+0 - 1)) { my %entry = %{ $entries[$i] }; my $type = $entry{':type'}; if (not exists $blessed{$type}) { error("I don't know what to do with \@$type type of BibTeX entry"); } + if (not exists $entry{':name'}) { + error("I don't know what to do with an entry without a name"); + } my $tags = $blessed{$entry{':type'}}; my %allowed = map { $_ => 1 } @$tags; my @lines; @@ -846,12 +864,19 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) { } push(@lines, " $tag = {$value},"); } - info("\@$type\{$entry{':name'},"); + $fixed = $fixed . "\@$type\{$entry{':name'},\n"; my @sorted = sort @lines; foreach my $line (@sorted) { - info($line); + $fixed = $fixed . $line . "\n"; } - info("}\n"); + $fixed = $fixed . "}\n\n"; + } + if (exists $args{'-i'} or exists $args{'--in-place'}) { + open(my $out, '>', $file) or error('Cannot open file for writing: ' . $file); + print $out $fixed; + close($out); + } else { + info($fixed); } } else { debug((@entries+0) . ' entries found in ' . $file); diff --git a/biblio/ctan-bibdata/ctan.bib b/biblio/ctan-bibdata/ctan.bib index 378a5e529d..8b8706fd33 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 04-06-2023, 02:01:15 +%% created at 05-06-2023, 02:00:47 %% %% 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-20}, - version = {0.0.12}, + date = {2023-06-04}, + version = {0.0.13}, license = {mit}, mirror = {https://mirror.ctan.org/biblio/bibtex/utils/bibcop}, url = {https://ctan.org/pkg/bibcop}, @@ -15010,7 +15010,7 @@ title = {The \texttt{context-sudoku} package}, subtitle = {Sudokus for ConTeXt}, author = {Jairo A. del Rio}, - date = {2023-05-22}, + date = {2023-06-04}, version = {}, license = {mit}, mirror = {https://mirror.ctan.org/macros/context/contrib/context-sudoku}, @@ -35082,6 +35082,17 @@ url = {https://ctan.org/pkg/jourcl}, } +@manual{ctan-jourrr, + title = {The \texttt{jourrr} package}, + subtitle = {A \LaTeX{} template for journal rebuttal letters}, + author = {Rok Kukovec}, + date = {2023-06-04}, + version = {}, + license = {cc-by-sa-4}, + mirror = {https://mirror.ctan.org/macros/latex/contrib/jourrr}, + url = {https://ctan.org/pkg/jourrr}, +} + @manual{ctan-joy-of-tex, title = {The \texttt{joy-of-tex} package}, subtitle = {User documentation for the AMS-TeX macro collection}, @@ -48089,8 +48100,8 @@ title = {The \texttt{nicematrix} package}, subtitle = {Improve the typesetting of mathematical matrices with PGF}, author = {François Pantigny}, - date = {2023-05-25}, - version = {6.19a}, + date = {2023-06-04}, + version = {6.20}, license = {lppl1.3}, mirror = {https://mirror.ctan.org/macros/latex/contrib/nicematrix}, url = {https://ctan.org/pkg/nicematrix}, @@ -64024,8 +64035,8 @@ title = {The \texttt{starray} package}, subtitle = {A structured array (of properties) based on expl3}, author = {Alceu Frigeri}, - date = {2023-05-20}, - version = {1.2}, + date = {2023-06-04}, + version = {1.3}, license = {lppl1.3c,gpl}, mirror = {https://mirror.ctan.org/macros/latex/contrib/starray}, url = {https://ctan.org/pkg/starray}, diff --git a/biblio/ctan-bibdata/ctan.pdf b/biblio/ctan-bibdata/ctan.pdf Binary files differindex 77a0cfb4bb..1e310b996d 100644 --- a/biblio/ctan-bibdata/ctan.pdf +++ b/biblio/ctan-bibdata/ctan.pdf |