ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Custom breakpoints for \hyphenatedurl
@ 2014-08-05 20:03 Joshua Krämer
  2014-08-05 20:54 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Joshua Krämer @ 2014-08-05 20:03 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

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-wvrSQK3plZs@public.gmane.org / 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
___________________________________________________________________________________


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

* Re: Custom breakpoints for \hyphenatedurl
  2014-08-05 20:03 Custom breakpoints for \hyphenatedurl Joshua Krämer
@ 2014-08-05 20:54 ` Wolfgang Schuster
  2014-08-05 21:36   ` Joshua Krämer
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2014-08-05 20:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 05.08.2014 um 22:03 schrieb Joshua Krämer <joshua.kraemer@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
___________________________________________________________________________________


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

* Re: Custom breakpoints for \hyphenatedurl
  2014-08-05 20:54 ` Wolfgang Schuster
@ 2014-08-05 21:36   ` Joshua Krämer
  2014-08-07 10:58     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Joshua Krämer @ 2014-08-05 21:36 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

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
___________________________________________________________________________________

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

* Re: Custom breakpoints for \hyphenatedurl
  2014-08-05 21:36   ` Joshua Krämer
@ 2014-08-07 10:58     ` Wolfgang Schuster
  2014-08-07 13:14       ` Joshua Krämer
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2014-08-07 10:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 05.08.2014 um 23:36 schrieb Joshua Krämer <joshua.kraemer@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
___________________________________________________________________________________


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

* Re: Custom breakpoints for \hyphenatedurl
  2014-08-07 10:58     ` Wolfgang Schuster
@ 2014-08-07 13:14       ` Joshua Krämer
  0 siblings, 0 replies; 5+ messages in thread
From: Joshua Krämer @ 2014-08-07 13:14 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

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
___________________________________________________________________________________

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

end of thread, other threads:[~2014-08-07 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 20:03 Custom breakpoints for \hyphenatedurl Joshua Krämer
2014-08-05 20:54 ` Wolfgang Schuster
2014-08-05 21:36   ` Joshua Krämer
2014-08-07 10:58     ` Wolfgang Schuster
2014-08-07 13:14       ` Joshua Krämer

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).