ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: numbered itemize list item label alignment
Date: Sun, 15 Oct 2023 22:32:27 +0200 (CEST)	[thread overview]
Message-ID: <sps3s207-4o86-7952-9s62-82431pp086rs@hzvpu.rqh> (raw)
In-Reply-To: <79562def-7954-cd10-0461-3e8292fd8998@gmail.com>

On Sun, 15 Oct 2023, Wolfgang Schuster wrote:

> Csikos Bela schrieb am 15.10.2023 um 15:51:
> > Hello:
> >
> > I would like to make a long numbered itemize list, where the numbers
> > increase up to three digits.
> > I would like the numbered labels aligned to the right and the widest
> > label's left side located at the left margin.
> > I tried the below code but the 3 digit labels' left sides go into the left
> > margin. How can I fix it?
> >
> > Code:
> >
> > \showframe
> > \starttext
> > \startitemize[n,broad][itemalign=flushright]
> > \dorecurse{250}{\item aaaa}
> > \stopitemize
> > \stoptext
> 
> You can use the width-key to set a value for the number, below is a example
> for method
> to calculate the width based on the number of items but I would use fixed
> value
> (e.g. width=2em) to let all items (independent of the entries) start on the
> same position.

I normally use the `fit` key with an appropriate value of `distance`. For example:

\showframe[text][text]

\starttext

\startitemize[n,fit,broad][distance=0.25em,itemalign=flushright]
\dorecurse{1}{\startitem xxx\stopitem}
\stopitemize

\page

\startitemize[n,fit,broad][distance=0.25em,itemalign=flushright]
\dorecurse{11}{\startitem xxx\stopitem}
\stopitemize

\page

\startitemize[n,fit,broad][distance=0.25em,itemalign=flushright]
\dorecurse{111}{\startitem xxx\stopitem}
\stopitemize

\stoptext

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-10-15 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-15 13:51 [NTG-context] " Csikos Bela
2023-10-15 15:32 ` [NTG-context] " Pablo Rodriguez
2023-10-15 20:14 ` Wolfgang Schuster
2023-10-15 20:32   ` Aditya Mahajan [this message]
2023-10-19 20:22     ` Csikos Bela

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=sps3s207-4o86-7952-9s62-82431pp086rs@hzvpu.rqh \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /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).