[Tex/LaTex] Overfull hbox in description environment

descriptionline-breaking

I have a problem with description environment. The text exceeds the width of the page

\documentclass[a4paper,twoside,10pt]{report}
\usepackage[francais]{babel} 
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{lmodern} 
\usepackage{geometry}
\geometry{hmargin=2.5cm,vmargin=2.5cm}
\begin{document}
\pagestyle{empty} 
\chapter{Some small hints}\label{hints}
\section{German Umlauts and other Language Specific Characters}\label{umlauts}
You can type german umlauts like 'ä', 'ö', or 'ü' directly in this file.
\begin{description}
\item [small item:] Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item [Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse consequat   accumsan sodales. Duis pulvinar sagittis porta. Mauris malesuada vehicula turpis,] sed ornare ante. In pulvinar ligula a leo lacinia, vel laoreet tortor auctor. Nullam in tinc] Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{description}
\end{document}

this is the output :enter image description here

Is there a solution to ensure that the text goes to a new line automatically ? thanks

Best Answer

You can do that withsameline option from the enumitem package. Incidentally, I changed the input enncoding to utf8, as it is more portable to another platform:

\documentclass[a4paper,twoside,10pt]{report}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{geometry}
\geometry{margin=2.5cm, showframe, nomarginpar}
\usepackage{enumitem}
\AtBeginDocument{\def\chaptername{Le Chapter}}

enter image description here

\begin{document}
\pagestyle{empty}
\chapter{Some small hints}\label{hints}
\section{German Umlauts and other Language Specific Characters}\label{umlauts}
You can type german umlauts like 'ä', 'ö', or 'ü' directly in this file.

\begin{description}[style =sameline]
\item [small item:] Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\item [Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse consequat accumsan sodales. Duis pulvinar sagittis porta. Mauris malesuada vehicula turpis,] sed ornare ante. In pulvinar ligula a leo lacinia, vel laoreet tortor auctor. Nullam in tinc]
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{description}
\end{document} 
Related Question