From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31146 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: ## in \def in \sometxt fails with static MP figure Date: Sat, 30 Sep 2006 15:17:56 -0400 Message-ID: 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 1159643916 23124 80.91.229.2 (30 Sep 2006 19:18:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2006 19:18:36 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Sep 30 21:18:34 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 1GTkLx-0007Um-KE for gctc-ntg-context-518@m.gmane.org; Sat, 30 Sep 2006 21:18:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AD7471FEA7; Sat, 30 Sep 2006 21:18:23 +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 22387-06-3; Sat, 30 Sep 2006 21:18:16 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 706411FE8F; Sat, 30 Sep 2006 21:18:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A3A2E1FE8F for ; Sat, 30 Sep 2006 21:18:12 +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 22387-06-2 for ; Sat, 30 Sep 2006 21:18:05 +0200 (CEST) Original-Received: from elasmtp-scoter.atl.sa.earthlink.net (elasmtp-scoter.atl.sa.earthlink.net [209.86.89.67]) by ronja.ntg.nl (Postfix) with SMTP id 06B241FE60 for ; Sat, 30 Sep 2006 21:18:04 +0200 (CEST) Original-Received: from [24.41.6.91] (helo=approximate.corpus.cam.ac.uk) by elasmtp-scoter.atl.sa.earthlink.net with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1GTkLb-0007Tc-Ge; Sat, 30 Sep 2006 15:18:03 -0400 Original-Received: from sanjoy by approximate.corpus.cam.ac.uk with local (Exim 4.60) (envelope-from ) id 1GTkLU-0003br-Bc; Sat, 30 Sep 2006 15:17:56 -0400 Original-To: ntg-context@ntg.nl X-Mailer: MH-E 7.85; nmh 1.1; GNU Emacs 21.4.1 X-ELNK-Trace: dcd19350f30646cc26f3bd1b5f75c9f474bf435c0eb9d4786a166ed818d7c747ecaecf8c35637fdd5d851fc4048aae11350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 24.41.6.91 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:31146 Archived-At: Now that \sometxt works with static figures (thanks!), I'm converting from using btex..etex to using \sometxt, to avoid MPenvironments (instead put it in the general .tex environment). But I ran into an error with macro arguments and static figures. Let me know if it's not worth fixing in view of the Mk IV cleanup, and I'll switch to reusable figures (and eventually Linux will support dual core CPUs + suspend to ram, and then I won't notice the processing time much). Here is a small example file: ================= y.tex ======================== \def\2#1#2{\vbox{\halign{##\hfil\cr#1\cr#2\cr}}} \starttext \startstaticMPfigure{fig} label(\sometxt{\2{h}{x}}, origin); \stopstaticMPfigure \usestaticMPfigure[fig] \stoptext ================= y.tex ======================== It produces this texexec.tex (2006.09.28 22:43 beta): ================ texexec.tex ===================== \setupoutput[pdftex] \setupcolors[state=start] \global \loadfontfileoncetrue \starttext \startMPpage beginfig(1); label(\sometxt{\vbox {\halign {##\hfil \cr h\cr x\cr }}}, origin); endfig; \stopMPpage \stoptext ================ texexec.tex ===================== The ## in the expanded argument to \sometxt causes a problem: =================== texexec.log ============== ! Only one # is allowed per tab. l.1 \vbox {\halign {## \hfil \cr h\cr x\cr }} \doTeXtext ... \startcurrentcolor \scantokens {#3} \stopcurrentcolor }\global... \dodofiltersometxt ...er \TeXtext \txtcounter {#1} \expandafter \filtersometx... ...halign {##\hfil \cr h\cr x\cr }}}, o rigin); endfig; \flushTeXtexts ...llectedmptexts \filtersometxt #1 \sometxt {}\empty \relax \... \writecheckedMPgraphic ...phic \flushTeXtexts {#1} \writeMPgraphic {#1} ... l.9 endfig; \stopMPpage ? =================== texexec.log ============== Alas using \def\2#1#2{\vbox{\halign{#\hfil\cr#1\cr#2\cr}}} leads to a different error (illegal parameter number). But using a reusable graphic works: ==================== yy.tex ===================== \def\2#1#2{\vbox{\halign{##\hfil\cr#1\cr#2\cr}}} \starttext \startreusableMPgraphic{fig} label(\sometxt{\2{h}{x}}, origin); \stopreusableMPgraphic \reuseMPgraphic{fig} \stoptext ==================== yy.tex ===================== -Sanjoy `A society of sheep must in time beget a government of wolves.' -- Bertrand de Jouvenal