Hello,
I am trying to format my table of contents in the following way :-
1 Intro
2 Second Chapter
3 Third Chapter
.
.
.
Appendix A ...
Appendix B ....
.
.
.
I tried all the options suggested in the tocloft package discussions.
I couldn't change the \cftchapnumwidth value just before the appendix.
I have a question, can the \cftchapnumwidth be changed dynamically.
Thanks in anticipation ...
Page Layout ⇒ Formatting Table of contents
NEW: TikZ book now 40% off at Amazon.com for a short time.
Formatting Table of contents
Hi,
try using the titletoc package instead: you can change the format for entries in the ToC in any part of your document. Refer to the package documentation for further information.
try using the titletoc package instead: you can change the format for entries in the ToC in any part of your document. Refer to the package documentation for further information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Formatting Table of contents
Thanks for the suggestion.
I got the formatted entries but those are with the command \titlecontents.
I couldn't add the word Appendix to the labels, so completely dropped the label and created the entry. Something like this
1............
...........
2............
...........
Appendix A ......
....
Appendix B......
.....
When I tried to use the \dottedcontents,the output looks like this..
1............
...........
2............
...........
A ......
....
B......
.....
And I could not add the wodk Appendix in front of A,B etc.
I got an error with \contentslabel command, but it was defined outside \titlecontents etc. Now, I don't understand whether we can define \contentslabel outside of any other main commands or it has to inside one of those \title commands.
Next problem I face is how to add the word Appendix. I think I didn't quite understand the documentation do I am trying to reread and experiment, but I appreciate any help.
Thanks ...
Himanshu
I got the formatted entries but those are with the command \titlecontents.
I couldn't add the word Appendix to the labels, so completely dropped the label and created the entry. Something like this
1............
...........
2............
...........
Appendix A ......
....
Appendix B......
.....
When I tried to use the \dottedcontents,the output looks like this..
1............
...........
2............
...........
A ......
....
B......
.....
And I could not add the wodk Appendix in front of A,B etc.
I got an error with \contentslabel command, but it was defined outside \titlecontents etc. Now, I don't understand whether we can define \contentslabel outside of any other main commands or it has to inside one of those \title commands.
Next problem I face is how to add the word Appendix. I think I didn't quite understand the documentation do I am trying to reread and experiment, but I appreciate any help.
Thanks ...
Himanshu
Formatting Table of contents
Hi,
the following code formats the ToC entries for appendices as you desire:
the following code formats the ToC entries for appendices as you desire:
Code: Select all
\documentclass{book}
\usepackage{titletoc}
\begin{document}
\tableofcontents
\chapter{Test chapter one}
\chapter{Test chapter two}
\titlecontents{chapter}[0em]
{\addvspace{10pt}}
{\bfseries \contentslabel{-.5em}\contentspush{Appendix}\hspace*{2em}}
{\bfseries}{\titlerule*[100pc]{.}\bfseries\contentspage}
\appendix
\chapter{Test appendix one}
\chapter{Test appendix two}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Formatting Table of contents
Hi ,
Thank you so much.
I tried it and it works just fine.
regards,
Himanshu
Thank you so much.
I tried it and it works just fine.
regards,
Himanshu
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Re: Formatting Table of contents
I think the tocloft package also provides this sort of functionality (in case you run into a scenario down the road where titletoc is incompatible with something or other).