ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Henning Hraban Ramm <texml@fiee.net>
Subject: Re: Limit text width in items
Date: Thu, 26 Jul 2018 17:57:21 +0200	[thread overview]
Message-ID: <a5fee47f-d1bf-0c9d-9f26-0800a49dbae3@xs4all.nl> (raw)
In-Reply-To: <BBFC635D-5395-49AE-8745-DAE93A6687BF@fiee.net>

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
___________________________________________________________________________________

  reply	other threads:[~2018-07-26 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 11:33 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 [this message]
2018-07-26 16:06         ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5fee47f-d1bf-0c9d-9f26-0800a49dbae3@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    --cc=texml@fiee.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).