views:

457

answers:

1

I am struggling with custom toc items added via:

\addcontentsline{toc}{section}{Some text here}

Actually my problem is that I need to add some items which contain chronological date periods like:

12/1/2005 - 3/3/2006 Some event.........................................1
10/10/2005 - 11/30/2005 Some other event................................2

This looks not so nice. What I would like to do is adjusting event description to some line position to look like:

12/1/2005 - 3/3/2006     Some event.....................................1
10/10/2005 - 11/30/2005  Some other event...............................2

I tried to use \makebox but as it seems it is not allowed to be used within \addcontentsline{toc}{section}{...} command.

Does anyone have other suggestions?

+1  A: 

Got it...

\makebox is a fragile command, so I need to protect it :)

\addcontentsline{toc}{section}{\protect\makebox[2cm][l]{date here} Description here}

Sorry for noise!

Ovanes

ovanes
I didnt check your code, but won't be better to use`{\protect\makebox[1cm][l]{date1}-\protect\makebox{date2} Descrioption}`or maybe better in preamble:`\newcommand{\mysection}[3]{\addcontentsline{toc}{section}{\protect\makebox[1cm][l]{#2} - \protect\makebox[2cm][l]{#3} #1}}`?
Crowley
Yes, that would be better, but I wanted to have it simple for the example here, because \makebox was not accepted by LaTeX compiler and I did know how to fix that.
ovanes