Text FormattingTable of Contents Ellipsis and Page Numbers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
swiftfoottim
Posts: 3
Joined: Tue Dec 28, 2010 9:59 pm

Table of Contents Ellipsis and Page Numbers

Post by swiftfoottim »

I'm currently working on formatting my table of contents for my thesis and need a little help figuring out how to accomplish the dotted line between a section and the page number.

It currently appears with an entry like:

Code: Select all

5 Data Presentation  .............................  16
I need to flush the ellipses both on the left and on the right so it should appear as:

Code: Select all

5 Data Presentation.............................16
In other words, there shouldn't be any space between the dots and the entries. I also need to maintain the right justification of the page numbering as the \setpnumwidth{-.5mm} didn't work.

Any guidance would be awesome. Currently, my ToC rules are(Memoir Class):

Code: Select all

%%%%% Do the ToC
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\addtodef{\tableofcontents}{\clearpage\pagestyle{toc}}{}
\setlength{\topmargin}{.75in}
\renewcommand*{\tocheadstart}{\vspace*{-\topfiddle}}
\renewcommand*{\aftertoctitle}{\thispagestyle{plain}
\par\nobreak \mbox{}\hfill{%\normalfont Page
}\par\nobreak
}

\renewcommand*{\cftdotsep}{1}
\renewcommand*{\cftchapterfont}{\normalfont}
\renewcommand*{\cftchapterpagefont}{\normalfont}
\renewcommand*{\cftchapterleader}{
\cftchapterfont\cftdotfill{\cftchapterdotsep}}
\renewcommand*{\cftchapterdotsep}{\cftdotsep}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Table of Contents Ellipsis and Page Numbers

Post by kaiserkarl13 »

I think the default is to only include space up to the first dot anyway. If you think TeX could have squeezed one more dot in, you can fake it out by using \! or another negative spacing command.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Table of Contents Ellipsis and Page Numbers

Post by frabjous »

Please provide a proper minimal working example (read the link!) I'm a bit too tired today to try to make up the rest of a fake document for testing purposes. That should be your job if you want people to try to help you.
Post Reply