# Left-align numbers in ToC

How do I lelft-align the chapter and section, number in the ToC? My code is:

\documentclass[12pt]{report}

\usepackage{tocloft}
\makeatletter
\renewcommand{\numberline}[1]{#1~}

\begin{document}
\tableofcontents

\chapter{A}
\section{One section}
\section{Other section}

\chapter{B}
\section{Hello}
\section{Next}

\end{document}


and I want

 1.1 One section
1.11 Ohter section


and the same for chapters.

The following solution is based on example code given on pp. 11-12 of the user guide of the tocloft manual; I've just replaced X with sec and chap, respectively. Feel free to adjust the initial values of \mylenchap and \mylensec to suit your needs.

\documentclass[12pt]{report}

\usepackage{tocloft}

\newlength\mylensec
\setlength{\mylensec}{0.75em}
\renewcommand{\cftsecpresnum}{\hfill}
\renewcommand{\cftsecaftersnum}{\hspace*{\mylensec}}

\newlength\mylenchap
\setlength{\mylenchap}{1em}
\renewcommand{\cftchappresnum}{\hfill}
\renewcommand{\cftchapaftersnum}{\hspace*{\mylenchap}}

\begin{document}
\tableofcontents

\chapter{A}
\section{One section}

• @CarlosE - Absolutely: Just delete (or comment out) the instructions from \newlength\mylensec to \addtolength{\cftsecnumwidth}{\mylensec}. – Mico Oct 27 '15 at 5:21