My problem is that there exists an overlap between the symbol to introduce and the section title; it is manifest with two \heartsuit
s
\documentclass{article}
\usepackage{tocloft}
\usepackage{lipsum}
%\contentslabel{3em}
\renewcommand\tableofcontents{%
\section*{\contentsname\@mkboth{}{}}%
\thispagestyle{empty}%
%\small%
\@starttoc{toc}%
\thispagestyle{empty}%
\clearpage%
}
\makeatother
\makeatletter
\renewcommand{\@dotsep}{2}
%%\renewcommand{\cftdot}{\ensuremath{\ast}}
\renewcommand{\cftpnumalign}{r}
%\renewcommand{\cftsecpresnum}{SOMETHING }
\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftsecleader}{\bfseries\cftdotfill{\cftsecdotsep}}
\renewcommand{\cftsecpagefont}{\bfseries}
%\renewcommand{\cftsecpresnum}{SOMETHING }
\renewcommand{\cftsecaftersnum}{$\heartsuit$}
\renewcommand{\cftsecaftersnumb}{$\heartsuit$}
%\renewcommand{\cftsecaftersnumb}{\\}
% \newlength{\mylen} % a "scratch" length
% \settowidth{\mylen}{\bfseries\cftsecpresnum\cftsecaftersnum} % extra space
% \addtolength{\cftsecnumwidth}{\mylen} % add the extra space
%\makeatother
\begin{document}
\tableofcontents
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\section{1}\lipsum[4-11]
\end{document}
The modifying commands come straight from the manual of tocloft
.
My goal is to have {the section number}\heartsuit{the section title}
with no space in-between the characters.
I think the solution is to make the section numbers ragged on the right, just like all the page numbers are.
The package does not seem to offer a manner to control the box controlling the section number. Is this possible with titletoc
? (its readme is very succinct and I do not understand half of what is written)
EDITion:
@Werner: I have a snag with the code. I want to use the same pattern for the subsections and subsubsections as the one of the sections. So I use
\renewcommand{\cftsecaftersnum}{$\bullet$}
%\renewcommand{\cftsecnumwidth}{2em}
\renewcommand{\cftsubsecaftersnum}{$\bullet$}
%\renewcommand{\cftsubsecnumwidth}{0em}
\renewcommand{\cftsubsubsecaftersnum}{$\bullet$}
\renewcommand{\numberline}[1]{\makebox[\@tempdima][r]{\@cftbsnum #1\@cftasnum}\@cftasnumb}
but the beginnings of the subsections and subsubsections is not adequate: (I use roman numbers for my sections and sub(sub)sections) Ideally, the number subsection (and subsubsection) must be aglin with the first letter of the sections it belongs to
so
II$\bullet$Title
II.1$\bullet$subtitle
II.1.1$\bullet$subtitle
But it is not the case with the above code.