Customizing TOC to my needs (right-adjusting section numbers)

\usepackage[dotinlabels]{titletoc}
\titlecontents{section}[1pc]
{\thecontentslabel.\hspace{3mm}}
{}
{\normalsize\titlerule*[6pt]{.}\contentspage}


And the result looks like this:

Question: How can I modify this such that all the section titles will be properly "left-aligned", even the ones starting with section 10? I want the section number to appropriately "move to the left", as required to make this happen. How do I accomplish this?

-

You can use a \parbox and \hfill to push \thecontentslabel to the right; something like:

\parbox{1cm}{\hfill\thecontentslabel}


The width of the \parbox can be set using a length in which you specify the widest label. A complete example in which I set the widest label to the width of 99.99.:

\documentclass[fleqn,12pt,a4paper]{book}
\usepackage[dotinlabels]{titletoc}

\newlength\widest
\settowidth\widest{99.99.}

\titlecontents{section}[1pc]
{\parbox[t]{\widest}{\hfill\thecontentslabel.}
\hspace{3mm}}
{}
{\normalsize\titlerule*[6pt]{.}\contentspage}

\begin{document}

\tableofcontents

\chapter{Test}
\section{section-1}
\section{section-2}
\section{section-3}
\section{section-4}
\section{section-5}
\section{section-6}
\section{section-7}
\section{section-8}
\section{section-9}
\section{section-10}
\section{section-11}
\section{section-12}
\section{section-13}

\end{document}


-
This works, expect for one problem: For some reasons, this solution causes the section number (e.g. "1.1") to move down a bit, and it makes "1.1." a bit below "section", compared to the baseline. Why would this be happening? – meh May 11 '12 at 14:00
\parbox[t]{...}{...} – daleif May 11 '12 at 14:13
@daleif thanks, that worked. – meh May 11 '12 at 15:12
@daleif: I incorporated your suggestion to my answer, thanks. – Gonzalo Medina May 11 '12 at 16:42