From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23882 invoked from network); 17 Sep 2023 07:20:04 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 17 Sep 2023 07:20:04 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 8AAEC483001 for ; Sun, 17 Sep 2023 09:19:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YHkEoGgYCte9 for ; Sun, 17 Sep 2023 09:19:07 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 91C324830CE for ; Sun, 17 Sep 2023 09:18:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id CE943482C33 for ; Sun, 17 Sep 2023 09:18:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0llRGoVUzWWM for ; Sun, 17 Sep 2023 09:18:10 +0200 (CEST) Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 8BA23482C11 for ; Sun, 17 Sep 2023 09:18:10 +0200 (CEST) X-KPN-MessageId: 58b93949-552a-11ee-88e9-005056ab378f Received: from smtp.kpnmail.nl (unknown [10.31.155.39]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 58b93949-552a-11ee-88e9-005056ab378f; Sun, 17 Sep 2023 09:18:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:from:to:subject:mime-version:date:message-id; bh=/kYbDehQrnVpg84Yi9fsXmeFotiPw7WYYmV3Z23TsWU=; b=sqcDAzF8VYSXH6BgqFalquq+5Nst+yLB+Jx6iLAeOF6Fpk0IhnUFrW9QtGqnERBT92H85M+/kOYLi Us7HOYirzvkrIHn09tyDqvcPa5DhDUsWUVpWFmozVy1LoyJYyqLjQTrXS/Rp+NQOnkDJHUO6XqcQKE UMS3TngrbKGFTJHOG15Ax4lsQZRbA2Wriib+dJOzyt0d+84va+zhLMnkHrg/LmSva8KIJ+Mje7ToYX q8K5UzDYpFo9842BpzZT/0SvwWoNpwn+KG2l3E5LnFQEqO1T/FAg4ZfRXSX+nFF8tD5sLefxckODp/ E6opEEI2qCsV05GHbZeL4fszseXFX2A== X-KPN-MID: 33|EhyhIcSkCaKhznxmvXDPoQKyD7uBgZbszr+YsRb83gUJ5sdfGaIuvCBEw4c2OkM ED7GunXwlMNmmVwcGGCbF9HLUPqfWsV+I4t2WmHCEfyk= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|5rnCCY3vT8gISsl5Q5pRHFv+YcFkZ4amI6ZfnhErVgO7V+3Z3VEch6jRaBeWqqU ui/QC8/XzqnV/K04axWPe+g== X-Originating-IP: 213.125.29.162 Received: from [10.100.1.105] (d57d1da2.static.ziggozakelijk.nl [213.125.29.162]) by smtp.xs4all.nl (Halon) with ESMTPSA id 5ac8a09e-552a-11ee-a7a3-005056ab7447; Sun, 17 Sep 2023 09:18:10 +0200 (CEST) Message-ID: <48092628-1f58-dee4-9643-baadf63ada23@xs4all.nl> Date: Sun, 17 Sep 2023 09:18:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US To: ntg-context@ntg.nl References: <947cf5e7a0e99d13535f7d839a8b3204e6038d61.camel@telus.net> From: Hans Hagen In-Reply-To: <947cf5e7a0e99d13535f7d839a8b3204e6038d61.camel@telus.net> Message-ID-Hash: DFKSUEF4OTMAE27UOWCCR35GRPCP2AZN X-Message-ID-Hash: DFKSUEF4OTMAE27UOWCCR35GRPCP2AZN X-MailFrom: j.hagen@xs4all.nl X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Different behavior of \clf_lastypos vs \clf_lastxpos List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 9/17/2023 9:04 AM, Max Chernoff wrote: > Hi Aditya, > >> For some reason, there is an extra \relax written to file after >> `\the\numexp\clf_lastypos\relax` (there is no such relax after >> `\the\numexpr\clf_lastxpos\relax`). The test.pgf file is: >> >> \macro {A}{23930350}{43358454.0\relax } \macro {B}{39564274.0\relax >> }{14083538} >> >> Any ideas on why is the extra \relax written after lastypos and how to >> fix that? > > \numexpr stops at the first non-expandable or non-digit token. If > \clf_last[xy]pos expands to an integer, then that's the \relax, but if > it expands to a float, then that's the decimal point. > > With Lua, adding, subtracting, or multiplying two integers will give you > an integer, but dividing gives you a float. So somewhere in the backend, > the vertical position is probably divided but the horizontal position is > only added or subtracted. > > To fix this, change lines 2344--2345 of anch-pos.lmt from > > implement { name = "lastxpos", actions = function() context(jobpositions.lastx) end } > implement { name = "lastypos", actions = function() context(jobpositions.lasty) end } > > to > > implement { name = "lastxpos", actions = function() context("%.0f", jobpositions.lastx) end } > implement { name = "lastypos", actions = function() context("%.0f", jobpositions.lasty) end } it's better to do some rounding earlier on Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________