ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@MIT.EDU>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: defineitemgroup interferes with item reference
Date: Sat, 03 May 2008 09:24:59 -0400	[thread overview]
Message-ID: <E1JsHjX-00024e-Kl@approx.mit.edu> (raw)
In-Reply-To: Your message of "Fri, 02 May 2008 15:35:25 +0200." <481B189D.1040009@wxs.nl> (sfid-20080502_094034_092540_9547A2BB)

Hans Hagen <pragma@wxs.nl> wrote:

> itemgroups cannot be miced

Though there's no problem without those references in [brackets], so the
mixing works most of the time anyway.

> this catches it

Thanks!  With two small changes, your definition makes the mixing work
even when using references.  The two changes: (1) the macro needed a
closing brace, and (2) there's no \currentitemlevel in any context
source file so I guessed that \itemlevel was the intention.  So:

\def\dostartitemgroup[#1][#2][#3]%
   {\bgroup
    \ifnum\itemlevel=\zerocount
      \def\currentitemgroup{#1}% no nested mixing of itemgroups
    \fi
    \ifthirdargument
      \dodostartitemgroup[#2][#3]%
    \else
      \doifassignmentelse{#2}
        {\dodostartitemgroup[][#2]}
        {\dodostartitemgroup[#2][]}%
}

Is this macro worth putting into the official distribution or is it a
special hack to keep with my documents that need it?

-Sanjoy

`Until lions have their historians, tales of the hunt shall always
 glorify the hunters.'  --African Proverb
___________________________________________________________________________________
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-05-03 13:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02  1:23 Sanjoy Mahajan
2008-05-02 13:35 ` Hans Hagen
2008-05-03 13:24   ` Sanjoy Mahajan [this message]
2008-05-03 18:12     ` Aditya Mahajan
2008-05-03 19:33       ` Sanjoy Mahajan

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=E1JsHjX-00024e-Kl@approx.mit.edu \
    --to=sanjoy@mit.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).