ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Wolfgang Schuster" <schuster.wolfgang@googlemail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: Reference to a subitem
Date: Thu, 23 Oct 2008 09:22:32 +0200	[thread overview]
Message-ID: <115224fb0810230022x413a048dl90db8d24ca6bb00b@mail.gmail.com> (raw)
In-Reply-To: <83e5fb980810221555k3e24caben36af44d360cf9207@mail.gmail.com>

On Thu, Oct 23, 2008 at 12:55 AM, Diego Depaoli <trebestie@gmail.com> wrote:
> Hi all,
> referencing a subitem I get also the item (1.a, 2.c and so on).
> Can I split them or get only the subitem?
>
> \starttext
> \startitemize [n]
> \item [number] one
> \startitemize  [a]
> \item [letter] letter
> \stopitemize
> \stopitemize
> Look at number \in[number] letter \in[letter]
> \stoptext
>
> Normal output:
> Look at number 1 letter 1.a
>
> Wanted result
> Look at number 1 letter a

\def\ItemNumber#1%
 {\expandafter\doItemNumber#1..\relax}

\def\doItemNumber#1.#2.#3\relax
 {\doifelsenothing{#2}
    {#1}
    {#2}}

\definereferenceformat[initem][left=\ItemNumber]

\starttext
\startitemize[n]
\item[number] one
  \startitemize  [a]
  \item[letter] letter
  \stopitemize
\stopitemize
Look at \initem{number}[number] \initem{letter}[letter]
\stoptext

Regards,
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2008-10-23  7:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22 22:55 Diego Depaoli
2008-10-23  7:22 ` Wolfgang Schuster [this message]
2008-10-23  9:58   ` Diego Depaoli
2008-10-25  0:58   ` Diego Depaoli
2008-10-25  7:07     ` Marcin Borkowski
2008-10-27  9:56       ` Wolfgang Schuster
2008-10-28  0:30         ` Marcin Borkowski
2008-10-27 16:24       ` Diego Depaoli
2008-10-27 16:30         ` Diego Depaoli
2008-10-28  0:34         ` Marcin Borkowski
2008-10-25  8:43     ` 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=115224fb0810230022x413a048dl90db8d24ca6bb00b@mail.gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).