ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* wrapping a long URL without added spaces
@ 2006-04-11 22:33 Alan Bowen
  2006-04-12  8:04 ` Taco Hoekwater
  2006-04-13 11:29 ` Hans Hagen
  0 siblings, 2 replies; 14+ messages in thread
From: Alan Bowen @ 2006-04-11 22:33 UTC (permalink / raw)


I can wrap a long URL using \hyphenatedurl, but not without getting  
some unwanted spaces before the numerous “/”s in the URL.

I expect that I have missed something elementary, again. Still, my  
efforts to avoid the spaces have thus far been unsuccessful, so any  
help would be gratefully received.

My current setup is

[Campbell]
[{http://www.very.long.edu/very/very/long/url/2002dp1.pdf}]
[]
[{\hyphenatedurl{http://www.very.long.edu/very/very/long/url/ 
2002dp1.pdf}}]

I also have
\setupinteraction[state=start,color=blue,style=rm]

Alan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-11 22:33 wrapping a long URL without added spaces Alan Bowen
@ 2006-04-12  8:04 ` Taco Hoekwater
  2006-04-12 11:47   ` Alan Bowen
  2006-04-13 11:29 ` Hans Hagen
  1 sibling, 1 reply; 14+ messages in thread
From: Taco Hoekwater @ 2006-04-12  8:04 UTC (permalink / raw)




Hi Alan,

Alan Bowen wrote:
> I can wrap a long URL using \hyphenatedurl, but not without getting  
> some unwanted spaces before the numerous “/”s in the URL.

You are not telling us something, because I get no extra spaces
after toying around with your description for a while. Please
post a minimal file that demonstrates the problem.

Greetings, Taco

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-12  8:04 ` Taco Hoekwater
@ 2006-04-12 11:47   ` Alan Bowen
  2006-04-12 12:45     ` Taco Hoekwater
  0 siblings, 1 reply; 14+ messages in thread
From: Alan Bowen @ 2006-04-12 11:47 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

Hi, Taco!

Here is a minimal file that produces the problem. Note that if you  
comment out \setupinteraction[...], the problem goes away and the URL  
is wrapped nicely.

Thanks for looking at this.

Alan

PS I am using ConTeXt  ver: 2006.04.09 22:25  fmt: 2006.4.10  int:  
english  mes: english



[-- Attachment #2: hyphenatedurlTest.tex --]
[-- Type: application/octet-stream, Size: 1614 bytes --]

\setupcolors [state=start,textcolor=black] 
	\setupcolor[rgb]

\setupinteraction[state=start,color=blue,style=rm]

%Bibliography Format
\definehead[BibTitle][subject]
\setupsectionblock[BibTitle][number=no,page=right]
\setuphead[BibTitle][style={sc}, after={\blank}]

\def\hangover{\hangafter=1\hangindent=1.5pc\raggedright}
\definestartstop[bibliography][
  before={
    \page[no]
    \indenting[never]
    \startalignment[left]
    \BibTitle{bibliography}
    \stopalignment
    \bgroup\appendtoks\hangover\to\everypar
    },
  after={
    \egroup
    \indenting[yes]}]

\def\bibentryrule{\noindent\vrule height0.4pt width44pt depth0pt\thinspace}

\useURL
[CampbellinLICSa]
[{http://www.leeds.ac.uk/classics/lics/2002/200203.pdf}]
[]
[{\hyphenatedurl{http://www.leeds.ac.uk/classics/lics/2002/200203.pdf}}]
\useURL
[CampbellinLICSb]
[{http://www.leeds.ac.uk/classics/lics/discussion/2002dp1.pdf}]
[]
[{\hyphenatedurl{http://www.leeds.ac.uk/classics/lics/discussion/2002dp1.pdf}}]

\starttext
\input knuth

The following is a test of URL wrapping \from[CampbellinLICSa]

\startbibliography
Blickman, D.\ R.\ 1989.\ \quote{Lucretius, Epicurus and Prehistory}.\ {\em Harvard Studies in Classical Philology} 92:157||191. 

Campbell, G. 2002a. \quote{Lucretius 5.1011||27: The Origins of Justice and the Prisoner's 
Dilemma}.\ {\em Leeds International Classical Studies} 1.3:1||12 (\from[CampbellinLICSa]). 

\bibentryrule 2002b. \quote{Lucretius and the Memes of Prehistory}.\ Discussion Paper 1, November 2002.\ {\em Leeds International Classical Studies} \from[CampbellinLICSb]. 


\stopbibliography


\stoptext
 

[-- Attachment #3: Type: text/plain, Size: 596 bytes --]


On Apr 12, 2006, at 4:04 AM, Taco Hoekwater wrote:

>
>
> Hi Alan,
>
> Alan Bowen wrote:
>> I can wrap a long URL using \hyphenatedurl, but not without getting
>> some unwanted spaces before the numerous “/”s in the URL.
>
> You are not telling us something, because I get no extra spaces
> after toying around with your description for a while. Please
> post a minimal file that demonstrates the problem.
>
> Greetings, Taco
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context


[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-12 11:47   ` Alan Bowen
@ 2006-04-12 12:45     ` Taco Hoekwater
  2006-04-13 11:53       ` Alan Bowen
  0 siblings, 1 reply; 14+ messages in thread
From: Taco Hoekwater @ 2006-04-12 12:45 UTC (permalink / raw)




Alan Bowen wrote:
> Hi, Taco!
> 
> Here is a minimal file that produces the problem. Note that if you  
> comment out \setupinteraction[...], the problem goes away and the URL  
> is wrapped nicely.

Ok, here is the diagnosis:

The \from command calls \dogotospace which in turn calls 
\processisolatedwords, and at that point, \betweenisolatedwords
contains the actual space that is causing the problems.

I am not sure how to fix this elegantly, though.

Taco

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-11 22:33 wrapping a long URL without added spaces Alan Bowen
  2006-04-12  8:04 ` Taco Hoekwater
@ 2006-04-13 11:29 ` Hans Hagen
  2006-04-13 12:03   ` Alan Bowen
  1 sibling, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-13 11:29 UTC (permalink / raw)


Alan Bowen wrote:
> I can wrap a long URL using \hyphenatedurl, but not without getting  
> some unwanted spaces before the numerous �/�s in the URL.
>
> I expect that I have missed something elementary, again. Still, my  
> efforts to avoid the spaces have thus far been unsuccessful, so any  
> help would be gratefully received.
>
> My current setup is
>
> [Campbell]
> [{http://www.very.long.edu/very/very/long/url/2002dp1.pdf}]
> []
> [{\hyphenatedurl{http://www.very.long.edu/very/very/long/url/ 
> 2002dp1.pdf}}]
>
> I also have
> \setupinteraction[state=start,color=blue,style=rm]
>   
can you be more specific ... 

\showframe

\setupinteraction[state=start]

\starttext

\useurl
  [Campbell]
  [http://www.very.long.edu/very/very/long/url/2002dp1.pdf]
  []
  [http://www.very.long.edu/very/very/long/url/2002dp1.pdf]

\hsize2mm\goto{\url[Campbell]}[url(Campbell)]

\stoptext

i see no spaces 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-12 12:45     ` Taco Hoekwater
@ 2006-04-13 11:53       ` Alan Bowen
  0 siblings, 0 replies; 14+ messages in thread
From: Alan Bowen @ 2006-04-13 11:53 UTC (permalink / raw)


Taco—

Many thanks for the diagnosis. That is a good start, but I guess that  
for now I will have to find another way get long interactive links  
into my docs.

Best, Alan



On Apr 12, 2006, at 8:45 AM, Taco Hoekwater wrote:

>
>
> Alan Bowen wrote:
>> Hi, Taco!
>>
>> Here is a minimal file that produces the problem. Note that if you
>> comment out \setupinteraction[...], the problem goes away and the URL
>> is wrapped nicely.
>
> Ok, here is the diagnosis:
>
> The \from command calls \dogotospace which in turn calls
> \processisolatedwords, and at that point, \betweenisolatedwords
> contains the actual space that is causing the problems.
>
> I am not sure how to fix this elegantly, though.
>
> Taco
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-13 11:29 ` Hans Hagen
@ 2006-04-13 12:03   ` Alan Bowen
  2006-04-13 13:00     ` Hans Hagen
  0 siblings, 1 reply; 14+ messages in thread
From: Alan Bowen @ 2006-04-13 12:03 UTC (permalink / raw)


Hans—

The problem arises if one has

[Campbell]
[{http://www.very.long.edu/very/very/long/url/2002dp1.pdf}]
[]
[{\hyphenatedurl{http://www.very.long.edu/very/very/long/url/
2002dp1.pdf}}]

and then tries \from[Campbell] with \setupinteraction[state=start,]

But I see now that I that I can get the desired wrapping using \goto  
rather than \hyphenatedurl and \from.

Two questions

•  Which is preferred, \useURL or \useurl?

• Is there a “\setupgoto”? I need to make the typeface in the  
printed URL the same as that in the body text.

and thanks.

Alan


On Apr 13, 2006, at 7:29 AM, Hans Hagen wrote:

> Alan Bowen wrote:
>> I can wrap a long URL using \hyphenatedurl, but not without getting
>> some unwanted spaces before the numerous �/�s in the URL.
>>
>> I expect that I have missed something elementary, again. Still, my
>> efforts to avoid the spaces have thus far been unsuccessful, so any
>> help would be gratefully received.
>>
>> My current setup is
>>
>> [Campbell]
>> [{http://www.very.long.edu/very/very/long/url/2002dp1.pdf}]
>> []
>> [{\hyphenatedurl{http://www.very.long.edu/very/very/long/url/
>> 2002dp1.pdf}}]
>>
>> I also have
>> \setupinteraction[state=start,color=blue,style=rm]
>>
> can you be more specific ...
>
> \showframe
>
> \setupinteraction[state=start]
>
> \starttext
>
> \useurl
>   [Campbell]
>   [http://www.very.long.edu/very/very/long/url/2002dp1.pdf]
>   []
>   [http://www.very.long.edu/very/very/long/url/2002dp1.pdf]
>
> \hsize2mm\goto{\url[Campbell]}[url(Campbell)]
>
> \stoptext
>
> i see no spaces
>
> Hans
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-13 12:03   ` Alan Bowen
@ 2006-04-13 13:00     ` Hans Hagen
  2006-04-13 19:15       ` Alan Bowen
  0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-13 13:00 UTC (permalink / raw)


Alan Bowen wrote:
> Hans—
>
> The problem arises if one has
>
> [Campbell]
> [{http://www.very.long.edu/very/very/long/url/2002dp1.pdf}]
> []
> [{\hyphenatedurl{http://www.very.long.edu/very/very/long/url/
> 2002dp1.pdf}}]
>
> and then tries \from[Campbell] with \setupinteraction[state=start,]
>
> But I see now that I that I can get the desired wrapping using \goto  
> rather than \hyphenatedurl and \from.
>   
indeed, you do a double hyphenated url then
> Two questions
>
> •  Which is preferred, \useURL or \useurl?
>   
no prefered
> • Is there a “\setupgoto”? I need to make the typeface in the  
> printed URL the same as that in the body text.
>   
\setupurl 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-13 13:00     ` Hans Hagen
@ 2006-04-13 19:15       ` Alan Bowen
  2006-04-14 18:21         ` Johannes Graumann
  0 siblings, 1 reply; 14+ messages in thread
From: Alan Bowen @ 2006-04-13 19:15 UTC (permalink / raw)


Again, thanks, Hans. Your help is very much appreciated.

All best, Alan

On Apr 13, 2006, at 9:00 AM, Hans Hagen wrote:

> Alan Bowen wrote:
>> Hans—
>>
>> The problem arises if one has
>>
>> [Campbell]
>> [{http://www.very.long.edu/very/very/long/url/2002dp1.pdf}]
>> []
>> [{\hyphenatedurl{http://www.very.long.edu/very/very/long/url/
>> 2002dp1.pdf}}]
>>
>> and then tries \from[Campbell] with \setupinteraction[state=start,]
>>
>> But I see now that I that I can get the desired wrapping using \goto
>> rather than \hyphenatedurl and \from.
>>
> indeed, you do a double hyphenated url then
>> Two questions
>>
>> •  Which is preferred, \useURL or \useurl?
>>
> no prefered
>> • Is there a “\setupgoto”? I need to make the typeface in the
>> printed URL the same as that in the body text.
>>
> \setupurl
>
> Hans
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-13 19:15       ` Alan Bowen
@ 2006-04-14 18:21         ` Johannes Graumann
  2006-04-14 18:35           ` Hans Hagen
  2006-04-14 18:55           ` Alan Bowen
  0 siblings, 2 replies; 14+ messages in thread
From: Johannes Graumann @ 2006-04-14 18:21 UTC (permalink / raw)


Alan Bowen wrote:
>> \setupurl

Alan,

Have you gotten this to work? I'm trying to get my \hyphenatedurl to
be '\tt', but something like '\setupurl[style=tt]' doesn't work for me ...

Joh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-14 18:21         ` Johannes Graumann
@ 2006-04-14 18:35           ` Hans Hagen
  2006-04-14 18:36             ` Johannes Graumann
  2006-04-14 18:55           ` Alan Bowen
  1 sibling, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-14 18:35 UTC (permalink / raw)


Johannes Graumann wrote:
> Alan Bowen wrote:
>   
>>> \setupurl
>>>       
>
> Alan,
>
> Have you gotten this to work? I'm trying to get my \hyphenatedurl to
> be '\tt', but something like '\setupurl[style=tt]' doesn't work for me ...
>
>   
does

\setupurl[style=\tt] 

work
> Joh
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   


-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-14 18:35           ` Hans Hagen
@ 2006-04-14 18:36             ` Johannes Graumann
  0 siblings, 0 replies; 14+ messages in thread
From: Johannes Graumann @ 2006-04-14 18:36 UTC (permalink / raw)


Hans Hagen wrote:

> does
> 
> \setupurl[style=\tt]
> 
> work

No, can't get that to work either ...

Joh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-14 18:21         ` Johannes Graumann
  2006-04-14 18:35           ` Hans Hagen
@ 2006-04-14 18:55           ` Alan Bowen
  2006-04-14 18:58             ` Johannes Graumann
  1 sibling, 1 reply; 14+ messages in thread
From: Alan Bowen @ 2006-04-14 18:55 UTC (permalink / raw)


Joh—

All I needed was \setupurl[style=normal] to get urls printed in the  
bodyfont.

Have you tried \setupurl[style=teletype] or \setupurl[style=type]?

By the way, I am not using \hypehnatedurl any more:
I define \useURL
[label]
[{insert url here}]
[]
[{insert url here}]
in the preamble and then
use
\goto{\url[label]}[url(label)]
at the desired point in the source file to get proper wrapping and  
hyphenation.

Alan

On Apr 14, 2006, at 2:21 PM, Johannes Graumann wrote:

> Alan Bowen wrote:
>>> \setupurl
>
> Alan,
>
> Have you gotten this to work? I'm trying to get my \hyphenatedurl to
> be '\tt', but something like '\setupurl[style=tt]' doesn't work for  
> me ...
>
> Joh
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: wrapping a long URL without added spaces
  2006-04-14 18:55           ` Alan Bowen
@ 2006-04-14 18:58             ` Johannes Graumann
  0 siblings, 0 replies; 14+ messages in thread
From: Johannes Graumann @ 2006-04-14 18:58 UTC (permalink / raw)


Alan Bowen wrote:

> Have you tried \setupurl[style=teletype] or \setupurl[style=type]?
Neither works.

> By the way, I am not using \hypehnatedurl any more:
> I define \useURL
> [label]
> [{insert url here}]
> []
> [{insert url here}]
> in the preamble and then
> use
> \goto{\url[label]}[url(label)]
> at the desired point in the source file to get proper wrapping and
> hyphenation.
Thanks for the hint.

Joh

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-04-14 18:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-11 22:33 wrapping a long URL without added spaces Alan Bowen
2006-04-12  8:04 ` Taco Hoekwater
2006-04-12 11:47   ` Alan Bowen
2006-04-12 12:45     ` Taco Hoekwater
2006-04-13 11:53       ` Alan Bowen
2006-04-13 11:29 ` Hans Hagen
2006-04-13 12:03   ` Alan Bowen
2006-04-13 13:00     ` Hans Hagen
2006-04-13 19:15       ` Alan Bowen
2006-04-14 18:21         ` Johannes Graumann
2006-04-14 18:35           ` Hans Hagen
2006-04-14 18:36             ` Johannes Graumann
2006-04-14 18:55           ` Alan Bowen
2006-04-14 18:58             ` Johannes Graumann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).