ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \definetype[xxx][linebreaks=yes, breakpoints=name]
@ 2013-10-06 23:09 Peter Münster
  2013-10-07  8:07 ` Hans Hagen
  2013-10-07  8:13 ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Münster @ 2013-10-06 23:09 UTC (permalink / raw)
  To: ConTeXt users

Hi,

Is it already possible to define a new \type{} command that allows
linebreaks and perhaps also a breakpoint set?

If not, here my feature request: something like
\definetype[xxx][linebreaks=yes, breakpoints=compound]

TIA,
-- 
           Peter
___________________________________________________________________________________
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] 7+ messages in thread

* Re: \definetype[xxx][linebreaks=yes, breakpoints=name]
  2013-10-06 23:09 \definetype[xxx][linebreaks=yes, breakpoints=name] Peter Münster
@ 2013-10-07  8:07 ` Hans Hagen
  2013-10-07  8:13 ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2013-10-07  8:07 UTC (permalink / raw)
  To: ntg-context

On 10/7/2013 1:09 AM, Peter Münster wrote:
> Hi,
>
> Is it already possible to define a new \type{} command that allows
> linebreaks and perhaps also a breakpoint set?
>
> If not, here my feature request: something like
> \definetype[xxx][linebreaks=yes, breakpoints=compound]

\definetype[whatever][lines=yes,space=stretch]

-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 7+ messages in thread

* Re: \definetype[xxx][linebreaks=yes, breakpoints=name]
  2013-10-06 23:09 \definetype[xxx][linebreaks=yes, breakpoints=name] Peter Münster
  2013-10-07  8:07 ` Hans Hagen
@ 2013-10-07  8:13 ` Hans Hagen
  2013-10-07  8:30   ` Peter Münster
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-10-07  8:13 UTC (permalink / raw)
  To: ConTeXt users

On 10/7/2013 1:09 AM, Peter Münster wrote:
> Hi,
>
> Is it already possible to define a new \type{} command that allows
> linebreaks and perhaps also a breakpoint set?
>
> If not, here my feature request: something like
> \definetype[xxx][linebreaks=yes, breakpoints=compound]

this should be redefined:

\unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordspace\relax}

(used \interwordstretch which is zero)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 7+ messages in thread

* Re: \definetype[xxx][linebreaks=yes, breakpoints=name]
  2013-10-07  8:13 ` Hans Hagen
@ 2013-10-07  8:30   ` Peter Münster
  2013-10-07 10:05     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2013-10-07  8:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Oct 07 2013, Hans Hagen wrote:

>> If not, here my feature request: something like
>> \definetype[xxx][linebreaks=yes, breakpoints=compound]
>
> this should be redefined:
>
> \unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordspace\relax}

Hi Hans,

Unfortunately it does not work:

--8<---------------cut here---------------start------------->8---
\unprotect
\unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordspace\relax}
\protect
\definetype[whatever][lines=yes, space=stretch]
\setbreakpoints[compound]
\starttext
\hsize4cm
\whatever{fasdfjkl-fjsdkal-jskla-fjksdla-fjksdl-afjksdla}
fasdfjkl-fjsdkal-jskla-fjksdla-fjksdl-afjksdla
\stoptext
--8<---------------cut here---------------end--------------->8---

What am I doing wrong please?

-- 
           Peter
___________________________________________________________________________________
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] 7+ messages in thread

* Re: \definetype[xxx][linebreaks=yes, breakpoints=name]
  2013-10-07  8:30   ` Peter Münster
@ 2013-10-07 10:05     ` Hans Hagen
  2013-10-29 14:19       ` Peter Münster
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-10-07 10:05 UTC (permalink / raw)
  To: ntg-context

