2

I'm working on a paper where the default citation style is a super script.

But in some parts of my text i like to put something like this:

....then more info see Ref[23].....

so in my doc with the paper bib style i get

enter image description here

what i want is get this

enter image description here

of course i can do it by hand but I'm wondering if there is an equivalent of \theequation coomand, thus I can type something like:

some text\cite{ref23} ..... see also [\thecite]
  • Can you please add a minimal working example so that people can see what packages etc you need to get your code to work (but don't add code that is not needed). In this case it would be helpful to see how you can achieve what you want "by hand". – Andrew Sep 2 '14 at 3:34
  • 1
    This really depends on the citation package you might be using. You could try to mimic what \cite does using \makeatletter \newcommand{\getcitenumber}[1]{\@ifundefined{b@#1}{\hbox{\reset@font\bfseries ?}}{\csname b@#1\endcsname}} \makeatother and then using \getcitenumber{<cite>} wherever you need the number printed, but I'm not sure if it will work. – Werner Sep 2 '14 at 5:06
3

The traditional \cite{<cite>} command tests for the existence of a macro \b@<cite> - yes, a citation is just a macro definition. The test is necessary because, like the \label-\ref system, it uses the .aux file for handling them and could be non-existent depending on your compilation. However, if the macro \b@<cite> exists, it sets it using a \csname...\endcsname construction. We can mimic this with

\makeatletter
\newcommand{\getcitenumber}[1]{% \getcitenumber{<cite>}
  \@ifundefined{b@#1}% Check if <cite> exists
    {\hbox{\reset@font\bfseries ?}}% <cite> doesn't exist; print ?
    {\csname b@#1\endcsname}}% <cite> exists; print `\b@<cite>
\makeatother

and use \getcitenumber{<cite>} wherever you wish to print the citation.

The above suggestion may be heavily dependent on the citation package you're using.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.