[Tex/LaTex] Adding Name and year Bracket to reference list

bibliographiesnatbib

I'm new to LaTeX, and using natbib to handle my citations:

\usepackage[authoryear,square]{natbib}
\bibliographystyle{authordate1}
\bibliography{sample}

Now my citations inside the article looks fine [author, year], but when the reference list is shown at the end I want the same [author, year] cell to be next to each reference.
How can I do that ?

Here is MWEB example:

\documentclass[a4paper,12pt]{article}
\usepackage[authoryear,square]{natbib}

\usepackage{filecontents}    
\begin{filecontents}{sample.bib}
@article{lorenz1963,
  title={Deterministic nonperiodic flow},
  author={Lorenz, Edward N},
  journal={Journal of the atmospheric sciences},
  volume={20},
  number={2},
  pages={130--141},
  year={1963}
}

\end{filecontents}

\begin{document}  
\citep{lorenz1963}
\bibliographystyle{authordate1}
\bibliography{sample}
\end{document}

Thank you !

Best Answer

One can take advantage that the format of the .bbl file will be

\bibitem[\protect\citename{Lorenz, }1963]{lorenz1963}

so we can use the part in brackets to become the beginning of the citation text.

\begin{filecontents*}{\jobname.bib}
@article{lorenz1963,
  title={Deterministic nonperiodic flow},
  author={Lorenz, Edward N},
  journal={Journal of the atmospheric sciences},
  volume={20},
  number={2},
  pages={130--141},
  year={1963}
}
\end{filecontents*}

\documentclass[a4paper,12pt]{article}
\usepackage[authoryear,square]{natbib}

\AtBeginDocument{
  \let\natbibbibitem\bibitem
  \let\bibitem\valientbibitem
}
\makeatletter
\def\valientbibitem[#1]#2{%
  \natbibbibitem[#1]{#2}%
  \begingroup\let\citename\@firstofone
  [#1]
  \endgroup
}
\makeatother
\begin{document}  

\citep{lorenz1963}

\bibliographystyle{authordate1}
\bibliography{\jobname}

\end{document}

enter image description here

I agree with the comments saying this is just cluttering the bibliography.


During testing, I discovered that there is a bug in authordate1.bst that causes a spurious space that's added when “et al.” appears in a citation callout.

This can only be cured by fixing the source. Make a copy of authordate1.bst calling it authordate1-fix.bst in the working directory. In it change all occurrences of

{\em et~al.\ }\relax

into

{\em et~al\@.}\relax

In your document do \bibliographystyle{authordate1-fix}.

Related Question