ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Setting structureuservariable
@ 2012-01-16 11:39 Felix Ingram
  2012-01-16 12:19 ` Hans Hagen
  2012-01-16 12:22 ` Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: Felix Ingram @ 2012-01-16 11:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Many thanks in advance,

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
___________________________________________________________________________________


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

* Re: Setting structureuservariable
  2012-01-16 11:39 Setting structureuservariable Felix Ingram
@ 2012-01-16 12:19 ` Hans Hagen
  2012-01-16 13:07   ` Felix Ingram
  2013-10-20 22:58   ` Peter Münster
  2012-01-16 12:22 ` Wolfgang Schuster
  1 sibling, 2 replies; 6+ messages in thread
From: Hans Hagen @ 2012-01-16 12:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Felix Ingram

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
___________________________________________________________________________________


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

* Re: Setting structureuservariable
  2012-01-16 11:39 Setting structureuservariable Felix Ingram
  2012-01-16 12:19 ` Hans Hagen
@ 2012-01-16 12:22 ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2012-01-16 12:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: Setting structureuservariable
  2012-01-16 12:19 ` Hans Hagen
@ 2012-01-16 13:07   ` Felix Ingram
  2013-10-20 22:58   ` Peter Münster
  1 sibling, 0 replies; 6+ messages in thread
From: Felix Ingram @ 2012-01-16 13:07 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

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


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

* Re: Setting structureuservariable
  2012-01-16 12:19 ` Hans Hagen
  2012-01-16 13:07   ` Felix Ingram
@ 2013-10-20 22:58   ` Peter Münster
  2013-10-21 12:10     ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Münster @ 2013-10-20 22:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: Setting structureuservariable
  2013-10-20 22:58   ` Peter Münster
@ 2013-10-21 12:10     ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2013-10-21 12:10 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


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

end of thread, other threads:[~2013-10-21 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 11:39 Setting structureuservariable Felix Ingram
2012-01-16 12:19 ` Hans Hagen
2012-01-16 13:07   ` Felix Ingram
2013-10-20 22:58   ` Peter Münster
2013-10-21 12:10     ` Hans Hagen
2012-01-16 12:22 ` Wolfgang Schuster

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