Skip to content

Commit

Permalink
#28 add proceedings
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 16, 2023
1 parent 644518a commit ef87584
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 15 deletions.
9 changes: 6 additions & 3 deletions bibcop.pl
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ sub fix_author {
my @authors = split(/\s?and\s?/, $value);
foreach my $author (@authors) {
$author =~ s/^\s+|\s+$//g;
$author =~ s/ ([A-Z])($| )/ \1.\2/g;
$author =~ s/ ([A-Z])($| )/ $1.$2/g;
}
return join(' and ', @authors);
}
Expand Down Expand Up @@ -469,10 +469,10 @@ sub fix_capitalization {
next;
}
if ($word =~ /^[a-z].*/) {
$word =~ s/^([a-z])/\U\1/g;
$word =~ s/^([a-z])/\U$1/g;
}
if (index($word, '-') != -1) {
$word =~ s/-([a-z])/-\U\1/g;
$word =~ s/-([a-z])/-\U$1/g;
}
}
return join(' ', @words);
Expand All @@ -487,6 +487,9 @@ sub fix_title {
sub fix_booktitle {
my ($value) = @_;
$value = fix_capitalization($value);
if (index($value, 'Proceedings ') != 0) {
$value = 'Proceedings of the ' . $value;
}
return $value;
}

Expand Down
3 changes: 3 additions & 0 deletions perl-tests/fixing.pl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ package bibcop;
fixes('title', 'Executing a program on the MIT architecture', 'Executing a Program on the MIT Architecture');
fixes('title', 'Executing a program on the MIT Tagged-token Dataflow architecture', 'Executing a Program on the MIT Tagged-Token Dataflow Architecture');

fixes('booktitle', 'Proceedings of IEEE Symposium on Art', 'Proceedings of IEEE Symposium on Art');
fixes('booktitle', 'Symposium on Computers', 'Proceedings of the Symposium on Computers');

fixes('number', '02', '2');
fixes('number', '007', '7');
fixes('number', '16', '16');
Expand Down
3 changes: 3 additions & 0 deletions testfiles/biblatex.luatex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Warning: Citation 'dijkstra1968letters' on page 1 undefined on input line ....
3 changes: 3 additions & 0 deletions testfiles/biblatex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Warning: Citation 'dijkstra1968letters' on page 1 undefined on input line ....
3 changes: 3 additions & 0 deletions testfiles/biblatex.xetex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Warning: Citation 'dijkstra1968letters' on page 1 undefined on input line ....
14 changes: 10 additions & 4 deletions testfiles/bibtex.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Warning: Citation `dijkstra1968letters' on page 1 undefined on input line ....
runsystem((perl ./bibcop.pl --verbose --latex 'main.bib') > iexec.tmp 2>&1; /bin/echo -n $?% >iexec.ret)...executed
(iexec.tmp
! Undefined control sequence.
l. ...\1
better written as $1 at ./bibcop.pl line 444.
(iexec.tmp bibcop: 1 entries found in main.bib
bibcop: Checking dijkstra1968letters (no.0)...
Package bibcop Warning: All minor words in the 'title' must be lower-cased, while 'To' (no.6) is not, in the 'dijkstra1968letters' entry.
Package bibcop Warning: A mandatory 'doi' tag for '@article' is missing among (author, journal, number, pages, publisher, title, volume, year), in the 'dijkstra1968letters' entry.
Package bibcop Warning: The 'title' must be wrapped in double curled brackets, in the 'dijkstra1968letters' entry.
) iexec: The content of 'iexec.tmp' was included into the document
runsystem(rm iexec.tmp)...executed
runsystem(rm iexec.ret)...executed
bibcop: style checking finished
(bibtex.bbl)
14 changes: 10 additions & 4 deletions testfiles/bibtex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Warning: Citation `dijkstra1968letters' on page 1 undefined on input line ....
runsystem((perl ./bibcop.pl --verbose --latex 'main.bib') > iexec.tmp 2>&1; /bin/echo -n $?% >iexec.ret)...executed.
(iexec.tmp
! Undefined control sequence.
l. ...\1
better written as $1 at ./bibcop.pl line 444.
(iexec.tmp bibcop: 1 entries found in main.bib
bibcop: Checking dijkstra1968letters (no.0)...
Package bibcop Warning: All minor words in the 'title' must be lower-cased, while 'To' (no.6) is not, in the 'dijkstra1968letters' entry.
Package bibcop Warning: A mandatory 'doi' tag for '@article' is missing among (author, journal, number, pages, publisher, title, volume, year), in the 'dijkstra1968letters' entry.
Package bibcop Warning: The 'title' must be wrapped in double curled brackets, in the 'dijkstra1968letters' entry.
) iexec: The content of 'iexec.tmp' was included into the document
runsystem(rm iexec.tmp)...executed.
runsystem(rm iexec.ret)...executed.
bibcop: style checking finished
(bibtex.bbl)
14 changes: 10 additions & 4 deletions testfiles/bibtex.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Warning: Citation `dijkstra1968letters' on page 1 undefined on input line ....
runsystem((perl ./bibcop.pl --verbose --latex 'main.bib') > iexec.tmp 2>&1; /bin/echo -n $?% >iexec.ret)...executed.
(iexec.tmp
! Undefined control sequence.
l. ...\1
better written as $1 at ./bibcop.pl line 444.
(iexec.tmp bibcop: 1 entries found in main.bib
bibcop: Checking dijkstra1968letters (no.0)...
Package bibcop Warning: All minor words in the 'title' must be lower-cased, while 'To' (no.6) is not, in the 'dijkstra1968letters' entry.
Package bibcop Warning: A mandatory 'doi' tag for '@article' is missing among (author, journal, number, pages, publisher, title, volume, year), in the 'dijkstra1968letters' entry.
Package bibcop Warning: The 'title' must be wrapped in double curled brackets, in the 'dijkstra1968letters' entry.
) iexec: The content of 'iexec.tmp' was included into the document
runsystem(rm iexec.tmp)...executed.
runsystem(rm iexec.ret)...executed.
bibcop: style checking finished
(bibtex.bbl)

0 comments on commit ef87584

Please sign in to comment.