Re: [NTG-context] Using \doifelse to change the itemization symbol in specific cases

2020-04-25 Thread Kevin Kenan
On Apr 25, 2020, at 2:34 PM, Wolfgang Schuster 
 wrote:
> 
> \starttext
> 
> \startitemize[n]
> \item A
> \txt{k} B
> \noitem
> \item C
> \stopitemize
> 
> \stoptext
> 
> Wolfgang


Nice…so many options. :) 

-kk___
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
___


Re: [NTG-context] Using \doifelse to change the itemization symbol in specific cases

2020-04-25 Thread Kevin Kenan
Ah…thanks for the pointer to \definecoversion. Looks promising.

I had also tried:

\defineitemgroup[Steps]
\setupitemgroup[Steps][each][n,packed]

\starttext
\startSteps
\item A
\sym{k} B\incrementnumber[itemgroup:Steps]
\item C 
\stopSteps
\stoptext

Which is similar to your \txt solution and increments the counter.

Thanks again for the help.

-kk



> On Apr 25, 2020, at 2:11 PM, Wolfgang Schuster 
>  wrote:
> 
> 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
___


[NTG-context] Using \doifelse to change the itemization symbol in specific cases

2020-04-25 Thread Kevin Kenan
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?

Thanks,
-kk
___
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
___


Re: [NTG-context] Use a counter in a reference?

2020-04-19 Thread Kevin Kenan
The label mechanism worked great.

Thanks!

-kk

> On Apr 13, 2020, at 1:20 PM, Thomas A. Schmitz  
> wrote:
> 
> On 4/13/20 10:13 PM, Kevin Kenan wrote:
>> I have a need to tag elements in a text in a way that they are sequentially 
>> numbered and can have references to refer to them. Something like:
>> Here is some \tag[tagref]{\bf text} that is tagged.
>> .
>> .
>> .
>> Refer to tag \tagnumber[tagref] on page \at[tagref].
>> What is the best way to do this in ConTeXt? I’ve got a counter for tag 
>> number, but I’m not sure how to use \reference so that it uses my tag 
>> number. For instance:
>> \definecounter[myTagCounter]
>> .
>> .
>> .
>> \reference[tagref]{\rawcountervalue[myTagCounter]}
>> Doesn’t work. But perhaps I’m going about this incorrectly?
>> Thanks in advance!
> 
> Are you looking for this: https://wiki.contextgarden.net/Command/definelabel 
> <https://wiki.contextgarden.net/Command/definelabel> ?
> 
> HTH
> 
> Thomas
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <http://contextgarden.net/>
> ___

___
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
___


[NTG-context] Use a counter in a reference?

2020-04-13 Thread Kevin Kenan
I have a need to tag elements in a text in a way that they are sequentially 
numbered and can have references to refer to them. Something like:


Here is some \tag[tagref]{\bf text} that is tagged.
.
.
.
Refer to tag \tagnumber[tagref] on page \at[tagref].


What is the best way to do this in ConTeXt? I’ve got a counter for tag number, 
but I’m not sure how to use \reference so that it uses my tag number. For 
instance:


\definecounter[myTagCounter]
.
.
.
\reference[tagref]{\rawcountervalue[myTagCounter]}


Doesn’t work. But perhaps I’m going about this incorrectly? 

Thanks in advance!
-kk
___
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
___


Re: [NTG-context] Space between heading and paragraph in a description

2020-02-19 Thread Kevin Kenan

> On Feb 18, 2020, at 7:45 PM, Aditya Mahajan  wrote:
> 
> Add what you discovered to the wiki!

I did…after a fashion. Once I knew the answer, I was able to find a reference 
to it on the wiki. However, it was obscured because both \setupdescription and 
\setupdescriptions are listed and I was reading the entry for 
\setupdescriptions which doesn’t list stretch and shrink as parameters. I added 
a note to \setupdescriptions that references \setupdescription. Hopefully that 
will help.

-kk___
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
___


Re: [NTG-context] Space between heading and paragraph in a description

2020-02-18 Thread Kevin Kenan

> On Feb 18, 2020, at 11:50 AM, Wolfgang Schuster 
>  wrote:
> 
> You can always try the list archive, e.g. the same problems was asked last 
> year.
> 
> https://mailman.ntg.nl/pipermail/ntg-context/2019/094735.html 
> 


I had tried searching the archive using a few variations of "heading paragraph 
description” but was unsuccessful in finding the previous answer.

I’m still new to ConTeXt so hopefully I will get better at figuring out what 
the key terms should be when searching.

Thanks again.

-kk



___
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
___


Re: [NTG-context] Space between heading and paragraph in a description

2020-02-18 Thread Kevin Kenan
Perfect. Thank you, Wolfgang.

Is there a way I could have discovered this answer without bothering folks on 
the list?

-kk


> On Feb 18, 2020, at 11:26 AM, Wolfgang Schuster 
>  wrote:
> 
> On Tue, 18 Feb 2020 11:16:58 -0800
> Kevin Kenan  wrote:
> 
>> How can I keep the space between the heading text and the paragraph from 
>> stretching/shrinking in a description? 
>> 
>> MWE that exhibits variable space between the heading (the defined word) and 
>> the paragraph text:
>> 
>> 
>>\definedescription
>>  [definition]
>>  [headstyle=italic,
>>   indenting=1em,
>>   alternative=hanging,
>>   margin=2em,
>>   distance=1.5em,
> 
> stretch=0,
> shrink=0,
> 
>>   width=fit,]
> 
> 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
> ___

___
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
___


[NTG-context] Space between heading and paragraph in a description

2020-02-18 Thread Kevin Kenan
How can I keep the space between the heading text and the paragraph from 
stretching/shrinking in a description? 

MWE that exhibits variable space between the heading (the defined word) and the 
paragraph text:


\definedescription
  [definition]
  [headstyle=italic,
   indenting=1em,
   alternative=hanging,
   margin=2em,
   distance=1.5em,
   width=fit,]

\starttext

\definition{thelongheader} introducing bigwords mid-1990s, humans have taken
an unprecedented step in Earthly annals by introducing not just exotic

\definition{thelongheader} but actually inserting strange and exotic genes
into the base operating systems of individual plants and animals, where
they’re intended to do exactly the same thing: copy themselves, over and 
over.

\definition{thelongheader} Since the late to mid-1990s, humans have taken a
rare step in Earthly annals by introducing not just exotic flora or fauna 
from
one

\stoptext


Thanks,
-kk
___
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
___