I'm new to the TeX StackExchange. I've been working with the sorted list function I found here (Alphabetically display the items in itemize), and I came across an issue that I spent hours looking for online but I couldn't find. I also couldn't quite comment on this person's post (not enough reputation points), and I realized that this issue is completely possible out of this context.
The items in my sortedlist are quite long:
\documentclass{article}
\usepackage{datatool}
\newcommand{\sortitem}[1]{%
\DTLnewrow{list}% Create a new entry
\DTLnewdbentry{list}{description}{#1}% Add entry as description
}
\newenvironment{sortedlist}{%
\DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}% Create
}{%
\DTLsort{description}{list}% Sort list
\begin{itemize}%
\DTLforeach*{list}{\theDesc=description}{%
\item \text{\theDesc}}% Print each item
\end{itemize}%
}
\begin{document}
\section{section1}
\subsection{Further Reading}
All lists of readings and references are in alphabetical order.
\begin{sortedlist}
\sortitem{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt \\ ut labore et dolore magna aliqua. Ut enim ad minim veniam Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam}
\sortitem{quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat \\ quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat}
\sortitem{Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu \\ fugiat nulla pariatur Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur}
\end{sortedlist}
\end{document}
I purposefully cut the line at an earlier spot, to test if the line would cut in the first place. The text just continues off the page, even with the line breaks. It looks like this:
Is there any code that I could put in the sortedlist or sorteditem definition to ensure that this doesn't happen? Or am I doing the line breaks incorrectly?
Thanks in advance!

sortedlistprints like this, with all items being sorted together with the appropriate line-breaks. You must be doing something odd. Please provide a minimal example that replicates your problematic behaviour. It should start with\documentclassand end with\end{document}and allow the community to copy-and-paste-and-compile the code and see exactly what the issue is in the output. – Werner Jan 06 '18 at 01:34