[Tex/LaTex] Justify beamer bibliography (bibtex)

beamerbibliographieshorizontal alignment

I am using bibtex for referencing in beamer. My bibliography is left aligned, which I want to make in the justifying style. My attempts using ragged2e package and/or explicitly specifying \justify in the respective frames are not working. My code is attached here, please help.

\documentclass{beamer}
\usepackage{ragged2e}
\justifying 

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Argyropoulos2015,
author = {Argyropoulos, C. D. and Markatos, N. C.},
journal = {Applied Mathematical Modelling},
number = {2},
pages = {693--732},
publisher = {Elsevier Inc.},
title = {{Recent advances on the numerical modelling of turbulent flows}},
volume = {39},
year = {2015}}
\end{filecontents*}

\begin{document}
\justifying

\begin{frame}
This slide is a reference for bibliography.
\cite{Argyropoulos2015}
\end{frame}

\begin{frame}{Reference}
\justifying
\bibliography{\jobname}
\end{frame}
\bibliographystyle{ieeetr}

\end{document}

Best Answer

You can use the etoolbox package to patch the thebibliography environment. Add the following to your preamble:

\usepackage{etoolbox}
\apptocmd{\thebibliography}{\justifying}{}{} 

Since you're using a numbered citation style, it's also necessary to remove the icons for the bibliography items so that the numbers display correctly in the references:

\setbeamertemplate{bibliography item}[text]

Here's the complete example:

\documentclass{beamer}
\usepackage{etoolbox}
\usepackage{ragged2e}
\bibliographystyle{ieeetr}
\setbeamertemplate{bibliography item}[text]
\apptocmd{\thebibliography}{\justifying}{}{} 

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Argyropoulos2015,
author = {Argyropoulos, C. D. and Markatos, N. C.},
journal = {Applied Mathematical Modelling},
number = {2},
pages = {693--732},
publisher = {Elsevier Inc.},
title = {{Recent advances on the numerical modelling of turbulent flows}},
volume = {39},
year = {2015}}
\end{filecontents*}

\begin{document}
\justifying

\begin{frame}
This slide is a reference for bibliography.
\cite{Argyropoulos2015}
\end{frame}

\begin{frame}[allowframebreaks]{References}
\bibliography{\jobname}
\end{frame}
\end{document}

output of bib