Re: [NTG-context] Setting structureuservariable

2013-10-21 Thread Peter Münster
On Mon, Jan 16 2012, Hans Hagen wrote:

 2. Is there a way to provide a default value for a
 structureuservariable? I'd like to set a reference number based on a
 global counter if the user doesn't supply their own.

 Currently not ... but I can add it.

Have you added it?  If yes, how can we use it please?

TIA,
-- 
   Peter
___
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
___


Re: [NTG-context] Setting structureuservariable

2013-10-21 Thread Hans Hagen

On 10/21/2013 7:58 AM, Peter Münster wrote:

On Mon, Jan 16 2012, Hans Hagen wrote:


2. Is there a way to provide a default value for a
structureuservariable? I'd like to set a reference number based on a
global counter if the user doesn't supply their own.


Currently not ... but I can add it.


Have you added it?  If yes, how can we use it please?


not added

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
___


Re: [NTG-context] Setting structureuservariable

2012-01-16 Thread Hans Hagen

On 16-1-2012 12:39, Felix Ingram wrote:

Hello all,

I've discovered the magic of structureuservariabl and have therefore
converted all my headings to use the start/stop syntax. It's raised a
few quick questions though:

1. Is \startchapter \stopchapter etc the proper way to do things
from now on? Or is it really just up to the user?


Indeed it is ... however, there are cases where the old method is still 
handy, for instance when processing unstructured xml (take xhtml: h is 
just a chapter title then and not structure at all).



2. Is there a way to provide a default value for a
structureuservariable? I'd like to set a reference number based on a
global counter if the user doesn't supply their own.


Currently not ... but I can add it.


3. In a similar vein - is it possible to define a reference for a
section if the user doesn't provide one. E.g. if they provide

\startchapter[title=My Example Chapter]

instead of:

\startchapter[chap:examplechapter][title=My Example Chapter]



\startchapter[reference=chap:examplechapter,title=My Example Chapter]


can I set the reference for them? (I will have some sections that
could be usefully auto-referenced).


how would you refer to such auto reference?

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


Re: [NTG-context] Setting structureuservariable

2012-01-16 Thread Wolfgang Schuster

Am 16.01.2012 um 12:39 schrieb Felix Ingram:

 Hello all,
 
 I've discovered the magic of structureuservariabl and have therefore
 converted all my headings to use the start/stop syntax. It's raised a
 few quick questions though:
 
 1. Is \startchapter \stopchapter etc the proper way to do things
 from now on? Or is it really just up to the user?

You can use either \chapter or \startchapter nut the second
form is better when you want to set different texts for the heading
and the table of contents or the headers, bookmarks etc.

 2. Is there a way to provide a default value for a
 structureuservariable? I'd like to set a reference number based on a
 global counter if the user doesn't supply their own.
 3. In a similar vein - is it possible to define a reference for a
 section if the user doesn't provide one. E.g. if they provide
 
 \startchapter[title=My Example Chapter]
 
 instead of:
 
 \startchapter[chap:examplechapter][title=My Example Chapter]
 
 can I set the reference for them? (I will have some sections that
 could be usefully auto-referenced).

When you use \startchapter references are set with 
\startchapter[reference=…,title=…].

Wolfgang
___
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
___


Re: [NTG-context] Setting structureuservariable

2012-01-16 Thread Felix Ingram
 2. Is there a way to provide a default value for a
 structureuservariable? I'd like to set a reference number based on a
 global counter if the user doesn't supply their own.

 Currently not ... but I can add it.

I'm assuming I could poke a value in using Lua. Would be nice to have
but not a big deal for the time being.

 3. In a similar vein - is it possible to define a reference for a
 section if the user doesn't provide one. E.g. if they provide

 \startchapter[title=My Example Chapter]

 instead of:

 \startchapter[chap:examplechapter][title=My Example Chapter]


 \startchapter[reference=chap:examplechapter,title=My Example Chapter]
 can I set the reference for them? (I will have some sections that
 could be usefully auto-referenced).

 how would you refer to such auto reference?

My report will have a number of findings. I want to give each of these
a unique reference number based on a project identifier (set by the
user as a global variable) plus a sequential number coming from a
counter. In the vast majority of cases the user shouldn't be concerned
with having to define these themselves. I'd like them to exist as
uservariables and proper references so that they could be referred to
if required. I'd only be using the references when looping through all
of the findings, so I could reconstruct the reference value as I
looped.

At the moment I'm doing this hack to get a clickable reference to a
finding in my summary table:

for k, v in ipairs(structures.lists.collected) do
...
context.bTD()

context(\\goto{..(v.references.realpage-2)..}[page(..v.references.realpage..)])
context.eTD()

In thinking it through, however, I suppose that if the user is going
to be referring to the findings themselves then they should just
define their own reference and use that. I just wanted to use proper
references for any parts I was auto-generating. I'll stick with my
hack for the time being.

Many thanks,

Felix
___
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
___