ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: <Robin.Kirkham@csiro.au>
To: <ntg-context@ntg.nl>
Subject: Synonyms - feature request?
Date: Wed, 25 Mar 2015 10:24:14 +0000	[thread overview]
Message-ID: <C2450E3A-E026-4D6D-8F58-E49B8735B977@csiro.au> (raw)

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
___________________________________________________________________________________

             reply	other threads:[~2015-03-25 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 10:24 Robin.Kirkham [this message]
2015-04-15 15:22 ` Hans Hagen

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=C2450E3A-E026-4D6D-8F58-E49B8735B977@csiro.au \
    --to=robin.kirkham@csiro.au \
    --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).