使用 BibTeX 键作为引用键

使用 BibTeX 键作为引用键

我尝试使用natbib和其他尝试,但都徒劳无功。我想生成一个与 BibTeX 条目相同的引用键。例如,如果我有一个 BibTeX 条目Bt98,那么我想\cite{Bt98}生成类似的东西[Bt98]

有什么想法我该如何实现这个目标吗?

答案1

这是一个biblatex具有正确格式的参考书目的解决方案。

\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}

在此处输入图片描述

(filecontents 环境仅用于将一些外部文件直接包含到示例中,以便进行编译。对于解决方案来说,它不是必需的。)

答案2

biblatex例如,该style=draft选项将执行此操作。

答案3

如果没有natbib,我不知道参考书目是否应该相同?

\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}

答案4

bibtexabstract风格就是如此。

相关内容