5

if I write the \cite{Key} command in the continuous text my citation is not superscript. If I write \textsuperscript{\cite{Key}} it does exactly look what I prefer.

My question is if there's a possible to renwecommand the \cite command, because I don't want to change it everywhere in my document by hand. My concept was something like that:

\renwecommand{\cite}{\textsuperscript{\cite{#}}}

But it doesn't work, probably because I don't know how to use renwecommand. I'm using scrreprt.

I hope anyone can help me. Michael

Troy
  • 13,741
Michael
  • 51
  • Welcome to TeX.SE. Should all, or just some, citation call-outs be placed in superscript positions? Do you use a citation management package such as cite or natbib? Please advise. – Mico May 14 '17 at 13:55
  • And if hours use bibtex and the natbib package this is even an option to natbib so you do not have to do anything. I think it's called super – daleif May 14 '17 at 14:15

2 Answers2

10

Your attempt has a couple of problems:

  • It should be \renewcommand or \renewcommand* instead of \renwecommand.

  • You need to specify the number of arguments with [1] if you have a single argument. Then you can refer to the argument with a number, i.e. #1 instead of #.

  • Since you overwrite \cite, you need to let LaTeX know that you want to refer to \cite as it was before your redefinition. You can do this by defining a new command \oldcite that stores the original definition of \cite.

The following code should work:

\let\oldcite\cite
\renewcommand*\cite[1]{\textsuperscript{\oldcite{#1}}}
cp.fe.cp
  • 473
3

Consider using natbib package with "super" option, e.g.,

 \usepackage[super,comma,sort&compress]{natbib}

The natbib package will take you a couple of minutes to learn, but will give a lot of flexibility in defining your citation styles.

\documentclass{article}
%\usepackage[square,comma,sort&compress,numbers]{natbib}% style [1,4-6]
\usepackage[super,comma,sort&compress,numbers]{natbib}  % style  ^{1,4-6}

\begin{document}

Citation \cite{<cite1>,..,<citeN>}.

Citation with citep \citep{<cite1>}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliographystyle{unsrtnat}
\bibliography{<your bibliography bib file>}

\end{document}

Note (optional): If you prefer to be explicit on using "numbers" and "not names" in your citation, use \citep{} instead of \cite{}.

amorua
  • 1,928
  • 1
    You might want to add on some note about not using \cite with natbib package and what the alternatives provided by natbib are, for a more complete answer (considering OP's question is about using \cite. – Troy May 14 '17 at 14:51
  • For a short and useful description of the natbib options see https://www.sharelatex.com/learn/Bibliography_management_with_natbib – amorua May 14 '17 at 18:00