Re: [NTG-context] Synonyms feature request

2021-11-12 Thread Hans Hagen via ntg-context

On 11/12/2021 4:22 AM, Rik Kabel via ntg-context wrote:

Hello developers,

Is it possible to get a mechanism to reset and setup synonyms by way 
(page, part, chapter, section, ...)?


This is not a high-priority request.

I currently accomplish this in the after key of chapter setuphead 
definitions. However, it seems cleaner to define it when the synonym 
list is defined instead of adding a resetshownsynonyms and setsynonyms 
to the chapter definition for every new synonym list.

I'll send you something to test (these are the relative easy things ...)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] Synonyms feature request

2021-11-11 Thread Rik Kabel via ntg-context

Hello developers,

Is it possible to get a mechanism to reset and setup synonyms by way 
(page, part, chapter, section, ...)?


This is not a high-priority request.

I currently accomplish this in the after key of chapter setuphead 
definitions. However, it seems cleaner to define it when the synonym 
list is defined instead of adding a resetshownsynonyms and setsynonyms 
to the chapter definition for every new synonym list.


--
Rik

___
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] Synonyms - feature request?

2015-04-15 Thread Hans Hagen

On 3/25/2015 11:24 AM, robin.kirk...@csiro.au wrote:

Folks,

I use the synonym feature heavily as technical documents can have hundreds of 
them. It’s great I can produce a list of synonyms I actually use in a document. 
Proper style however requires that each synonym be “explained” (shown in full) 
the first time it is used — usually in a document, but sometimes in a smaller 
scope, like a part or chapter. This is something I frequently get wrong, and is 
something document reviewers are quick to complain about.

So it would be great if Context could do this automatically. The attached MWE 
shows what I mean — with such a feature, the two paragraphs should come out the 
same.

I’ve placed some (commented) guesses as to how this might be configured in 
\setupsynonyms. Maybe better key names can be imagined.

Typically I would want synonym \XX\ to be expanded to XX (Xxx Xxx) the first 
time it is used (alternative a), but the reverse (alternative b), Xxx Xxx (XX) 
might be preferred. However a command could be used for a custom “explanation”.

Internally to Context, I guess this means each group of synonyms actually used 
has to be complemented with a list of the synonyms that have been “explained” 
(i.e., \infull{}) would add them to this second list). The second list would be 
cleared each new scope (chapter, section). The \XX\ macro would explain the 
synonym if it wasn’t on the second list (using \infull{}, which would then add 
it).

None of this would change the behaviour of \placelistof… where you would 
continue to select the criterium for the list you want output, independently of

The only further tweak might be a scheme so that certain common synonyms (a 
third list) are never explained automatically (perhaps by example, UK in a 
document written in and for a UK audience). This list would silently added to 
the second list immediately after it was cleared, I guess. Synonyms for this 
this list would be added by a slightly different version of the
synonym definition macro (perhaps \commonabbreviation instead of \abbreviation, 
in the MWE).

Anyone think this would be a useful feature addition?

Robin


\definesynonyms[abbreviation][abbreviations][\infull]
\setupsynonyms[abbreviation][
 state=start,
%explain=first,% first,always,never
%explainscope=text,% text,part,chapter,section...
%explainalternative=a, % a: XX (Xxx Xxx), b: Xxx Xxx (XX), command
%explaincommand=COMMAND#1#2,   % to format it yourself
 textstyle=normal,
 synonymstyle=\cap]

\abbreviation [UN]  {UN}  {United Nations}
\abbreviation [UK]  {UK}  {United Kingdom}
\abbreviation [USA] {USA} {United States of America}
\abbreviation [UAE] {UAE} {United Arab Emirates}

%\commonabbreviation [OK] {OK} {okay}
\abbreviation [OK] {OK} {okay}

\setupwhitespace[medium]

\starttext
The \UK\ and the \USA\ are both founding members of the \UN.
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

The \UK\ (\infull{UK}) and the \USA\ (\infull{USA}) are both founding
members of the \UN\ (\infull{UN}).
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

\placelistofabbreviations
\stoptext


The next beta has enough to get you going (lightweight extensions):

\definesynonyms
  [myabbreviation]

