ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Chris Kennedy (ConTeXt List)" <ckennedy+context@dragonbard.com>
To: ntg-context@ntg.nl
Subject: Re: Synonyms and criterium
Date: Mon, 28 Apr 2014 06:27:13 -0700	[thread overview]
Message-ID: <38250a59eae68a7cc696dd0b40f0fbf4.squirrel@webmail.dragonbard.com> (raw)
In-Reply-To: <CAANrE7rObQdSNWVSAPf7dXfgeQA=O7RuxKngNyg15LAQiYEYww@mail.gmail.com>

I appreciate what you are saying in regards to examples, but in this case
I have looked at the source code and a minimal example wouldn't be of
assistance.  But since you insist...

%Warning, don't have context or source files on current computer, so this
is from memory
%Expect bugs.
\definesynonym[Define][Defines][\fullDefine]

\setupDefines[criterium=used]

\Define[defa]{Def A}{Full definition of A. Used in Chapter 1.}
\Define[defb]{Def B}{Full definition of B. Used in Chapter 2.}
\Define[defc]{Def C}{Full definition of C. Used in Chapter 2.}
\Define[defu]{Def U}{This definition is not used at all.}

\starttext

\startchapter[title={One}]

\placelistofDefines[width=fit,align=serried] %will show all used in
document, want only those used in chapter.

Here we are looking at \defa.

\stopchapter

\startchapter[title={Two}]

\placelistofDefines[width=fit,align=serried] %only want those used in this
chapter, will show defa as well.

Here we are discussing \defb\ and \defc.

\stopchapter

\stoptext


I'm good enough with TeX and Lua to understand what is going on, but not
good enough to patch it.  The usage model for synonyms is either all
defined, or all used in the entire document, not just those per chapter. 
The Lua code only tracks whether a synonym was used at any point within
the run, it has only one counter.  I need to differentiate between
synonyms used by chapter.

In this case, synonyms are simply missing the feature I want.  I'm asking
for alternatives that allow me to use a predefined list of "synonym like"
definitions that are common for the entire document, but per chapter only
place a list of those that are used within that chapter, like when you
place an in-chapter table of contents.

Basically I'm asking for direction on where to look next, since the
current definition of synonyms will not do what I need.  I'm hoping I have
overlooked some other feature that will let me do what I need to do.  If
not, guess I will have to get programming.

I updated context last week to current using the procedure on contextgarden.


Thanks.


On Mon, April 28, 2014 00:56, Thangalin wrote:
> A couple of reasons for minimal examples: having an isolated issue is
> easier to debug and in the process of simplifying the code you might
> stumble on the solution yourself.
>
> For example, I have a book that uses dozens of files. When I encounter
> an issue, I concatenate the files and then start chopping out chunks
> that don't affect the output. Eventually I get down to a minimal
> example that allows me to further research the issue. If I get stuck,
> then I post the problem.
>
> It's time-consuming but you can't assume people will dedicate the time
> to replicate issues based on descriptions... :-) Try to whittle down a
> minimal example that illustrates the problem.
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 
Chris Kennedy


___________________________________________________________________________________
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:[~2014-04-28 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27 19:12 Chris Kennedy (ConTeXt List)
2014-04-28  7:56 ` Thangalin
2014-04-28 13:27   ` Chris Kennedy (ConTeXt List) [this message]
2014-04-28 14:03     ` Hans Hagen
2014-04-28 15:29       ` Chris Kennedy (ConTeXt List)

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=38250a59eae68a7cc696dd0b40f0fbf4.squirrel@webmail.dragonbard.com \
    --to=ckennedy+context@dragonbard.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).