[texhax] One (more) question about \halign

Rodolfo Medina rodolfo.medina at gmail.com
Wed Jan 27 23:17:09 CET 2010


Rodolfo Medina <rodolfo.medina at gmail.com> writes:

> In plain TeX, I have the following problem:
>
> I have the following alignment (for a table of contents):
>
>
> \halign to \hsize{%
>         \rm\rlap{1.2}\ \ \ \ \ \ \ 
>         \vbox{\parindent=0pt\hsize=105mm\hangindent 0em\strut%
>               #\hfill\strut}%
>       \tabskip=0cm plus20cm minus20cm&\hfil#\tabskip=0pt\cr
>       bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
>       bla bla bla bla bla bla bla bla bla bla bla bla bla &bnbnbnbnb\cr}
>
>
> Now, I want that, when the first argument is very long and continues over a
> second line (as in the above example), then
>
>        \rm\rlap{1.2}\ \ \ \ \ \ \
>
> is put on the first line (in the above example it is put on the second line,
> instead).
>
> Can anybody help about this matter?  Once solved this, I want to put dot
> leaders.


This seems to work:

\def\leaderfill{\leaders\hbox to 1em{\hss.\hss}\hfill}
\halign to \hsize{%
        \hskip12mm
        \vbox{\parindent=0pt\hsize=105mm\hangindent 0em\strut%
              \llap{\hbox to8mm{1.2\hss}}#\leaderfill\strut}%
      \tabskip=0cm plus20cm minus20cm&\hfil#\tabskip=0pt\cr
      bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
      bla bla bla bla bla bla bla bla bla bla bla bla bla &bnbnbnbnb\cr}

Only, as shown by the example, dot leaders end before text end: I don't
understand why.  Does anybody?

Rodolfo



More information about the texhax mailing list