Use BibTeX key as the cite key

Here's a biblatex solution with a properly formatted bibliography.

\documentclass{article}

\usepackage[style=alphabetic,sorting=debug]{biblatex}

\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}
\DeclareFieldFormat{extraalpha}{}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{whatever,
  author = {Author, A.},
  year = {2001},
  title = {Testing the effects of biblatex styles on bibliography formatting},
}
@misc{B02f,
  author = {Buthor, B.},
  year = {2002},
  title = {First},
}
@misc{B02s,
  author = {Buthor, B.},
  year = {2002},
  title = {Second},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

(The filecontents environment is only used to include some external files directly into the example, so that it compiles. It is not necessary for the solution.)


biblatex with, for example, the style=draft option will do this.


without natbib, don't know if it sjould be the same in the bibliography??

\documentclass{article}


\makeatletter
\def\@citex[#1]#2{\leavevmode
  \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \@cite{#2}{#1}}
\makeatother


\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{whatever,
  author = {Author, A.},
  year = {2001},
  title = {Testing the effects of biblatex styles on bibliography formatting},
}

@misc{B02f,
  author = {Buthor, B.},
  year = {2002},
  title = {First},
}

@misc{B02s,
  author = {Buthor, B.},
  year = {2002},
  title = {Second},
}
\end{filecontents}


\begin{document}

foo\cite{whatever} and bar\cite{B02s}

\bibliographystyle{alpha}
\bibliography{\jobname}


\end{document}