\setupsynonyms
  [myabbreviation]
  [headstyle=bold,
   headcolor=darkred,
   synonymstyle=boldslanted,
   synonymcolor=darkblue,
   textstyle=slanted,
   textcolor=darkgreen,
   style=normal,
   color=darkyellow]

\definesorting
  [mylogo]

\setupsorting
  [mylogo]
  [style=bold,
   color=darkmagenta]

\myabbreviation [FIRST]  {TheFirst}  {The First Words}
\myabbreviation [SECOND] {TheSecond} {The Second Words}
\myabbreviation [THIRD]  {TheThird}  {The Third Words}

\mylogo [FOURTH] {TheFourth}

\starttext

\setupsynonyms[myabbreviation][alternative=first]

We have \FIRST, \SECOND\ and also \THIRD\ but no \FOURTH.

We have \FIRST, \SECOND\ and also \THIRD\ but no \FOURTH.

\resetshownsynonyms[myabbreviation]

\setupsynonyms[myabbreviation][alternative=last]

We have \FIRST\ and \THIRD\ or \FOURTH.

We have \FIRST\ and \THIRD\ or \FOURTH.

\placelistofsynonyms[myabbreviation]

\placelistofsorts[mylogo]




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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  : 

[NTG-context] Synonyms - feature request?

2015-03-25 Thread Robin.Kirkham
Folks,

I use the synonym feature heavily as technical documents can have hundreds of 
them. It’s great I can produce a list of synonyms I actually use in a document. 
Proper style however requires that each synonym be “explained” (shown in full) 
the first time it is used — usually in a document, but sometimes in a smaller 
scope, like a part or chapter. This is something I frequently get wrong, and is 
something document reviewers are quick to complain about.

So it would be great if Context could do this automatically. The attached MWE 
shows what I mean — with such a feature, the two paragraphs should come out the 
same.

I’ve placed some (commented) guesses as to how this might be configured in 
\setupsynonyms. Maybe better key names can be imagined.

Typically I would want synonym \XX\ to be expanded to XX (Xxx Xxx) the first 
time it is used (alternative a), but the reverse (alternative b), Xxx Xxx (XX) 
might be preferred. However a command could be used for a custom “explanation”.

Internally to Context, I guess this means each group of synonyms actually used 
has to be complemented with a list of the synonyms that have been “explained” 
(i.e., \infull{}) would add them to this second list). The second list would be 
cleared each new scope (chapter, section). The \XX\ macro would explain the 
synonym if it wasn’t on the second list (using \infull{}, which would then add 
it).

None of this would change the behaviour of \placelistof… where you would 
continue to select the criterium for the list you want output, independently of 

The only further tweak might be a scheme so that certain common synonyms (a 
third list) are never explained automatically (perhaps by example, UK in a 
document written in and for a UK audience). This list would silently added to 
the second list immediately after it was cleared, I guess. Synonyms for this 
this list would be added by a slightly different version of the
synonym definition macro (perhaps \commonabbreviation instead of \abbreviation, 
in the MWE).

Anyone think this would be a useful feature addition?

Robin


\definesynonyms[abbreviation][abbreviations][\infull]
\setupsynonyms[abbreviation][
state=start,
%explain=first,% first,always,never
%explainscope=text,% text,part,chapter,section...
%explainalternative=a, % a: XX (Xxx Xxx), b: Xxx Xxx (XX), command
%explaincommand=COMMAND#1#2,   % to format it yourself
textstyle=normal,
synonymstyle=\cap]

\abbreviation [UN]  {UN}  {United Nations}
\abbreviation [UK]  {UK}  {United Kingdom}
\abbreviation [USA] {USA} {United States of America}
\abbreviation [UAE] {UAE} {United Arab Emirates}

%\commonabbreviation [OK] {OK} {okay}
\abbreviation [OK] {OK} {okay}

\setupwhitespace[medium]

\starttext
The \UK\ and the \USA\ are both founding members of the \UN.
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

The \UK\ (\infull{UK}) and the \USA\ (\infull{USA}) are both founding
members of the \UN\ (\infull{UN}).
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

\placelistofabbreviations
\stoptext
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___