Skip to content

Commit f2aacd9

Browse files
authored
Fixed one word journal title with period
A one word journal title finishing with a period was still abbreviated before. Added the original BibTeX styles for easier testing. Added the Vancouver BibTeX styles to test an example where a period is always added after the journal title.
1 parent 160abb8 commit f2aacd9

9 files changed

+6943
-17
lines changed

example.bib

+83-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,96 @@
1+
@article{ref:TestNoPeriod,
2+
author = {Normal Article Reference},
3+
title = {A one word journal title in first position},
4+
journal = {OneWord},
5+
publisher = {A. Good Publisher},
6+
pages = {1--1000},
7+
place = {Golden, Colorado},
8+
year = {2010}
9+
}
10+
111
@article{ref:Test,
212
author = {Normal Article Reference},
3-
title = {The Title of a Good Normal Reference},
13+
title = {The Title of a Good Normal Reference abbreviated},
414
journal = {Test Journal of Reference Information},
515
publisher = {A. Good Publisher},
616
pages = {1--1000},
717
place = {Golden, Colorado},
818
year = {2010}
919
}
1020

21+
@article{ref:TestPeriod,
22+
author = {Normal Article Reference},
23+
title = {A second one word journal title after another one abbreviated},
24+
journal = {OneWord},
25+
publisher = {A. Good Publisher},
26+
pages = {1--1000},
27+
place = {Golden, Colorado},
28+
year = {2010}
29+
}
30+
31+
@article{ref:TestPeriodTwoWords,
32+
author = {Normal Article Reference},
33+
title = {Journal title without abbreviation},
34+
journal = {Two Words},
35+
publisher = {A. Good Publisher},
36+
pages = {1--1000},
37+
place = {Golden, Colorado},
38+
year = {2010}
39+
}
40+
41+
@article{ref:TestPeriodRefInf,
42+
author = {Normal Article Reference},
43+
title = {Journal title entered: ``Reference Information''},
44+
journal = {Reference Information},
45+
publisher = {A. Good Publisher},
46+
pages = {1--1000},
47+
place = {Golden, Colorado},
48+
year = {2010}
49+
}
50+
51+
@article{ref:TestPeriodInf,
52+
author = {Normal Article Reference},
53+
title = {Journal title entered: ``Information''},
54+
journal = {Information},
55+
publisher = {A. Good Publisher},
56+
pages = {1--1000},
57+
place = {Golden, Colorado},
58+
year = {2010}
59+
}
60+
61+
@article{ref:TestMyAbbrvOneWord,
62+
author = {Normal Article Reference},
63+
title = {Keep the period after a non-abbreviated journal title: One Word.},
64+
journal = {MyAbbrv.},
65+
publisher = {A. Good Publisher},
66+
pages = {1--1000},
67+
place = {Golden, Colorado},
68+
year = {2010}
69+
}
70+
71+
@article{ref:TestMyAbbrvTwoWords,
72+
author = {Normal Article Reference},
73+
title = {Keep the period after a non-abbreviated journal title: Two Words},
74+
journal = {Two MyAbbrv.},
75+
publisher = {A. Good Publisher},
76+
pages = {1--1000},
77+
place = {Golden, Colorado},
78+
year = {2010}
79+
}
80+
81+
@article{ref:TestPeriodInfPeriod,
82+
author = {Normal Article Reference},
83+
title = {With the option oneword, journal title containing a end period are still abbreviated},
84+
journal = {Information.},
85+
publisher = {A. Good Publisher},
86+
pages = {1--1000},
87+
place = {Golden, Colorado},
88+
year = {2010}
89+
}
90+
1191
@article{ref:CmdTest,
1292
author = {Command Article Reference},
13-
title = {The Title of a Good Command Reference},
93+
title = {Test of the journal title custom command},
1494
journal = {\tjri},
1595
publisher = {A. Good Publisher},
1696
pages = {1000--1001},
@@ -20,7 +100,7 @@ @article{ref:CmdTest
20100

21101
@article{ref:AbbrvTest,
22102
author = {Abbreviated Article Reference},
23-
title = {The Title of a Good Abbreviated Reference},
103+
title = {Journal title entered: ``Test J. of Reference Inf.''},
24104
journal = {Test J. of Reference Inf.},
25105
publisher = {A. Good Publisher},
26106
pages = {1002--1050},

jabbrv.sty

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
%% 2018_02_07 - Modifications of Marie-Jean Thoraval ([email protected]):
2+
%% Suppress the end period after non-abbreviated journal titles.
3+
%%
14
%% Copyright 2010 Erich Hoover
25
36
%%
@@ -54,10 +57,7 @@
5457
%% abbreviate and the second parameter is the actual abbreviation,
5558
%% for example:
5659
%% \DefineJournalAbbreviation{Journal}{J}
57-
%% Important Note!: Adding a period after the abbreviation is
58-
%% automatically handled by the package, if you do not wish to
59-
%% have periods after abbreviations then enable the "noperiod"
60-
%% package option. \DefineJournalPartialAbbreviation takes two
60+
%% \DefineJournalPartialAbbreviation takes two
6161
%% parameters juts like \DefineJournalAbbreviation; however,
6262
%% \DefineJournalPartialAbbreviation creates an entry that matches
6363
%% any title that begins with the first parameter, for example:
@@ -96,7 +96,6 @@
9696
\journal@output@abbrv%
9797
\else%
9898
\the\temp@journal@text%
99-
\global\@end@period@false%
10099
\fi%
101100
}
102101

@@ -408,11 +407,17 @@
408407
% Properly handle where the user has entered abbreviations themselves,
409408
% in that case we don't want to get a double-period at the end of the entry.
410409
\ifx .\@jrnl@temp@char%
411-
\journal@output@abbrv%
410+
\expandafter\ifnum\value{jabbrv@word@count} > 0\relax%
411+
\journal@output@abbrv%
412+
\let\@tempa\@journal@gobble%
413+
\else%
414+
% Do not remove the period at the end of a user defined journal title,
415+
% in case that he has defined a one word journal title abbreviation
416+
\jabbrv@one@word@title%
417+
\fi%
412418
\temp@journal@text{}%
413419
\@no@space@true%
414420
\@special@period@true%
415-
\let\@tempa\@journal@gobble%
416421
\else%
417422
% \journal@char@stop is specially defined so this routine knows
418423
% when the entire text has been read (where to stop)
@@ -461,7 +466,7 @@
461466
% journal abbreviation replacements should be performed.
462467
\providecommand{\JournalTitle}[1]{%
463468
\@abbreviate@journal@true%
464-
\@end@period@false%
469+
\global\@end@period@false%
465470
\begingroup%
466471
\jabbrv@redefine@diacritic%
467472
\edef\journal@fulltitle{#1}%
@@ -480,8 +485,6 @@
480485
#1%
481486
\journal@char@stop%
482487
\endgroup%
483-
\else
484-
\global\@end@period@false%
485488
\fi%
486489
% If the next character is not a period then add one in
487490
% if the last character would have been a period
@@ -491,7 +494,7 @@
491494
% Declare an option for disabling periods
492495
\DeclareVoidOption{noperiod}{\@show@period@false}
493496

494-
% Declare an option for disabling periods
497+
% Declare an option for abbreviating one word titles
495498
\DeclareVoidOption{oneword}{\@jabbrv@abbrv@one@word@title@true}
496499

497500
% Declare an option for enabling undefined abbreviation warnings

0 commit comments

Comments
 (0)