ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Limit text width in items
@ 2018-07-23 11:33 Henning Hraban Ramm
  2018-07-26 13:43 ` Henning Hraban Ramm
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2018-07-23 11:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello again,

in the MWE below I’d like to limit the run width of the item text so that the (page) number is standing out, e.g.

• This is a long and winding text
  that leads to a number .......... 99

The text can become one or several lines long.

I tried to put the text in boxes, e.g. \simplealignedbox{}{}{\vbox{...}} but I got only ugly spacing.
Also, the last line of the text continues in that leaders and number.

---

\def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill}

\starttext

\startitemize[packed,joinedup]
\startitem
	\input tufte
	\leaderfill 33
\stopitem
\startitem
	\input knuth
	\leaderfill 99
\stopitem
\stopitemize

\stoptext

---


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Limit text width in items
  2018-07-23 11:33 Limit text width in items Henning Hraban Ramm
@ 2018-07-26 13:43 ` Henning Hraban Ramm
  2018-07-26 14:03   ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2018-07-26 13:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2018-07-23 um 13:33 schrieb Henning Hraban Ramm <texml@fiee.net>:

> Hello again,
> 
> in the MWE below I’d like to limit the run width of the item text so that the (page) number is standing out, e.g.
> 
> • This is a long and winding text
>   that leads to a number .......... 99
> 
> The text can become one or several lines long.
> 
> I tried to put the text in boxes, e.g. \simplealignedbox{}{}{\vbox{...}} but I got only ugly spacing.
> Also, the last line of the text continues in that leaders and number.
> 
> ---
> 
> \def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill}
> 
> \starttext
> 
> \startitemize[packed,joinedup]
> \startitem
> 	\input tufte
> 	\leaderfill 33
> \stopitem
> \startitem
> 	\input knuth
> 	\leaderfill 99
> \stopitem
> \stopitemize
> 
> \stoptext

No idea? Anyone?
Would it work to force an overfull hbox somehow in every last line?


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD


___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Limit text width in items
  2018-07-26 13:43 ` Henning Hraban Ramm
@ 2018-07-26 14:03   ` Hans Hagen
  2018-07-26 15:27     ` Henning Hraban Ramm
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2018-07-26 14:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

On 7/26/2018 3:43 PM, Henning Hraban Ramm wrote:
> Am 2018-07-23 um 13:33 schrieb Henning Hraban Ramm <texml@fiee.net>:
> 
>> Hello again,
>>
>> in the MWE below I’d like to limit the run width of the item text so that the (page) number is standing out, e.g.
>>
>> • This is a long and winding text
>>    that leads to a number .......... 99
>>
>> The text can become one or several lines long.
>>
>> I tried to put the text in boxes, e.g. \simplealignedbox{}{}{\vbox{...}} but I got only ugly spacing.
>> Also, the last line of the text continues in that leaders and number.
>>
>> ---
>>
>> \def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill}
>>
>> \starttext
>>
>> \startitemize[packed,joinedup]
>> \startitem
>> 	\input tufte
>> 	\leaderfill 33
>> \stopitem
>> \startitem
>> 	\input knuth
>> 	\leaderfill 99
>> \stopitem
>> \stopitemize
>>
>> \stoptext
> 
> No idea? Anyone?
> Would it work to force an overfull hbox somehow in every last line?
\def\MyFill#1%
   {\leaders\hbox to 1em{\hss.\hss}\hfill
    \rlap{\hbox to \rightskip{\hss#1}}}

\showframe

\starttext

\startnarrower[2*right]
\startitemize[packed,joinedup]
\startitem
	\input tufte
	\MyFill{33}
\stopitem
\startitem
	\input knuth
	\MyFill{99}
\stopitem
\stopitemize
\stopnarrower

\stoptext

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Limit text width in items
  2018-07-26 14:03   ` Hans Hagen
