ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Synonyms - feature request?
@ 2015-03-25 10:24 Robin.Kirkham
  2015-04-15 15:22 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Robin.Kirkham @ 2015-03-25 10:24 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Synonyms - feature request?
  2015-03-25 10:24 Synonyms - feature request? Robin.Kirkham
@ 2015-04-15 15:22 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2015-04-15 15:22 UTC (permalink / raw)
  To: ntg-context

On 3/25/2015 11:24 AM, Robin.Kirkham@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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-15 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 10:24 Synonyms - feature request? Robin.Kirkham
2015-04-15 15:22 ` Hans Hagen

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).