ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Synonyms and criterium
@ 2014-04-27 19:12 Chris Kennedy (ConTeXt List)
  2014-04-28  7:56 ` Thangalin
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Kennedy (ConTeXt List) @ 2014-04-27 19:12 UTC (permalink / raw)
  To: ntg-context

Hello,

I have a multiple component document that uses \definesynonym. If I build
a single component then \placelistofsynonyms with a criterium of "used"
performs as expected. But when I run the whole project each
\placelistof... displays the list of synonyms used in the entire document.
I need to have a common file of synonyms, and place the list of just those
used in each chapter, not the entire document.

From what I can tell from the source code, \placelistof... can only show
all or used. It does not have a criterium of "chapter" or a reset command
available.  So what can I do?

(I know you prefer a minimal example, but that would require at least
three files, and I'm typing on my tablet, which is very slow.)


Thanks.

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


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

* Re: Synonyms and criterium
  2014-04-27 19:12 Synonyms and criterium Chris Kennedy (ConTeXt List)
@ 2014-04-28  7:56 ` Thangalin
  2014-04-28 13:27   ` Chris Kennedy (ConTeXt List)
  0 siblings, 1 reply; 5+ messages in thread
From: Thangalin @ 2014-04-28  7:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: Synonyms and criterium
  2014-04-28  7:56 ` Thangalin
@ 2014-04-28 13:27   ` Chris Kennedy (ConTeXt List)
  2014-04-28 14:03     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Kennedy (ConTeXt List) @ 2014-04-28 13:27 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


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

* Re: Synonyms and criterium
  2014-04-28 13:27   ` Chris Kennedy (ConTeXt List)
@ 2014-04-28 14:03     ` Hans Hagen
  2014-04-28 15:29       ` Chris Kennedy (ConTeXt List)
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2014-04-28 14:03 UTC (permalink / raw)
  To: ntg-context

On 4/28/2014 3:27 PM, Chris Kennedy (ConTeXt List) wrote:

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

it should nto be too hard to define a macro that combines abbreviations 
with lists or registers as these can be filtered per chapter. I have no 
time now to demo this.

Hans

-----------------------------------------------------------------
                                           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] 5+ messages in thread

* Re: Synonyms and criterium
  2014-04-28 14:03     ` Hans Hagen
@ 2014-04-28 15:29       ` Chris Kennedy (ConTeXt List)
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Kennedy (ConTeXt List) @ 2014-04-28 15:29 UTC (permalink / raw)
  To: ntg-context


On Mon, April 28, 2014 07:03, Hans Hagen wrote:
> On 4/28/2014 3:27 PM, Chris Kennedy (ConTeXt List) wrote:
>
>> 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.
>
> it should nto be too hard to define a macro that combines abbreviations
> with lists or registers as these can be filtered per chapter. I have no
> time now to demo this.
>
> Hans
>

Thank you.  That gives me a place to start.  I'll let you know if I have
any problems.  I'll also post what I come up with.

Thanks.



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


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

end of thread, other threads:[~2014-04-28 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-27 19:12 Synonyms and criterium Chris Kennedy (ConTeXt List)
2014-04-28  7:56 ` Thangalin
2014-04-28 13:27   ` Chris Kennedy (ConTeXt List)
2014-04-28 14:03     ` Hans Hagen
2014-04-28 15:29       ` Chris Kennedy (ConTeXt List)

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