index with dots

  • Follow


Hello!

I am making an index of songs. Ideally, I would like
to have the title on the left and the duration on the
right, connected with dots.

At the moment, I am using \dotfill:

\item Happiness Is Easy\dotfill 6:31
\item I Don't Believe In You\dotfill 5:02
\item Life's What You Make It\dotfill 4:29
\item April 5th\dotfill 5:52
\item Livinggggg In Another World\dotfill 6:58
\item Give It Up\dotfill 5:17
\item Chameleon Day\dotfill 3:20
\item Time It's Time\dotfill 8:14

But it's far from perfect, as you can see here:
http://img185.imageshack.us/img185/8205/indexp.png

When a line break occurs, the track length
is flushed to the left on the next line. Also, because of
the line width is very short, I have a lot of overflows.

Is there a ready-made solution for this kind of
things?

Cheers!
Ernest
0
Reply nfdisco (11) 7/30/2010 2:50:08 PM

In article 
<a67ac5a4-3972-416d-9a8e-33e020c23eb6@z10g2000yqb.googlegroups.com>,
 ernest <nfdisco@gmail.com> wrote:

> Hello!
> 
> I am making an index of songs. Ideally, I would like
> to have the title on the left and the duration on the
> right, connected with dots.
> 
> At the moment, I am using \dotfill:
> 
> \item Happiness Is Easy\dotfill 6:31
> \item I Don't Believe In You\dotfill 5:02
> \item Life's What You Make It\dotfill 4:29
> \item April 5th\dotfill 5:52
> \item Livinggggg In Another World\dotfill 6:58
> \item Give It Up\dotfill 5:17
> \item Chameleon Day\dotfill 3:20
> \item Time It's Time\dotfill 8:14
> 
> But it's far from perfect, as you can see here:
> http://img185.imageshack.us/img185/8205/indexp.png
> 
> When a line break occurs, the track length
> is flushed to the left on the next line. Also, because of
> the line width is very short, I have a lot of overflows.
> 
> Is there a ready-made solution for this kind of
> things?
> 
> Cheers!
> Ernest

There are two packages that deal with songbooks on CTAN: songs and 
songbook.  Maybe those would do the trick.

If not, you can roll your own tables of contents type things using any 
of the following:

tocloft
titlesec/titletoc
memoir (which provides all the facilities of tocloft plus more)

Alan
0
Reply Alan 7/30/2010 6:52:48 PM


On 30 Jul, 20:52, Alan Munn <am...@msu.edu> wrote:
> In article
> <a67ac5a4-3972-416d-9a8e-33e020c23...@z10g2000yqb.googlegroups.com>,
>
>
>
> =A0ernest <nfdi...@gmail.com> wrote:
> > Hello!
>
> > I am making an index of songs. Ideally, I would like
> > to have the title on the left and the duration on the
> > right, connected with dots.
>
> > At the moment, I am using \dotfill:
>
> > \item Happiness Is Easy\dotfill 6:31
> > \item I Don't Believe In You\dotfill 5:02
> > \item Life's What You Make It\dotfill 4:29
> > \item April 5th\dotfill 5:52
> > \item Livinggggg In Another World\dotfill 6:58
> > \item Give It Up\dotfill 5:17
> > \item Chameleon Day\dotfill 3:20
> > \item Time It's Time\dotfill 8:14
>
> > But it's far from perfect, as you can see here:
> >http://img185.imageshack.us/img185/8205/indexp.png
>
> > When a line break occurs, the track length
> > is flushed to the left on the next line. Also, because of
> > the line width is very short, I have a lot of overflows.
>
> > Is there a ready-made solution for this kind of
> > things?
>
> > Cheers!
> > Ernest
>
> There are two packages that deal with songbooks on CTAN: songs and
> songbook. =A0Maybe those would do the trick.
>
> If not, you can roll your own tables of contents type things using any
> of the following:
>
> tocloft
> titlesec/titletoc
> memoir (which provides all the facilities of tocloft plus more)
>
> Alan

Thanks for your suggestions, Alan.
In the end, I think I've fixed it. Instead of \dotfill now
I use a \dots command that is defined to be
\mbox{}\nobreak\dotfill\nobreak
And I changed the enumerate environment to do
ragged right, so that lines break nicely. This seems to
do it!

Bye.
Ernest
0
Reply ernest 7/31/2010 2:42:43 PM

On Jul 31, 9:42=A0am, ernest <nfdi...@gmail.com> wrote:

>
> In the end, I think I've fixed it. Instead of \dotfill now
> I use a \dots command that is defined to be
> \mbox{}\nobreak\dotfill\nobreak

You shoukd be aware that \dots is a basic latex math
command. You shoud be sure you don't need it before
redefining it, and it's probably safer just to use a
different command name.


Dan
0
Reply Dan 7/31/2010 7:34:05 PM

3 Replies
172 Views

(page loaded in 0.112 seconds)

Similiar Articles:













7/15/2012 2:39:44 PM


Reply: