Re: [NTG-context] Custom breakpoints for \hyphenatedurl

2014-08-07 Thread Wolfgang Schuster

Am 05.08.2014 um 23:36 schrieb Joshua Krämer joshua.krae...@gmail.com:

 On 2014-08-05, 22:54, Wolfgang Schuster wrote:
 
 Can you provide a working minimal example?
 
 Sorry, please find an example at the end.
 
 The first URL has the right linebreaks, but the arrow should be at the
 end of the line.

The position of the \hyphenatedurlseparator symbol depends currently on the 
breakpoint in the url,
when the break is allowed after a character at the end of line but when the 
break is allowed before
a character the symbol appears at the begin of the line.

The question is now if this is intended or can it be changed. Another thing 
where we can discuss
is the way to set the separator, e.g. \sethypehantedurlseparator{…} seems more 
appropriate
than \def\hyphenatedurlseparator{…} because we already have other \setXXX 
commands.

 Interestingly, it shows another problem:  the # is repeated.

Has to be fixed.

 The second URL has a linebreak in front of the colon, which I do not want.

The points where contexts is allowed to break a url at :/# etc. are predefined 
in the Lua code.

When you want to change this you have to use the three commands

  - \sethyphenatedurlbefore{…}
  - \sethyphenatedurlafter{…}
  - \sethyphenatedurlnormal{…}

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom breakpoints for \hyphenatedurl

2014-08-07 Thread Joshua Krämer
On 2014-08-07, 12:58, Wolfgang Schuster wrote:

 The position of the \hyphenatedurlseparator symbol depends currently
 on the breakpoint in the url, when the break is allowed after a
 character at the end of line but when the break is allowed before a
 character the symbol appears at the begin of the line.
 The question is now if this is intended or can it be changed.

I can hardly imagine this to be intended.  The reader should be
informed about a break as soon as he reaches the break, so he knows the
word/token is not finished yet.  As we read from top to bottom, the
end of the top line is where this information should be.


 Another thing where we can discuss is the way to set the separator,
 e.g. \sethypehantedurlseparator{…} seems more appropriate than
 \def\hyphenatedurlseparator{…} because we already have other \setXXX
 commands.

Agreed.

  The second URL has a linebreak in front of the colon, which I do
  not want.
 
 The points where contexts is allowed to break a url at :/# etc. are
 predefined in the Lua code.
 
 When you want to change this you have to use the three commands
 
   - \sethyphenatedurlbefore{…}
   - \sethyphenatedurlafter{…}
   - \sethyphenatedurlnormal{…}

Could you please change my minimal example (attached at the
end) accordingly? I want an URL like http://optimist; to be wrapped
after :// only, not in front of the colon.  I couldn't find out how to
achieve this.  I also want no linebreak to occur between two slahes
(if this is possible with the current implementation).  By the way, I
also don't understand the meaning of \sethyphenatedurlnormal {...}.

Kind regards,
Joshua


\setuplayout[width=5cm]
\sethyphenatedurlafter {/}
\sethyphenatedurlbefore {}
\sethyphenatedurlnormal {}
\starttext

Word Word Word \hyphenatedurl {http://optimist.optimist}

Word Word Word W \hyphenatedurl {http://optimist.optimist}

Word Word Word Wo \hyphenatedurl {http://optimist.optimist}

(Only the first of these three linebreaks is desired.)

\stoptext


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Custom breakpoints for \hyphenatedurl

2014-08-05 Thread Joshua Krämer
Dear list,

I could successfully configure ConTeXt to introduce linebreaks /after/
some characters in URLs with \sethyphenatedurlafter {...}

I would also like to disable linebreaks /before/ some of the predefined
characters.  For example, no linebreak should occur before :

Is this possible?  \sethyphenatedurlbefore {} (with empty braces)
does not work.

Unfortunately, usage of \sethyphenatedurlafter also introduced the
following problem:  the \hyphenatedurlseparator symbol now appears
after the linebreak, i.e. at the beginning of the new line.  Can I do
something about it?

Thanks and kind regards,
Joshua


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom breakpoints for \hyphenatedurl

2014-08-05 Thread Wolfgang Schuster

Am 05.08.2014 um 22:03 schrieb Joshua Krämer joshua.krae...@gmail.com:

 Dear list,
 
 I could successfully configure ConTeXt to introduce linebreaks /after/
 some characters in URLs with \sethyphenatedurlafter {...}
 
 I would also like to disable linebreaks /before/ some of the predefined
 characters.  For example, no linebreak should occur before :
 
 Is this possible?  \sethyphenatedurlbefore {} (with empty braces)
 does not work.
 
 Unfortunately, usage of \sethyphenatedurlafter also introduced the
 following problem:  the \hyphenatedurlseparator symbol now appears
 after the linebreak, i.e. at the beginning of the new line.  Can I do
 something about it?

Can you provide a working minimal example?

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom breakpoints for \hyphenatedurl

2014-08-05 Thread Joshua Krämer
On 2014-08-05, 22:54, Wolfgang Schuster wrote:

 Can you provide a working minimal example?

Sorry, please find an example at the end.

The first URL has the right linebreaks, but the arrow should be at the
end of the line.  Interestingly, it shows another problem:  the # is
repeated.

The second URL has a linebreak in front of the colon, which I do not
want.

Thanks and kind regards,
Joshua


\setuplayout[width=5cm]
\def\hyphenatedurlseparator{→}
\sethyphenatedurlafter {/.#}
\sethyphenatedurlbefore {}
\starttext

\hyphenatedurl
{http://optimist.optimist/optimist/optimist.optimist#optimist}

Word Word Word Word \hyphenatedurl {http://optimist.optimist}

\stoptext


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___