[Tex/LaTex] Indent second line of a bibliography

bibliographiesindentation

I am writing a bibliography :

\begin{thebibliography}{9}
\bibitem{Lorem}\textsc{Lorem ipsum dolor sit}
\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae purus mi. Fusce quam urna, elementum at ullamcorper in, tempus sed quam.}
\end{thebibliography}

The result :

enter image description here

And what I would like to obtain :

enter image description here

I want to indent the second and the third line of \texttt. Do I have to redefine \texttt or is there an other solution?

Thank you for your help.

EDIT:

By using the solution of egreg I obtain a strange result :

enter image description here

Best Answer

The LaTeX internals can be modified to allow this. We modify:

  • \@biblabel that prints the label, the new one includes a space of the length \bibindent

  • \bibitem that prints the whole title, to remove the extra space for the first line

  • You should add \kern\bibindent into the parameter of \begin{thebibliography} so that the indentation is ensured

  • The line \def\bibindent defines the amount of indentation, I set it to 1em.

The code:

\documentclass{article}
\begin{document}

\def\bibindent{1em}
\begin{thebibliography}{99\kern\bibindent}
\makeatletter
\let\old@biblabel\@biblabel
\def\@biblabel#1{\old@biblabel{#1}\kern\bibindent}
\let\old@bibitem\bibitem
\def\bibitem#1{\old@bibitem{#1}\leavevmode\kern-\bibindent}
\makeatother

\bibitem{Lorem}\textsc{Lorem ipsum dolor sit}
\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae purus mi. Fusce quam urna, elementum at ullamcorper in, tempus sed quam.}
\end{thebibliography}

\end{document}