Generalcustomizing TOC

LaTeX specific issues not fitting into one of the other forums of this category.
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

customizing TOC

Post by chao »

Hi,
I know this has been asked before and given reference to tocloft package.
However, as I'm new to latex, I appreciate that if someone can give me an example script
TOC needs to be
Table of Contents (mid of page)
Chapter(left of page) Page(right)
DEDICATION...............................ii
ACKNOW.....................................iii
.
.
.
CHAPTERS
(indent)CHAPTER 1-- Introduction...1
(more indent)1.1 N#1...................2
.
.
.
APPENDICIES
(indent) Appendix A--Numerical......100
...

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

customizing TOC

Post by localghost »

Try your luck with tocloft. In case of occurring questions, feel free to ask.


Best regards
Thorsten¹
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

Re: customizing TOC

Post by chao »

I've went through "tocloft" and solved a few typesettings.
However, there are still some are remaining
1. How to insert "CHAPTERS" as a separate line before Chapter1, 2.... starts
2. How to change the font of all the contents listed NOT in bold face.
Only "Table of Contents" and "Chapter ....... Page" remain in bold.
3. How to insert "..........." between to all the contents and pages?

Thanks very much for any hint!

ps: TOC format attached
Attachments
toc-format.png
toc-format.png (21.27 KiB) Viewed 19081 times
Last edited by chao on Fri Jun 20, 2008 12:40 am, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Re: customizing TOC

Post by Stefan Kottwitz »

Hi chao,

perhaps post a minimal example that shows how you typeset the table of contents using tocloft until know, then we probably could suggest changes.

Stefan
LaTeX.org admin
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

Re: customizing TOC

Post by chao »

sty file

\usepackage[subfigure]{tocloft}
...
\renewcommand{\contentsname}{Table of contents} % change "Contents" to "Table of Contents"
\renewcommand{\cfttoctitlefont}{\hfill\large\bfseries\MakeUppercase} % change toc title to upper case
\renewcommand{\cftaftertoctitle}{\hfill}

\renewcommand{\cftchapfont}{\MakeUppercase} % change chapter headings to uppercase

\renewcommand{\cftchappresnum}{CHAPTER } % try to put "Chapter" in front of e.g."1. Introduction"


main.tex file
...
\titlepage
\addtocontents{toc}{\bfseries \underline{Chapter} \hfill \underline{Page}\par} % add underlined "Chapter" and "page" before actually contents show up.
...

Now I'm stuck with the previously mentioned questions
Attached is a toc I finished
Hope this could help to understand my problem
Attachments
toc-format-done.png
toc-format-done.png (32.88 KiB) Viewed 16995 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

customizing TOC

Post by localghost »

You have to set the space which is reserved for the chapter number to a suitable value.

Code: Select all

\renewcommand{\cftchappresnum}{\chaptername\space}
\settowidth{\cftchapnumwidth}{\widthof{\cftchappresnum}}
For further information see section 2.3 of the tocloft documentation.


Best regards
Thorsten¹
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

Re: customizing TOC

Post by chao »

The adding chapter in front of number problem is solved.

However,
"In the default ToC typsetting only the more minor entries have dotted leader \cftdot lines between the sectioning title and the page number. The tocloft package pro- vides for general leaders for all entries"

How to add dotted leader to all entries?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

customizing TOC

Post by localghost »

chao wrote:[...] How to add dotted leader to all entries?
Add a command to your preamble to get the desired result.

Code: Select all

\renewcommand{\cftchapdotsep}{\cftdotsep}
You should take a deeper look at the documentation, because this issue is described there in detail.
dowens
Posts: 3
Joined: Thu Sep 17, 2009 12:24 am

customizing TOC

Post by dowens »

I am having difficulty with tocloft trying to do some of the same things listed above. The documentation has so few examples that it is hard to work out how to use the commands.

My last remaining task for my dissertation is indenting chapter entries in the TOC. I am using memoir. This is what I have tried so far:

Code: Select all

\renewcommand{\cftchapterpresnum}{\hspace{.5in}\normalfont} % Does not indent the whole entry
\setlength{\cftXindent}{.5in} % Produces errors
\newcommand{\cftchappresnum}{\hspace{.5in}} % Ineffective
\renewcommand*\l@chapter{\@dottedtocline{0}{.5in}{0em}} % Produces errors
Any suggestions are welcome.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

customizing TOC

Post by gmedina »

Hi,

try

Code: Select all

\setlength{\cftchapterindent}{.5in}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply