1

I want to keep a list somewhere like this:

\usepackage{tocloft}

\newcommand{\listtodotitle}{To do}
\newlistof[8]{todos}{tod}{\listtodotitle}


\newcommand{\todolist}[1]{%
\refstepcounter{todos}
\addcontentsline{tod}{todos}
{\protect\numberline{\thechapter\thetodos} #1}}

\newcommand{\todo}[1]{\todolist{#1}\textbf{actp: #1}}

\todo{lorem ipsum}\\ % For person x
\todo{dolor sit amet}\\ % For person y
\todo{consectetur adipiscing elit} % For person x

\listoftodos{} % The actual printed todo list

But sort it. E.g. have the items for person x printed before person y, regardless of where they're added and a header saying "Person X" and "Person Y" above each section.

I've seen similar lists kept with floats but I'm not sure how to use those but if you have a solution using that, shoot.

EDIT: I fixed it using Ulrike Fischer's solution. Thanks a lot!