2

How do I fix the indentation problem in the List of Thesis here: enter image description here

\documentclass{book}

\usepackage{lipsum} 
\usepackage{tocloft} 

\newcommand{\listthesisname}{List of Theses}
\newlistof{thesis}{the}{\listthesisname}
\newcommand{\thesis}[1]{%
\refstepcounter{thesis}
{(T\thethesis) #1}
\addcontentsline{the}{thesis}
{\protect\numberline{(T\thethesis)} #1} \par}
\setlength{\cftthesisnumwidth}{15mm}
\setlength{\cftthesisindent}{6mm}
\setlength{\cftbeforethesisskip}{5mm}

\newcommand{\tref}[1]{(T\ref{#1})}


\begin{document}      
\lipsum[1]

\thesis{Metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus
eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium
quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean}

\thesis{Lorem ipsum dolor sit amet, consectetuer adipisc
stibulum ut, placerat ac, adipiscing vitae, felis. Cu
auris. Nam arcu libero, nonummy eget, consectetuer }

\newpage
\listofthesis
\end{document}

1 Answers1

2

Unprotected end-of-lines.

\newcommand{\listthesisname}{List of Theses}
\newlistof{thesis}{the}{\listthesisname}
\newcommand{\thesis}[1]{% <-- here
  \refstepcounter{thesis}% <-- here
  (T\thethesis) #1% <-- here
  \addcontentsline{the}{thesis}{\protect\numberline{(T\thethesis)}% <-- here
  #1}\par
}

enter image description here

egreg
  • 1,121,712