How to add a letter before the number of citation in the text?

2,172

Redefine \@bibitem and \@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}

enter image description here

Share:
2,172

Related videos on Youtube

jsxs
Author by

jsxs

Updated on August 01, 2022

Comments

  • jsxs
    jsxs over 1 year

    I want \cite to give me [A1] in the text. 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.

    \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}
    
    • José Carlos Santos
      José Carlos Santos over 6 years
      For that specific reference? Or do you want all references to start with a A?
    • jsxs
      jsxs over 6 years
      Hi, @ José Carlos Santos, all reference.
  • Axel Krypton
    Axel Krypton about 5 years
    Just in case you loaded hyperref and you wonder why the links do not work as expected, you can have a look here.