From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30078 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: adding an icon (flushed left) in a displayed formula with equation number Date: Mon, 7 Aug 2006 11:40:57 -0400 (EDT) Message-ID: References: <44D71576.7060203@elvenkind.com> 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 1154965312 19894 80.91.229.2 (7 Aug 2006 15:41:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2006 15:41:52 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 07 17:41:50 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 1GA7EH-00044L-Ai for gctc-ntg-context-518@m.gmane.org; Mon, 07 Aug 2006 17:41:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E3FE11FCFF; Mon, 7 Aug 2006 17:41:20 +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 25508-01; Mon, 7 Aug 2006 17:41:12 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0E1631FCE9; Mon, 7 Aug 2006 17:41:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D04AE1FCE9 for ; Mon, 7 Aug 2006 17:41:09 +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 25073-05 for ; Mon, 7 Aug 2006 17:41:04 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with SMTP id EA7741FCE4 for ; Mon, 7 Aug 2006 17:41:01 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY hackers.mr.itd.umich.edu ID 44D75F0B.3AECF.19989 ; 7 Aug 2006 11:41:00 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: <44D71576.7060203@elvenkind.com> 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:30078 Archived-At: On Mon, 7 Aug 2006, Taco Hoekwater wrote: > > David Arnold wrote: >> All, >> >> We have: >> >> \placeformula[eq:commonb] >> \startformula >> (1)^2+(\sqrt{4x+13})^2=(2x)^2, >> \stopformula >> >> >> This gives us a centered equation with an number pushed to the right >> edge of the page (I probably should say text area). >> >> What we'd like to do, just in this one example (not globally), is add >> a little "smiley face" icon on the same line as the displayed >> equation and equation number, but pushed to the left edge of the page >> (I probably should say text area). >> >> Possible? > > It should be possible to do this using a special version of \startalign, > but I cannot figure it out. Maybe Aditya can help? Here is one solution. Explaination inline. % I do not know what you want for a smiley, so I use square instead \def\smiley{\square} \starttext This is the basic idea. Have an alignment structure with three blocks, each block of 1 column, put the simley in the first block, the equation in the second block, and keep the third block empty. The trick here is to have {\em 1 fil} in the distance. \definemathalignment[dosmiley] [n=1,m=3,distance=3em plus 1 fil] \placeformula[+] \startformula \startdosmiley \NC \smiley \NC (1)^2 + (\sqrt{4x+13})^2 = (2x)^2 \NC \NR[+] \stopdosmiley \stopformula Ah, it works. So we can add some syntax sugar around this, so that the formula is easier to key in. \def\startsmileyformula% {\startformula \startdosmiley \NC \smiley \NC} \def\stopsmileyformula% {\NC \NR[+] \stopdosmiley \stopformula} \placeformula[+] \startsmileyformula (1)^2 + (\sqrt{4x+13})^2 = (2x)^2 \stopsmileyformula If you only want a smiley without the equation, it also works. :-) \startsmileyformula (1)^2 + (\sqrt{4x+13})^2 = (2x)^2 \stopsmileyformula \stoptext Can you send me how you make a smiley. I will then put the code in myway on alignment. Aditya