From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/32064 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: reference to \starttyping Date: Fri, 8 Dec 2006 20:42:20 -0500 (EST) Message-ID: References: <7c8b0aeecb85cfb869fae62a938f7eb9@di.unito.it> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165628820 32118 80.91.229.10 (9 Dec 2006 01:47:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 01:47:00 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 09 02:46:59 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by dough.gmane.org with esmtp (Exim 4.50) id 1GsrIo-0001tI-Kw for gctc-ntg-context-518@m.gmane.org; Sat, 09 Dec 2006 02:46:58 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 085401FF9D; Sat, 9 Dec 2006 02:43:56 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05957-01; Sat, 9 Dec 2006 02:43:53 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7893D1FF90; Sat, 9 Dec 2006 02:39:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 863811FF94 for ; Sat, 9 Dec 2006 02:39:26 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04072-03-4 for ; Sat, 9 Dec 2006 02:39:22 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with SMTP id D89DC1FF71 for ; Sat, 9 Dec 2006 02:39:19 +0100 (CET) Original-Received: FROM aditya.engin.umich.edu (udhcp-wlan41.public.engin.umich.edu [141.213.120.51]) BY hackers.mr.itd.umich.edu ID 457A147C.9BC7.9360 ; 8 Dec 2006 20:42:20 -0500 Original-To: mailing list for ConTeXt users In-Reply-To: <7c8b0aeecb85cfb869fae62a938f7eb9@di.unito.it> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:32064 Archived-At: On Sat, 9 Dec 2006, andrea valle wrote: > Hi to all, > > I'm typesetting a manual for a programming language. I'm inserting long > excerpts from code and I have my nice line numbers as explained by the > wiki. > Code is inserted using \startcode\stopcode mechanism (I have two type > of starttyping). > I cannot understand how to refer to these code blocks. I mean, I need > to have something like this: "in the code at page xxx, ...". > I guess it's simple but seems I cannot solve. Add \pagereference[tag] before (or include it as part of the macro) \startcode. Then you can refer to it by \at[tag] There is also \textreference and \reference. From core-ref.tex %D This module deals with referencing. In \CONTEXT\ referencing %D is one of the core features, although at a first glance %D probably nobody will notice. This is good, because %D referencing should be as hidden as possible. %D %D In paper documents, referencing comes down to cross %D referencing, but in their interactive counterparts, is also %D involves navigation. Many features implemented here are %D therefore closely related to navigation. %D %D Many \CONTEXT\ commands can optionally be fed with a %D reference. Such a reference, when called upon, returns the %D number of a figure, table, chapter etc, a piece of text, or %D a pagenumber. %D %D There are three ways of defining a reference: %D %D \starttyping %D \pagereference[here] %D \textreference[here]{some text} %D \stoptyping %D %D the third alternative combines them in: %D %D \starttyping %D \reference[here]{some text} %D \stoptyping HTH, Aditya