# \citenum with square brackets

I am using the superscript citation style and sometimes in the text I need to print the citation number is square brackets like [6]. I read I could use \citenum but [\citenum{myref}] leaves some big space before the number [ 6]. Is there anyway I can achive this nicely?

EDIT. These are my natbib options:

 \usepackage[square, comma, sort&compress,authoryear]{natbib}
\bibpunct{[}{]}{,}{s}{}{;}

-
 Please consider to upvote helpful answers to your older questions (this has to be done separately from accepting them). – lockstep Jul 31 '11 at 12:07 Thanks for the solution. I will do as per the other post. – Godey Jul 31 '11 at 12:27

The following attempt (a redefinition of \citenum) removes most (?) of the spacing. Sorry for not providing a real solution, but the natbib internals are nothing one wants to delve into.

\documentclass{article}

\usepackage[square,comma,sort&compress,authoryear]{natbib}
\bibpunct{[}{]}{,}{s}{}{;}

\makeatletter
\DeclareRobustCommand\citenum
{\begingroup
%      \NAT@swatrue\let\NAT@ctype\z@\NAT@parfalse\let\textsuperscript\NAT@spacechar% DELETED
\NAT@swatrue\let\NAT@ctype\z@\NAT@parfalse\let\textsuperscript\relax% NEW
\NAT@citexnum[][]}
\makeatother

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
\end{filecontents}

\begin{document}

Some text \citep{A01}.

[\citenum{A01}]

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

-

I found that inserting a couple of negative spaces (\!) works fine. e.g.

These are outlined in an excellent review by Foo [\!\!\citenum{Foo2012}]; however, we choose to...


Perhaps this is not a very elegant solution in terms of understanding the problem, but it is concise!

-