@ 2018-07-26 15:27     ` Henning Hraban Ramm
  2018-07-26 15:57       ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2018-07-26 15:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2018-07-26 um 16:03 schrieb Hans Hagen <j.hagen@xs4all.nl>:

> \def\MyFill#1%
>  {\leaders\hbox to 1em{\hss.\hss}\hfill
>   \rlap{\hbox to \rightskip{\hss#1}}}
> 
> \showframe
> 
> \starttext
> 
> \startnarrower[2*right]
> \startitemize[packed,joinedup]
> \startitem
> 	\input tufte
> 	\MyFill{33}
> \stopitem
> \startitem
> 	\input knuth
> 	\MyFill{99}
> \stopitem
> \stopitemize
> \stopnarrower
> 
> \stoptext

Thank you very much!
I can even put \start/stopnarrower in before/after of \setupitemgroup.
Its width parameter doesn’t work (at least not together with inmargin).

But in your solution the dots (leaders) also stop with the text, and
I’d like them to continue up to the number.
I tried:

\def\MyFill#1{\leaders\hbox to 1em{\hss. }\hfill
  \rlap{\hbox to \rightskip{\leaders\hbox to 1em{. \hss}\hfill#1}}}

But that’s ugly and gives an irregular gap between the two sets.
I don’t understand this low level TeX enough...


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Limit text width in items
  2018-07-26 15:27     ` Henning Hraban Ramm
@ 2018-07-26 15:57       ` Hans Hagen
  2018-07-26 16:06         ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2018-07-26 15:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

On 7/26/2018 5:27 PM, Henning Hraban Ramm wrote:
> Am 2018-07-26 um 16:03 schrieb Hans Hagen <j.hagen@xs4all.nl>:
> 
>> \def\MyFill#1%
>>   {\leaders\hbox to 1em{\hss.\hss}\hfill
>>    \rlap{\hbox to \rightskip{\hss#1}}}
>>
>> \showframe
>>
>> \starttext
>>
>> \startnarrower[2*right]
>> \startitemize[packed,joinedup]
>> \startitem
>> 	\input tufte
>> 	\MyFill{33}
>> \stopitem
>> \startitem
>> 	\input knuth
>> 	\MyFill{99}
>> \stopitem
>> \stopitemize
>> \stopnarrower
>>
>> \stoptext
> 
> Thank you very much!
> I can even put \start/stopnarrower in before/after of \setupitemgroup.
> Its width parameter doesn’t work (at least not together with inmargin).
> 
> But in your solution the dots (leaders) also stop with the text, and
> I’d like them to continue up to the number.
> I tried:
> 
> \def\MyFill#1{\leaders\hbox to 1em{\hss. }\hfill
>    \rlap{\hbox to \rightskip{\leaders\hbox to 1em{. \hss}\hfill#1}}}
> 
> But that’s ugly and gives an irregular gap between the two sets.
> I don’t understand this low level TeX enough...
maybe time that i start a manual about tex basics ...

\starttexdefinition MyFill #1
     \removeunwantedspaces
     \begingroup
     \parfillskip-1\rightskip plus 1fil\relax
     \cleaders\hbox spread 1em{\hss.\hss}\hfill
     \hbox{#1}
     \par
     \endgroup
\stoptexdefinition

\showframe

\starttext

\startnarrower[2*right]
\startitemize[packed,joinedup]
\startitem
	\input tufte
	\MyFill{33}
\stopitem
\startitem
	\input knuth
	\MyFill{99}
\stopitem
\stopitemize
\stopnarrower

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Limit text width in items
  2018-07-26 15:57       ` Hans Hagen
@ 2018-07-26 16:06         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2018-07-26 16:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/26/2018 5:57 PM, Hans Hagen wrote:

>> I can even put \start/stopnarrower in before/after of \setupitemgroup.
>> Its width parameter doesn’t work (at least not together with inmargin).

rightmargin=3em

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2018-07-26 16:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 11:33 Limit text width in items Henning Hraban Ramm
2018-07-26 13:43 ` Henning Hraban Ramm
2018-07-26 14:03   ` Hans Hagen
2018-07-26 15:27     ` Henning Hraban Ramm
2018-07-26 15:57       ` Hans Hagen
2018-07-26 16:06         ` 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).