From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91954 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: TeX capacity exceeded - in Lua block - why? Date: Thu, 16 Jul 2015 11:03:05 +0200 Message-ID: References: <55A76B04.9080608@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1212681971==" X-Trace: ger.gmane.org 1437037445 30019 80.91.229.3 (16 Jul 2015 09:04:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jul 2015 09:04:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 16 11:03:55 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZFf58-0008Cj-Sg for gctc-ntg-context-518@m.gmane.org; Thu, 16 Jul 2015 11:03:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 33CBC101F6 for ; Thu, 16 Jul 2015 11:03:54 +0200 (CEST) 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 grdJUcly1O6q for ; Thu, 16 Jul 2015 11:03:52 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5737F10236 for ; Thu, 16 Jul 2015 11:03:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 45606101F6 for ; Thu, 16 Jul 2015 11:03:09 +0200 (CEST) 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 NlqwekiGixeg for ; Thu, 16 Jul 2015 11:03:08 +0200 (CEST) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 6A519101E6 for ; Thu, 16 Jul 2015 11:03:08 +0200 (CEST) Original-Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) by filter3-utr.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t6G935qY023620 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 16 Jul 2015 11:03:06 +0200 Original-Received: by wicmv11 with SMTP id mv11so9857847wic.1 for ; Thu, 16 Jul 2015 02:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7lwBJAWTosBru2PMKkbZRNndjr/Z8TfhsGxCSLG1j1Y=; b=pf2Pxe56Bw3Mqps3Vb1aEnq8YO7O1+yRhtyr9SNNQG++XxiwAlCcTvXUM8jZewUe0F R0i7MydY8/11e9X6ZEsEgYmu29EIrsRPHhSV2yd92LMDp7tVXnK9CT5iGiPQKArpQlP3 TbYv7ZLzMF9jBM9ubMP5TYHRaLpgt5xAQV76VW4ar6QLuUjMtRbO0mZXbEXNUTuaFrd6 3wdGTGwppjLk21hzaoF/r6mOb2+S9nhOXYd3ubtwTcSQTy2ekP5iLRRRxtwAmWcmAqqQ D2S731ZTvN7hSnmbh5wWffv5LAkIXyO8p/NfKhmAJ9yv0oBbh3A401vAkdDoWMqMfmN1 C37g== X-Received: by 10.194.93.3 with SMTP id cq3mr16621038wjb.20.1437037385722; Thu, 16 Jul 2015 02:03:05 -0700 (PDT) Original-Received: by 10.194.200.106 with HTTP; Thu, 16 Jul 2015 02:03:05 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::234; country=BE; region=Brussels Capital; city=Brussels; latitude=50.8466; longitude=4.3528; http://maps.google.com/maps?q=50.8466,4.3528&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08OQV36VR - 8f921d3bf60c - 20150716 (trained as not-spam) Received-SPF: pass (filter3-utr.mf.surf.net: domain of luigi.scarso@gmail.com designates 2a00:1450:400c:c05::234 as permitted sender) receiver=filter3-utr.mf.surf.net; client-ip=2a00:1450:400c:c05::234; envelope-from=; helo=mail-wi0-x234.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:91954 Archived-At: --===============1212681971== Content-Type: multipart/alternative; boundary=047d7bb04822e7b0cc051afa566c --047d7bb04822e7b0cc051afa566c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 16, 2015 at 10:55 AM, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - Pon= tex s. r. o. < LPr@pontex.cz> wrote: > Hello, > > On Thu, 16 Jul 2015 10:27:48 +0200, Hans Hagen wrote: > > On 7/16/2015 10:20 AM, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - Pontex s. r= . o. wrote: >> >>> Hello, >>> >>> why this code: >>> >>> ---- >>> \def\GG{\ifmmode G_G\else$\GG$\fi} >>> >> >> because in math mode \GG expands \GG which expands \GG .... >> > > I want to just pass G_G in math mode, so it seems to me that "\ifmmode > G_G..." does the check. > > The macro should write G + "lower index G" for both math and non-math > scope. > > And, in non math scope, the macro should just enclose itself by $...$ (or > \m{...})... > > And, this works well in TeX code: > > ---- > \def\GG{\ifmmode G_G\else$\GG$\fi} > > \starttext > \GG $\GG$ > \startitemize[][] > \sym{\GG} \GG > \sym{$\GG$} $\GG$ > \sym{\m{\GG}} \m{\GG} > \item End > \stopitemize > \stoptext > ---- > > So how to rewrite the itemization into Lua? > > maybe you mean: >> >> \def\GG{\ifmmode G_G\else$GG$\fi} >> > > ... Could be \def\GG{\ifmmode G_G\else$G_G$\fi}, too, but why not > \def\GG{\ifmmode G_G\else$\GG$\fi} (seems to me be simpler as the macro > definition - which may be more complicated - appears only once)? > >> >>> \def\GG{\ifmmode G_G\else$\GG$\fi} means "define the macro \GG as G_G if mmmod is true, else as \GG " It's clear that you always are in a situation where mmod is true, then \GG is replaced with G_G but as soon as you fall into "mmod not true" then you have infinite recursion. --=20 luigi --047d7bb04822e7b0cc051afa566c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Jul 16, 2015 at 10:55 AM, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. -= Pontex s. r. o. <LPr@pontex.cz> wrote:
Hell= o,

On Thu, 16 Jul 2015 10:27:48 +0200, Hans Hagen <pragma@wxs.nl> wrote:

On 7/16/2015 10:20 AM, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - Pontex s. r. o= . wrote:
Hello,

why this code:

----
\def\GG{\ifmmode G_G\else$\GG$\fi}

because in math mode \GG expands \GG which expands \GG ....

I want to just pass G_G in math mode, so it seems to me that "\ifmmode= G_G..." does the check.

The macro should write G + "lower index G" for both math and non-= math scope.

And, in non math scope, the macro should just enclose itself by $...$ (or \= m{...})...

And, this works well in TeX code:

----
\def\GG{\ifmmode G_G\else$\GG$\fi}

\starttext
=C2=A0 \GG $\GG$
=C2=A0 \startitemize[][]
=C2=A0 =C2=A0 \sym{\GG} \GG
=C2=A0 =C2=A0 \sym{$\GG$} $\GG$
=C2=A0 =C2=A0 \sym{\m{\GG}} \m{\GG}
=C2=A0 =C2=A0 \item End
=C2=A0 \stopitemize
\stoptext
----

So how to rewrite the itemization into Lua?

maybe you mean:

\def\GG{\ifmmode G_G\else$GG$\fi}

... Could be \def\GG{\ifmmode G_G\else$G_G$\fi}, too, but why not \def\GG{\= ifmmode G_G\else$\GG$\fi} (seems to me be simpler as the macro definition -= which may be more complicated - appears only once)?



=C2=A0\def\= GG{\ifmmode G_G\else$\GG$\fi}
means "define the macro \GG as= G_G if mmmod is true,
else as \GG "
It's clea= r that you =C2=A0always are in a situation where mmod is true, then \GG is = replaced with =C2=A0G_G
but as soon as you fall into "mmod n= ot true" then you have infinite recursion.

-= -
luigi
--047d7bb04822e7b0cc051afa566c-- --===============1212681971== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1212681971==--