On 10/7/2013 10:30 AM, Peter Münster wrote:
> On Mon, Oct 07 2013, Hans Hagen wrote:
>
>>> If not, here my feature request: something like
>>> \definetype[xxx][linebreaks=yes, breakpoints=compound]
>>
>> this should be redefined:
>>
>> \unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordspace\relax}
>
> Hi Hans,
>
> Unfortunately it does not work:
>
> --8<---------------cut here---------------start------------->8---
> \unprotect
> \unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordspace\relax}
> \protect
> \definetype[whatever][lines=yes, space=stretch]
> \setbreakpoints[compound]
> \starttext
> \hsize4cm
> \whatever{fasdfjkl-fjsdkal-jskla-fjksdla-fjksdl-afjksdla}
> fasdfjkl-fjsdkal-jskla-fjksdla-fjksdl-afjksdla
> \stoptext
> --8<---------------cut here---------------end--------------->8---
>
> What am I doing wrong please?

I uploaded a bit more robust variant:

\starttext

     \setuplayout[width=4cm] \showframe

     \setupalign[stretch,verytolerant]

     \definetype[whatever][lines=hyphenated,space=stretch]

     A quote from ward: \expanded{\whatever{\cldloadfile{ward}}} That's it.

     \definetype[whatever][lines=normal,space=stretch]

     A quote from ward: \expanded{\whatever{\cldloadfile{ward}}} That's it.

\stoptext

Should work ok.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 7+ messages in thread

* Re: \definetype[xxx][linebreaks=yes, breakpoints=name]
  2013-10-07 10:05     ` Hans Hagen
@ 2013-10-29 14:19       ` Peter Münster
  2013-11-01 14:23         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2013-10-29 14:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Hans,

Is it also possible, to break inside the \type{} only at well defined
characters and without hyphenation?

Example:

--8<---------------cut here---------------start------------->8---
\definebreakpoint[compound][_]
\setuplayout[width=25mm]
\startsetups Test
  \setbreakpoints[compound]
\stopsetups
\definetype[Test][lines=hyphenated, setups=Test, space=stretch]
\showframe
\starttext
hellohello hellohello % should break like this: hel- lohello (ok)

hellohello \Test{hel_lohello} % should break like this: hel_ lohello (not ok)

hellohello \Test{hellohello} % should not break at all (not ok)
\stoptext
--8<---------------cut here---------------end--------------->8---

TIA for any help,
-- 
           Peter
___________________________________________________________________________________
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] 7+ messages in thread

* Re: \definetype[xxx][linebreaks=yes, breakpoints=name]
  2013-10-29 14:19       ` Peter Münster
@ 2013-11-01 14:23         ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2013-11-01 14:23 UTC (permalink / raw)
  To: ntg-context

On 10/29/2013 3:19 PM, Peter Münster wrote:
> Hello Hans,
>
> Is it also possible, to break inside the \type{} only at well defined
> characters and without hyphenation?
>
> Example:
>
> --8<---------------cut here---------------start------------->8---
> \definebreakpoint[compound][_]
> \setuplayout[width=25mm]
> \startsetups Test
>    \setbreakpoints[compound]
> \stopsetups
> \definetype[Test][lines=hyphenated, setups=Test, space=stretch]
> \showframe
> \starttext
> hellohello hellohello % should break like this: hel- lohello (ok)
>
> hellohello \Test{hel_lohello} % should break like this: hel_ lohello (not ok)
>
> hellohello \Test{hellohello} % should not break at all (not ok)
> \stoptext
> --8<---------------cut here---------------end--------------->8---
>
> TIA for any help,

\setuplayout
   [width=25mm]

\definebreakpoint
   [compound]
   [_]

\definetype
   [Test]
   [lines=hyphenated,
    setups=Test,
    space=stretch,
    style={\tttf\setbreakpoints[compound]}]

\showframe

\starttext
     hellohello hellohello

     hellohello \Test{hel_lohello}

     hellohello \Test{hellohello}
\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2013-11-01 14:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-06 23:09 \definetype[xxx][linebreaks=yes, breakpoints=name] Peter Münster
2013-10-07  8:07 ` Hans Hagen
2013-10-07  8:13 ` Hans Hagen
2013-10-07  8:30   ` Peter Münster
2013-10-07 10:05     ` Hans Hagen
2013-10-29 14:19       ` Peter Münster
2013-11-01 14:23         ` Hans Hagen

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