[Tex/LaTex] Superscript page numbers with natbib

bibliographiescitingnatbibsuperscripts

I'm with an annoying problem with natbib. When the super parameter is used, the citation happily goes superscript but the page or chapter number doesn't.

\documentclass{article}
\usepackage[numbers, square, super]{natbib}
\begin{document}
    Some information.\cite[p.~56]{who09}

    \begin{thebibliography}{0}
        \bibitem{who09} Who J F. Nice Book. 2009.
    \end{thebibliography}
\end{document}

The above example shows the page number into normal text instead of superscript. Removing super the page goes into brackets.

Best Answer

Although this citation style is not common (as Joseph Wright suggested in his comment), you can obtain the desired result with a redefinition of the natbib's internal macro \NAT@citesuper. Here's a working example of such a redefinition:

\documentclass{article}
\usepackage[numbers, square, super]{natbib}

\makeatletter
\renewcommand\NAT@citesuper[3]{\ifNAT@swa
\if*#2*\else#2\NAT@spacechar\fi
\unskip\kern\p@\textsuperscript{\NAT@@open#1\if*#3*\else,\NAT@spacechar#3\fi\NAT@@close}%
   \else #1\fi\endgroup}
\makeatother

\begin{document}

Some text\cite[p.~56]{who09} some text\cite{who09}

\begin{thebibliography}{0}
\bibitem{who09} Who J F. Nice Book. 2009.
\end{thebibliography}

\end{document}

enter image description here

Related Question