Louis
2004-01-26 22:00:33 UTC
I'd like to use the tabular* environment to display a list of tracks so that
the track number & the song title are flush left and the track length flush
right (array width is \textwidth) ... the thing is , i'd like to prevent
LaTeX from wrapping the song titles, that's why i don't use tabularx
environment ... Though if a song title is very long (see the code below), i
can't use resizebox{\textwidth}{!}{...} to resize the array, i guess this is
because \begin{tabular*}{\textwidth}actually produces a box of width
\textwidth, no matter what's inside ...
Is there a way to make it work ?
Or can you think of another way to do it with the following constraints :
- track titles are not breaked, each one is on a single line
- some track titles can be very long (width>\textwidth)
- array width is \textwidth
- track title flush left
- track length flush right
( - plus \dotfill between track title and length ?)
Thank you for your answers !
\documentclass{minimal}
\usepackage[paperwidth=5cm,paperheight=13cm,nohead,nofoot,pdftex=true,margin
=0mm]{geometry} % note the paperwidth (i.e. textwidth)
\usepackage{array}
\usepackage{graphicx}
\setlength{\topskip}{0pt} \setlength{\parindent}{0pt}
\setlength{\parskip}{0pt} \setlength{\vskip}{0pt}
\pagestyle{empty}
\begin{document}
\resizebox{\textwidth}{!}{%
\begin{tabular*}{\textwidth}{r@{.}l@{\extracolsep{\fill}}r@{\extracolsep{0pt
}:}l}
1 & first track title & 12 & 23 \\
12 & Now this is a very very long title for a track fkj kj kj kjhfd kjh kjh
kjh kjh kh kjh kjh kjhhkjh kjh kh & 1 & 11 \\
145 & song \#3 & 3 & 00
\end{tabular*}%
}
\end{document}
the track number & the song title are flush left and the track length flush
right (array width is \textwidth) ... the thing is , i'd like to prevent
LaTeX from wrapping the song titles, that's why i don't use tabularx
environment ... Though if a song title is very long (see the code below), i
can't use resizebox{\textwidth}{!}{...} to resize the array, i guess this is
because \begin{tabular*}{\textwidth}actually produces a box of width
\textwidth, no matter what's inside ...
Is there a way to make it work ?
Or can you think of another way to do it with the following constraints :
- track titles are not breaked, each one is on a single line
- some track titles can be very long (width>\textwidth)
- array width is \textwidth
- track title flush left
- track length flush right
( - plus \dotfill between track title and length ?)
Thank you for your answers !
\documentclass{minimal}
\usepackage[paperwidth=5cm,paperheight=13cm,nohead,nofoot,pdftex=true,margin
=0mm]{geometry} % note the paperwidth (i.e. textwidth)
\usepackage{array}
\usepackage{graphicx}
\setlength{\topskip}{0pt} \setlength{\parindent}{0pt}
\setlength{\parskip}{0pt} \setlength{\vskip}{0pt}
\pagestyle{empty}
\begin{document}
\resizebox{\textwidth}{!}{%
\begin{tabular*}{\textwidth}{r@{.}l@{\extracolsep{\fill}}r@{\extracolsep{0pt
}:}l}
1 & first track title & 12 & 23 \\
12 & Now this is a very very long title for a track fkj kj kj kjhfd kjh kjh
kjh kjh kh kjh kjh kjhhkjh kjh kh & 1 & 11 \\
145 & song \#3 & 3 & 00
\end{tabular*}%
}
\end{document}