ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Felix Ingram <f.ingram.lists@gmail.com>
To: Hans Hagen <pragma@wxs.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Setting structureuservariable
Date: Mon, 16 Jan 2012 13:07:25 +0000	[thread overview]
Message-ID: <CAK5aKC-0c--hZC8t8ZkbPuwwjd7GmotsmX7wzT2nvda69NwF-g@mail.gmail.com> (raw)
In-Reply-To: <4F1415E7.7060205@wxs.nl>

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


  reply	other threads:[~2012-01-16 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16 11:39 Felix Ingram
2012-01-16 12:19 ` Hans Hagen
2012-01-16 13:07   ` Felix Ingram [this message]
2013-10-20 22:58   ` Peter Münster
2013-10-21 12:10     ` Hans Hagen
2012-01-16 12:22 ` Wolfgang Schuster

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=CAK5aKC-0c--hZC8t8ZkbPuwwjd7GmotsmX7wzT2nvda69NwF-g@mail.gmail.com \
    --to=f.ingram.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.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).