[texhax] plain TeX macros for TOC

Rodolfo Medina rodolfo.medina at gmail.com
Fri Feb 5 14:45:37 CET 2010


Wolfgang Schuster <schuster.wolfgang at googlemail.com> writes:

> you can use nested boxes like this (untested)
>
> \def\tocentry#1#2#3% #1: section number, #2: text, #3: pagenumber
>   {\endgraf
>    \noindent\hbox to \hsize
>      {\hbox to 2em{#1\hss}%
>       \vtop
>         {\hsize\dimexpr\hsize-2em\relax
>          #2\nobreak\hskip.5em\leaders\hbox to
> .5em{\hss.\hss}\hfill\hskip.5em\relax
>          \hbox{#3}}}
>    \endgraf}


Am 05.02.10 01:20, schrieb Rodolfo Medina:

>> Wolfgang, I didn't manage to make your code work!  It produces `overfull
>> box' errors.


Wolfgang Schuster <schuster.wolfgang at googlemail.com> writes:

> I tried my example now myself and it works for me, a overfull hbox message
> appears when the header text is too long for the line and TeX is unable to
> hyphenate it, to prevent this the others suggested ragged right text.


What did you put in place of `\dimexpr' when you tested it?

Thanks
Rodolfo



More information about the texhax mailing list