General ⇒ Table of contents alignment problem
-
- Posts: 16
- Joined: Sat Dec 06, 2008 7:55 pm
Table of contents alignment problem
I'm using
\section*{textofsectionheading}
\addtocontents{toc}{textofsectionheading}
When I generate the table of contents, the first entry appears farther to the left than do the other entries. I moved different sections around and it always happens with the first section declaration. Any ideas as to how to fix this so that all entries are aligned to the left margin? Any ideas as to what is causing this?
\section*{textofsectionheading}
\addtocontents{toc}{textofsectionheading}
When I generate the table of contents, the first entry appears farther to the left than do the other entries. I moved different sections around and it always happens with the first section declaration. Any ideas as to how to fix this so that all entries are aligned to the left margin? Any ideas as to what is causing this?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents alignment problem
LaTeX.org admin
-
- Posts: 16
- Joined: Sat Dec 06, 2008 7:55 pm
Re: Table of contents alignment problem
Thank you. It worked for me. Now why? Whether or not I understand, I am appreciative.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents alignment problem
Those are just different commands with different purpose, have a look at:
Stefan
Stefan
LaTeX.org admin
-
- Posts: 16
- Joined: Sat Dec 06, 2008 7:55 pm
Re: Table of contents alignment problem
What do I do when I want no dots and numbers using \addcontentsline ?
I can do this with other entries using \section*{textofsection}
I can do this with other entries using \section*{textofsection}
Re: Table of contents alignment problem
see the tocloft package or switch to the memoir class
both have ToC configuration support
both have ToC configuration support
-
- Posts: 16
- Joined: Sat Dec 06, 2008 7:55 pm
Re: Table of contents alignment problem
I've checked the documentation and I've coded:
\usepackage{tocloft]
...
\section*{sectiontext}
\renewcommand{\@dotsep}{10000}
\addcontentsline{toc}{section}{sectiontext}
and I've tried:
\section*{sectiontext}
\renewcommand{cftXdotsep}{\cftnodots}
\addcontentsline{toc}{section}{sectiontext}
and I've tried inserting {\cftnodots} in the \addcontentsline expression
but I am not getting anywhere.
Sorry to be a persistent questioner.
\usepackage{tocloft]
...
\section*{sectiontext}
\renewcommand{\@dotsep}{10000}
\addcontentsline{toc}{section}{sectiontext}
and I've tried:
\section*{sectiontext}
\renewcommand{cftXdotsep}{\cftnodots}
\addcontentsline{toc}{section}{sectiontext}
and I've tried inserting {\cftnodots} in the \addcontentsline expression
but I am not getting anywhere.
Sorry to be a persistent questioner.
Re: Table of contents alignment problem
the configuration applies to the \tableofcontents, thus it has to go before \tableofcontents, otherwise you will have to write it to the .toc file.
-
- Posts: 16
- Joined: Sat Dec 06, 2008 7:55 pm
Re: Table of contents alignment problem
The thing is I want my sections to appear in the toc with no dots and no page numbers. However I do want my subsections to appear with dots and page numbers. So I don't want nodots for the entire toc.
Re: Table of contents alignment problem
read the manual for tocloft again and understand the meaning of X, and by reading the manual you will learn to remove the dots for sections only.