ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Kevin Kenan <kevin@kevinkenan.com>
Subject: Re: Using \doifelse to change the itemization symbol in specific cases
Date: Sat, 25 Apr 2020 23:11:25 +0200	[thread overview]
Message-ID: <4c60d500-56f1-7b89-95ea-0473d6040ba8@gmail.com> (raw)
In-Reply-To: <3BF02C5C-FDE8-4D8A-836C-B11025C37511@kevinkenan.com>

Kevin Kenan schrieb am 25.04.2020 um 21:24:
> I’m trying to create a conditional that changes the symbol used for certain item numbers. Here’s my code that doesn’t work.
> 
> \define[1]\StepsCommand{\doifelse{#1}{2}{k}{#1}\ignorespaces}
> \defineitemgroup[Steps]
> \setupitemgroup[Steps][each][n,packed]
> \setupitemgroup[Steps][each][left=\StepsCommand]
> 
> \starttext
> \startSteps
> \item A
> \item B % the item number should be replaced with 'k'
> \item C
> \stopSteps
> \stoptext
> 
> The second item “B” should have the letter ‘k’ instead of the number “2.” Is this possible?

You can set custom symbols for individual items with \txt but this won't 
increment the item counter. To continue the counter and replace some 
symbol you have to create your own number conversion.

\defineconversion [kevin] [1,k,3,4,5,6,7,8,9]

\starttext

\startitemize[n]
\item A
\txt{k} B
\item C
\stopitemize

\blank[2*line]

\startitemize[kevin]
\item A
\item B
\item C
\stopitemize

\stoptext

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

  reply	other threads:[~2020-04-25 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 19:24 Kevin Kenan
2020-04-25 21:11 ` Wolfgang Schuster [this message]
2020-04-25 21:30   ` Kevin Kenan
2020-04-25 21:34     ` Wolfgang Schuster
2020-04-25 21:36       ` Kevin Kenan

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=4c60d500-56f1-7b89-95ea-0473d6040ba8@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=kevin@kevinkenan.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).