如何在文中引用编号前添加字母?

如何在文中引用编号前添加字母?

我想\cite在文本中给出 [A1]。我在这里引用了参考文献\cite{ref1},给出的参考文献是 [1]。如何修改它以给我 [A1] 并在数字前加上 A。

\documentclass[a4paper,12pt]{article}
\usepackage{cite}

\begin{document}

I cited the reference here \cite{ref1}, which gives the reference as [1].
How to modify it to give me [A1] with A prefixing the number.

\begin{thebibliography}{99}
\bibitem{ref1} name. 2017 Title of the reference.
\end{thebibliography}

\end{document}

答案1

重新定义\@bibitem\@biblabel

\documentclass[a4paper,12pt]{article}
\usepackage{cite}

\makeatletter
\renewcommand\@bibitem[1]{\item\if@filesw \immediate\write\@auxout
    {\string\bibcite{#1}{A\the\value{\@listctr}}}\fi\ignorespaces}% <------------
\def\@biblabel#1{[A#1]}% <-------------------
\makeatother

\begin{document}

    I cited the reference here \cite{ref1}, \cite{sec}.

    \begin{thebibliography}{99}
        \bibitem{ref1} name. 2017 Title of the reference.
        \bibitem{sec} name. 2017 Title of the reference.
    \end{thebibliography}

\end{document}

在此处输入图片描述

相关内容