Hi!
I have to hand in a draft (very unfinished) thesis - \documnetclass{book}
I would like the table of contents to somehow indicate which chapters are unfinished - missing.
Essentially I need some sort of newcommand that behaves like \chapter, but the toc entry is e.g. gray. And that should be the chapter number, the title and the page number entry.
This way I could enter \notyetchapter placemarks where they will go and have the toc exhibit the correct structure indicating what is missing.
Is that possible?
Thanks!
maja.
Page Layout ⇒ indicate unfinished chapters in TOC in draft 'book'
NEW: TikZ book now 40% off at Amazon.com for a short time.
indicate unfinished chapters in TOC in draft 'book'
OK, left to my own devices I've managed to come up with :
which makes the chapter title in text and in the ToC gray!
I would still like the rest of the ToC entry to be gray? As in the chapter number and the page number (the dots even?). Can anyone help me with this?
Thanks!
maja.
PS: As a complete newbie I usually resort to heavy googling to find similar code I then try to tweek. But obviously with renewcommand type stuff, if you don't know what the original definitions are and what they refer to you don't know which ones to change? I have no idea where the [1] in the above definition came from or how am I supposed to find out what the argument is for the toc page number e.g.? How do you know what @startsection or l@chapter mean? (just two unknown quantities encountered in my travels). If anyone could point me to a tutorial of some sorts I would be really grateful!
Code: Select all
\let\notyetchapter\chapter
\renewcommand{\notyetchapter}[1]{\chapter{\color{gray}{#1}}}
I would still like the rest of the ToC entry to be gray? As in the chapter number and the page number (the dots even?). Can anyone help me with this?
Thanks!
maja.
PS: As a complete newbie I usually resort to heavy googling to find similar code I then try to tweek. But obviously with renewcommand type stuff, if you don't know what the original definitions are and what they refer to you don't know which ones to change? I have no idea where the [1] in the above definition came from or how am I supposed to find out what the argument is for the toc page number e.g.? How do you know what @startsection or l@chapter mean? (just two unknown quantities encountered in my travels). If anyone could point me to a tutorial of some sorts I would be really grateful!
indicate unfinished chapters in TOC in draft 'book'
Hi,
try this modification to your command:
try this modification to your command:
Code: Select all
\documentclass{book}
\usepackage{xcolor}
\let\notyetchapter\chapter
\renewcommand{\notyetchapter}[1]{%
\addtocontents{toc}{\color{gray}}
\color{gray}\chapter{#1}\normalcolor
\addtocontents{toc}{\color{black}}
}
\begin{document}
\tableofcontents
\chapter{Test chapter}
\notyetchapter{Unfinished test chapter}
\chapter{Another Test chapter}
\notyetchapter{Another unfinished test chapter}
\end{document}
I would suggest The LaTeX Companion (2nd Edition) and Guide to LaTeX (4th Edition).maja z wrote:...If anyone could point me to a tutorial of some sorts I would be really grateful!
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: indicate unfinished chapters in TOC in draft 'book'
Thanks gmedina, worked like a charm!
Just curious though, of the three lines:
1. \addtocontents{toc}{\color{gray}}
2. \color{gray}\chapter{#1}\normalcolor
3. \addtocontents{toc}{\color{black}
So you're essentially using 1. and 3. to change the color in the toc and then change it back, so everything in between is gray, yes?
what about 2.? is it the same as
\chapter{\color{gray}{#1}}
What's the difference? (why the normalcolor?)
Thanks for the tips as well (I have a 1st edition Latex companion and use it more as a look-up, but should probably read the whole thing at some point!)
Cheers!
Maja
Just curious though, of the three lines:
1. \addtocontents{toc}{\color{gray}}
2. \color{gray}\chapter{#1}\normalcolor
3. \addtocontents{toc}{\color{black}
So you're essentially using 1. and 3. to change the color in the toc and then change it back, so everything in between is gray, yes?
what about 2.? is it the same as
\chapter{\color{gray}{#1}}
What's the difference? (why the normalcolor?)
Thanks for the tips as well (I have a 1st edition Latex companion and use it more as a look-up, but should probably read the whole thing at some point!)
Cheers!
Maja
indicate unfinished chapters in TOC in draft 'book'
Hi, Maja
In fact, the following code will have the same effect than the one I used before:
You're welcome.maja z wrote:Thanks gmedina, worked like a charm!..
That's correct.maja z wrote:...So you're essentially using 1. and 3. to change the color in the toc and then change it back, so everything in between is gray, yes?..
It's not the same: \color{gray}\chapter{#1} changes the color for both the title itself and the heading (the string "Chapter n" that appears before the title) whilst \chapter{\gray{#1}} will only change the color for the title, but "Chapter n" will still appear black.maja z wrote:...what about 2.? is it the same as
\chapter{\color{gray}{#1}}
What's the difference?..
To restore the black color; if you suppress that command from my code, the contents of the chapter will also be typeset in gray color.maja z wrote:...(why the normalcolor?)
In fact, the following code will have the same effect than the one I used before:
Code: Select all
\let\notyetchapter\chapter
\renewcommand{\notyetchapter}[1]{%
\addtocontents{toc}{\color{gray}}
\color{gray}\chapter{#1}\normalcolor
\addtocontents{toc}{\protect\normalcolor}
}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: indicate unfinished chapters in TOC in draft 'book'
Thanks againfor taking the time for the explanation!!
m.
m.