compholio / jabbrv

Automatic Journal Title Abbreviation Package for LaTeX
71 stars 45 forks source link

Incorrect Abbreviation for Singular (versus Plural) Words in Three-Word Journal Name #31

Closed shanewstone closed 2 years ago

shanewstone commented 2 years ago

Hello and thank you for jabbrv. I have noticed the problem below when citing articles in "Geophysical Research Letters." I am using a fresh clone of the jabbrv GitHub repository.

Here is a minimal example using jabbrv_unsrt.bst as the bibliography style. Notice that "Geophysical Research Letters" is abbreviated to "Geophys. ResearchLett." instead of "Geophys. Res. Lett."

The journal "Journal of Geophysical Research: Planets" is formatted correctly as "J. Geophys. Res. Planets"

If one replaces "Geophysical Research Letters" with "Geophysical Researches Letters" then the correct abbreviation is obtained ("Geophys. Res. Lett.").

Similar incorrect behavior is observed for, as an example, "Geophysical Review Letters" (abbreviated to "Geophys. ReviewLett.") but "Geophysical Reviews Letters" works correctly (abbreviated to "Geophys. Rev. Lett.").

I am not sure, but it looks like there may be extra space after "Geophys." in any of the three-word name cases (that is, in the abbreviations of Geophysical Research(es) Letters or Geophysical Review(s) Letters).

\documentclass[8pt]{article}
\usepackage{jabbrv}
\usepackage[super,sort&compress]{natbib}
% \bibliographystyle{jabbrv_unsrt.bst}

\author{Test Author}
\title{Test Document}
\date{}

\begin{document}

\maketitle

\section{Test Section}

This is some test text.\cite{test1,test2} And this is an odd fix.\cite{test3}

\begin{thebibliography}{1}

\bibitem{test1}
Test Author.
\newblock Test article one, abbreviation is correct.
\newblock {\em\JournalTitle{Journal of Geophysical Research: Planets}},
  123(45):6789--6800, 2050.

\bibitem{test2}
Test Author.
\newblock Test article two, abbreviation is incorrect.
\newblock {\em\JournalTitle{Geophysical Research Letters}}, 4111(332):500--1000, 2050.

\bibitem{test3}
Test Author.
\newblock Test article three, abbreviation is correct if the name of the journal is changed to plural.
\newblock {\em\JournalTitle{Geophysical Researches Letters}}, 4111(332):500--1000, 2050.
\end{thebibliography}

\end{document}

screenshot_20220407_1813_1

compholio commented 2 years ago

Notice that "Geophysical Research Letters" is abbreviated to "Geophys. ResearchLett." instead of "Geophys. Res. Lett."

Okay, this appears to be two issues:

  1. I introduced a bug in the latest commit (7259152f0244aa7d6054098b9fef3eeec5ba2872) trying to solve Issue #30
  2. "Research" is not being abbreviated at all

The first one is going to take me a bit to figure out, the second one is just off an off by one issue that I'll have taken care of shortly. Would you mind opening another issue for the missing space?

shanewstone commented 2 years ago

I do not see any issues at all after 99363cb. Thanks!

compholio commented 2 years ago

Glad I could help, yeah - it ended up being easier than I expected. Turns out the first time I took a look at the space issue I didn't notice that I forgot a % at the end of a line (see 06226f616e0218d751f3afbd4124f679073c6f90).