[Tex/LaTex] How to indent second line of an item in list environment

indentationlists

I have a bullet point list that I think would look a lot better if I could indent the second line of some of the points. This really shouldn't be hard, but I can't seem to manage. I've tried \hspace and a few other things. Any suggestions?

\documentclass{article}
\begin{document}
    \begin{list}{\labelitemi}{\leftmargin=1em}
        \item \texttt{type} --- ablah bblah cblah \\ 
        this line should start right under ``ablah'' above
            \end{list}
\end{document}

Best Answer

First, you want to indent the second line by the length of the item label, \labelwidth. Second, you want to further indent it by the length of the words \texttt{type}---. The command \phantom does this. Thus we get the following code:

\documentclass{article}
\pagestyle{empty}
\begin{document}
    \begin{list}{\labelitemi}{\leftmargin=1em}
        \item \texttt{type}---ablah bblah cblah \\ 
        \hspace{\labelwidth}\phantom{\texttt{type}---}this line should
        start right under ``ablah'' above 
            \end{list}
\end{document}

enter image description here

Related Question