[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hyphenating URLs

From: Valeriy E. Ushakov
Subject: Re: Hyphenating URLs
Date: Fri, 28 Nov 1997 20:08:56 +0300

On Fri, Nov 28, 1997 at 01:09:45PM +0000, Andrew Bardsley wrote:

> Does anyone know of an easy way for me to get URLs to
> break up correctly over a number of lines but without lout
> inserting hyphens.  I have a number of URLs in a Reference list
> for my thesis and I would like them to be able to span two
> lines kind of:
> Name, Institution blah blah http://somewhere.somewhereelse/
> dir/dir/dir/file
> I have tried placing hypenation points `&-' after each slash
> but I would ideally like a way of specifying that URLs not
> be broken by hyphens.  Is their a language setting for this?
> (should there be)

Hmm, lout doesn't break zero width gaps unless they are marked as
`h'yphenattion mode.  Thus a punctuation mark that is actually a
separate token won't be torn off the word it comes after.  In my
package for typesetting Tibetan I cheated a bit to overcome this
feature, because Tibean has no interword gaps, but line break can
occur at word boundaries.  I used { 0.1p } @Space { ... } to make
interword space practically indistinguishable from zero, but still
breakable by Lout.  So you might try 

    def "&+" left x right y { x &0.1p y }

Better yet, you might want to define a symbol @URL like

    # note the gaps are in quotes because we define "."!  Since dot is
    # the last definition, we can quote only the dot in the gap inside
    # the definition of "."

    export "~" "/" "//" "."
    def @URL
      body url
       def "~"  { "~"         }
       def "/"  { "/"  &".1p" }
       def "//" { "//" &".1p" }
       def "."  { "."  &".1p" }
       { nohyphen } @Break { url }


    # note: url is not quoted
    30s @Wide @URL {

Will be set as


SY, Uwe
address@hidden                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]