LaTeX adjusts space in toc elements

I am struggling with custom toc points added via:

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

Actually my problem is that I need to add some elements that contain chronological dates, such as:

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

It doesn’t look so good. What I would like to do is adjust the description of the event to some line position in order to look like this:

 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 it seems that it cannot be used in the \ addcontentsline {toc} {section} {...} command.

Does anyone have any other suggestions?

+4
source share
1 answer

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 the noise!

Hovhannes

+2
source

All Articles