From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73894 Path: news.gmane.org!not-for-mail From: Felix Ingram Newsgroups: gmane.comp.tex.context Subject: Re: Setting structureuservariable Date: Mon, 16 Jan 2012 13:07:25 +0000 Message-ID: References: <4F1415E7.7060205@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1326719268 735 80.91.229.12 (16 Jan 2012 13:07:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2012 13:07:48 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 16 14:07:44 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RmmHn-0005ND-V9 for gctc-ntg-context-518@m.gmane.org; Mon, 16 Jan 2012 14:07:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 31BB7CB1EF; Mon, 16 Jan 2012 14:07:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AFftSq63pxXf; Mon, 16 Jan 2012 14:07:36 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E35A3CB1EA; Mon, 16 Jan 2012 14:07:36 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 50AC0CB1EA for ; Mon, 16 Jan 2012 14:07:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RPYkC5J6WvRd for ; Mon, 16 Jan 2012 14:07:28 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id F0A95CB1E7 for ; Mon, 16 Jan 2012 14:07:27 +0100 (CET) Original-Received: from mail-vx0-f169.google.com (mail-vx0-f169.google.com [209.85.220.169]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q0GD7QBS009266 for ; Mon, 16 Jan 2012 14:07:26 +0100 Original-Received: by vcdn13 with SMTP id n13so242707vcd.14 for ; Mon, 16 Jan 2012 05:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PoG9B8wKCEWnlnCIbiG01W5lqsJ4WGw03qwgkZ8bQhw=; b=fyRPMSZvJoO7P3QLAYdfmzqRQyfBQ6qQVgijNOVNKCpdsptR7y96bekr9b81nqRIVd KetU065D0aDA1jLLGNKLUNqgZpJM/7hcJlquyG+BA0zsfnjBJibnIz1mIBL/FtaUBfWH ITkgHkJaIjiAnG31ccpJwrcuzZCgGCIJ4TPUg= Original-Received: by 10.52.98.136 with SMTP id ei8mr6236856vdb.73.1326719245730; Mon, 16 Jan 2012 05:07:25 -0800 (PST) Original-Received: by 10.52.184.193 with HTTP; Mon, 16 Jan 2012 05:07:25 -0800 (PST) In-Reply-To: <4F1415E7.7060205@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.220.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0cGmd7qqp - 724fe8fa59fb - 20120116 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:73894 Archived-At: >> 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 ___________________________________________________________________________________