Discussion:
natbib with numerical citations
(too old to reply)
Phillip Helbig (undress to reply)
2020-05-04 20:33:26 UTC
Permalink
I have

\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}

which works fine but if there are commas, then they are not part of the
superscript, but set as regular commas. Maybe I could use $^{,}$, but
this looks like a bug to me.

Any ideas?
Phillip Helbig (undress to reply)
2020-05-04 20:34:20 UTC
Permalink
Post by Phillip Helbig (undress to reply)
I have
\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}
which works fine but if there are commas, then they are not part of the
superscript, but set as regular commas. Maybe I could use $^{,}$,
Wouldn't work, of course, because "comma" is a keyword.
Phillip Helbig (undress to reply)
2020-05-05 07:33:27 UTC
Permalink
Post by Phillip Helbig (undress to reply)
I have
\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}
which works fine but if there are commas, then they are not part of the
superscript, but set as regular commas.
The dashes, for a range, ARE superscripts.
Phillip Helbig (undress to reply)
2020-05-05 13:25:27 UTC
Permalink
Post by Phillip Helbig (undress to reply)
Post by Phillip Helbig (undress to reply)
I have
\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}
which works fine but if there are commas, then they are not part of the
superscript, but set as regular commas.
The dashes, for a range, ARE superscripts.
I was surprised because to articles with the same class file and
preamble and similar contents looked different: the first doesn't have
the problem that the commas were not set as superscripts, the other
(sometimes) does. It turns out that the problem occurs only with

\citet{key1,key2}

and not with the more common

\citep{key1,key2}

and the first form isn't present in the first article.

Presumably this is a bug in natbib.

Is it still being maintained?

It's not a huge problem because the PDF I ultimately produce will then
be converted to WORD (basically by opening the PDF in WORD, which works
suprisingly well with new versions of WORD)---don't ask me why, not my
decision---, and this is something which is rather obvious to fix.
Still, it would be nice to have the PDF look as much as possible like
the finished product.

An obvious workaround would be to change

\citet{Smith83a,83b} has written about this problem

to
Smith has written about this problem\citep{Smith83a,83b}

but that is not ideal.
Phillip Helbig (undress to reply)
2020-05-06 09:16:07 UTC
Permalink
Post by Phillip Helbig (undress to reply)
Post by Phillip Helbig (undress to reply)
Post by Phillip Helbig (undress to reply)
I have
\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}
which works fine but if there are commas, then they are not part of the
superscript, but set as regular commas.
The dashes, for a range, ARE superscripts.
I was surprised because to articles with the same class file and
preamble and similar contents looked different: the first doesn't have
the problem that the commas were not set as superscripts, the other
(sometimes) does. It turns out that the problem occurs only with
\citet{key1,key2}
and not with the more common
\citep{key1,key2}
and the first form isn't present in the first article.
Presumably this is a bug in natbib.
Is it still being maintained?
It's not a huge problem because the PDF I ultimately produce will then
be converted to WORD (basically by opening the PDF in WORD, which works
suprisingly well with new versions of WORD)---don't ask me why, not my
decision---, and this is something which is rather obvious to fix.
Still, it would be nice to have the PDF look as much as possible like
the finished product.
An obvious workaround would be to change
\citet{Smith83a,83b} has written about this problem
to
Smith has written about this problem\citep{Smith83a,83b}
but that is not ideal.
In particular, I would have to modify the code for author/year
citations.

I got it working by adding

\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}

However, I think that it should already work with the options mentioned
above. Also, the documentation says:

% Use \bibpunct with 6 mandatory arguments:
% 1. opening bracket for citation
% 2. closing bracket
% 3. citation separator (for multiple citations in one \cite)
% 4. the letter n for numerical styles, s for superscripts
% else anything for author-year
% 5. punctuation between authors and date
% 6. punctuation between years (or numbers) when common authors missing

and based on that I really can't see why that fixes my problem.

Again, problem is that \citep{key1,key2} works as expected, i.e. 1,2
with everything superscripted, but \citet{key1,key2} gives (without the
bibpunct) 1,2 with the numbers, but not the comma, superscripted.
Loading...