From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/29995 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \in Date: Sat, 5 Aug 2006 00:10:23 -0400 (EDT) Message-ID: References: <44D3E9EA.6010304@nibua-r.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1154751163 24356 80.91.229.2 (5 Aug 2006 04:12:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 5 Aug 2006 04:12:43 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 05 06:12:41 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 ciao.gmane.org with esmtp (Exim 4.43) id 1G9DWh-0007CE-Ly for gctc-ntg-context-518@m.gmane.org; Sat, 05 Aug 2006 06:12:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4051B1FF5A; Sat, 5 Aug 2006 06:12:39 +0200 (CEST) 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 24210-01; Sat, 5 Aug 2006 06:12:39 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D503E1FF5F; Sat, 5 Aug 2006 06:10:33 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CA01C1FF5F for ; Sat, 5 Aug 2006 06:10:31 +0200 (CEST) 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 23914-03-3 for ; Sat, 5 Aug 2006 06:10:27 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by ronja.ntg.nl (Postfix) with SMTP id CA61A1FF5C for ; Sat, 5 Aug 2006 06:10:26 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY tombraider.mr.itd.umich.edu ID 44D41A30.2C9C7.25674 ; 5 Aug 2006 00:10:25 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: <44D3E9EA.6010304@nibua-r.org> 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:29995 Archived-At: On Sat, 5 Aug 2006, Renaud AUBIN wrote: > Hi all, > > Is that possible to setup the \in command to obtain: > - \in[fig:fig_ref] returns figure 1.1 > - \in[eq:eq_ref] returns (1.1) > _ \in[sec:sec_ref] returns section 2.1 > > Up to now I have used: > - \in{figure}[fig:fig_ref] > - \in{(}{)}[eq_eq_ref] (but there is an extra h space just after "(" ) > - \in{section}[sec_sec_ref] Here is a very simple mechanism, I do not take care of all the bells and whistles [1] of \in. \def\myin[#1:#2]{ \expandafter\ifx\csname in#1\endcsname\relax \writestatus{warning}{referenceformat in#1 not defined} \in[#1:#2] \else \csname in#1\endcsname[#1:#2] \fi} \definereferenceformat[insec][text=Section] \starttext \section[sec:one]{One} \placeformula[eq:1]\startformula a = b \stopformula What happens in \myin[sec:one] equation \myin[eq:1]. \definereferenceformat[ineq][left=(,right=)] What happens in \myin[sec:one] equation \myin[eq:1]. \stoptext [1] Remember that \in is a very complex command. You can use \in section [sec:one] instead of \in{section}[sec:one] and also do subnumbering. > Moreover, how could I set the face of the output ? I do not know how. You can abuse left, right options to do this, but I think that there is a better way. Aditya