Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

memoir and \justlastraggedleft, list of URLs

2 views
Skip to first unread message

Marc Baudoin

unread,
Nov 19, 2009, 10:22:00 AM11/19/09
to
Hi,

I'm writing a manual that has a list of URLs at the end of each
section so that the students can get more information by visiting
them.

I'd like it to be typeset like this:

http://short-urls-are-flush-left/
http://longer-urls-have-their-first-line-flush-left/and/the/
rest/flush/right/

I'm using:

- the brilliant memoir class, the leftbar environment so that the
list of URLs can easily be seen and the \justlastraggedleft
command to deal with long URLs

- the asparablank environment from the paralist package to
typeset the list

- the url package so that URLs can be broken

The \justlastraggedleft command works fine except it flushes
right the short URLs (less than one line):

http://short-urls-are-flush-left/
http://longer-urls-have-their-first-line-flush-left/and/the/
rest/flush/right/

Which is obviously not what I want.

How can I solve my problem?

Generally speaking, how do you typeset list of URLs (because
maybe I'm doing things wrong)?

Below is a short document showing my problem.

Thanks for your help.

-----------------------------------------------------------------

\documentclass{memoir}

\usepackage[defblank]{paralist}
\usepackage{url}

\begin{document}

\begin{leftbar}
\begin{asparablank}
\setlength{\itemindent}{0mm}
\justlastraggedleft
\item \url{http://www.this-is-a-short-url.com/}
\item \url{http://www.this-is-a-much-longer.com/with/tons/of/stuff/that/makes/it/larger/than/the/typeblock/}
\end{asparablank}
\end{leftbar}

\end{document}

-----------------------------------------------------------------

Donald Arseneau

unread,
Nov 19, 2009, 11:23:42 PM11/19/09
to
On Nov 19, 7:22 am, Marc Baudoin <baba...@babafou.eu.org> wrote:
> I'd like it to be typeset like this:
>
> http://short-urls-are-flush-left/http://longer-urls-have-their-first-line-flush-left/and/the/
> rest/flush/right/

Yoiur demonstration leaves something to the imagination.

> - the brilliant memoir class, the leftbar environment so that the
> list of URLs can easily be seen and the \justlastraggedleft
> command to deal with long URLs

I think that is a bad choice because the lines before the last get
justified to both margins, which is bad for a line full of url.

Better to use \raggedrightthenleft instead. It matches your
requirement
"longer-urls-have-their-first-line-flush-left/and/the/rest/flush/
right".

> \item \url{http://www.this-is-a-much-longer.com/with/tons/of/stuff/that/makes/it...}

\raggedrightthenleft has to put something in \everypar, which is also
used
in lists, so \item will ruin the operation of \raggedrightthenleft.
Do you really
need to use a list?

Donald Arseneau

Marc Baudoin

unread,
Nov 20, 2009, 3:58:09 AM11/20/09
to
On 2009-11-20, Donald Arseneau <as...@triumf.ca> wrote:
> On Nov 19, 7:22 am, Marc Baudoin <baba...@babafou.eu.org> wrote:
> > I'd like it to be typeset like this:
> >
> > http://short-urls-are-flush-left/http://longer-urls-have-their-first-line-flush-left/and/the/
> > rest/flush/right/
>
> Yoiur demonstration leaves something to the imagination.

Your newsreader seems to have removed my carriage returns, that's
why.

In a few words, I want a list of URLs, one on each line. If a
long URL has to be broken because it's larger than \textwidth,
I'd like for the end of it to be flush right.

> > - the brilliant memoir class, the leftbar environment so that the
> > list of URLs can easily be seen and the \justlastraggedleft
> > command to deal with long URLs
>
> I think that is a bad choice because the lines before the last get
> justified to both margins, which is bad for a line full of url.
>
> Better to use \raggedrightthenleft instead. It matches your
> requirement
> "longer-urls-have-their-first-line-flush-left/and/the/rest/flush/
> right".
>
> > \item \url{http://www.this-is-a-much-longer.com/with/tons/of/stuff/that/makes/it...}
>
> \raggedrightthenleft has to put something in \everypar, which is also
> used
> in lists, so \item will ruin the operation of \raggedrightthenleft.

Right.

> Do you really
> need to use a list?

No but it seemed structurally appropriate.

I've just tried the (simpler) code below, which works. Any other
idea?

Anyway, thanks for your help!

-----------------------------------------------------------------

\documentclass{memoir}

\usepackage{url}

\newcommand{\myurl}[1]{\url{#1}\par}

\begin{document}

\begin{leftbar}
\raggedrightthenleft
\myurl{http://www.this-is-a-short-url.com/}
\myurl{http://www.this-is-a-much-longer.com/with/tons/of/stuff/that/makes/it/larger/than/the/typeblock/}

0 new messages