1

I am trying to better understand the titletoc package behavior. I am wondering if there is a decent way to control the hspace infront of all the "wrapped" lines. In other words, of all lines except the one containing the label.

Is there a way to easily align it i.e. with the table label?

text wrap indentation

To test this i set up the following minimal example:

\documentclass[11pt,a4paper]{scrartcl}
\usepackage{titletoc}
\titlecontents{table}
[0pt]                    % left margin
{}                       % above code (e.g vertical space)
{Table~\thecontentslabel:\enspace}
{}                       % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage} % filler-page format (e.g dots)
[]                       % right margin

\begin{document}
\begin{table}
\caption{Magni corporis voluptatem totam vero dignissimos nisi. Laboriosam repellendus ullam sint. Iure asperiores quae saepe. Sint non commodi explicabo. Omnis reiciendis est culpa non aliquam velit earum. Eum repudiandae excepturi sapiente odio sunt.}
\begin{tabular}{ c }
\end{tabular}
\end{table}

\listoftables
\end{document}

You can find the manual to the package here: manual

2

A solution with the \contentspush command, if I've well understood what you want:

\documentclass[11pt,a4paper]{scrartcl}
\usepackage{calc}
\usepackage{titletoc}
\titlecontents{table}
[0pt] % left margin
{} % above code (e.g vertical space)
{\llap{Table~\thecontentslabel:\enspace}\contentspush{\widthof{Table~\thecontentslabel:\enspace}}}
{} % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage} % filler-page format (e.g dots)
[\smallskip] %

\begin{document}

\begin{table}[!htb]
\caption{Magni corporis voluptatem totam vero dignissimos nisi. Laboriosam repellendus ullam sint. Iure asperiores quae saepe. Sint non commodi explicabo. Omnis reiciendis est culpa non aliquam velit earum. Eum repudiandae excepturi sapiente odio sunt.}
\begin{tabular}{ c }
\end{tabular}
\end{table}

\setcounter{table}{120}
\begin{table}[!htb]
\caption{Magni corporis voluptatem totam vero dignissimos nisi. Laboriosam repellendus ullam sint. Iure asperiores quae saepe. Sint non commodi explicabo. Omnis reiciendis est culpa non aliquam velit earum. Eum repudiandae excepturi sapiente odio sunt.}
\begin{tabular}{ c }
\end{tabular}
\end{table}
\listoftables

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.