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.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29740 invoked from network); 5 Oct 2023 04:04:34 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 5 Oct 2023 04:04:34 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 86D024833BC for ; Thu, 5 Oct 2023 06:02:55 +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 YpuKefrm53lb for ; Thu, 5 Oct 2023 06:02:52 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E2EF548346A for ; Thu, 5 Oct 2023 06:00:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 517A34832A6 for ; Thu, 5 Oct 2023 06:00:30 +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 F-IBdgaT6JEd for ; Thu, 5 Oct 2023 06:00:29 +0200 (CEST) X-Greylist: delayed 346 seconds by postgrey-1.36 at cgl.ntg.nl; Thu, 05 Oct 2023 06:00:28 CEST Received: from ms11p00im-hyfv17291101.me.com (ms11p00im-hyfv17291101.me.com [17.58.38.40]) (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 D667748329C for ; Thu, 5 Oct 2023 06:00:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1696478080; bh=grwNyHgwEqL9HkWFByKAsIkeuMjRc0kAqkccZwzwKcg=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=OlzgEQhc1hAOkH9QXx4Y8dyi4y+UqFsU520CiNEbLNQb/gV6pmMlX+YZT8qvRNY8n cDPinno82FoTOguD1BjIDQBU/wEVDa9z9zVnnVghIDaODa0VfU/pyELKffDsFfV05l aFJqGmKTDkMbJp6apImxvPVwu72QhA+Ri0PSrZBf4lDuQ+PV+Ft9adV1GfAQ1P6Bd1 xbVhD/pwpkiMPRUcv01h86lK9DjkCbh+SIfXZUpeIXLwmdEX0FtBlAWsQODQpR6cAv yfcpglhZsStywfSfbjRWX973Gdcmj63822RoOCchN1NsciA7C5iuSHsrsMJeOeYMlp RzLz4D8duXbkA== Received: from smtpclient.apple (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-hyfv17291101.me.com (Postfix) with ESMTPSA id D262C76036A for ; Thu, 5 Oct 2023 03:54:39 +0000 (UTC) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Message-Id: <61545EF6-8B7A-4FDA-A374-0A69AB077D00@icloud.com> Date: Thu, 5 Oct 2023 16:54:26 +1300 To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.3731.700.6) X-Proofpoint-GUID: yoA0RIVwDFarq_UrDfAIPoU9eJqk_sz2 X-Proofpoint-ORIG-GUID: yoA0RIVwDFarq_UrDfAIPoU9eJqk_sz2 X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.816,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-18=5F01:2020-02-14=5F02,2022-01-18=5F01,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 spamscore=0 clxscore=1015 mlxscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2310050032 Message-ID-Hash: TLAOWOQ4CPGBETT7OPY3ALJC3THJHNF7 X-Message-ID-Hash: TLAOWOQ4CPGBETT7OPY3ALJC3THJHNF7 X-MailFrom: peter.hopcroft@icloud.com 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] How can I use a variable for a MetaPost coordinate ? List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "peter.hopcroft--- via ntg-context" Cc: peter.hopcroft@icloud.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello list, I want to draw lines on a page. I want to pass my line coordinates as a percent of \width or \textheight, rather than as millimetres. So that if I change the page size I don't need to change the coordinates. The MWE below compiles but the pdf does not have any lines drawn on it. Is there a way of doing calculations on the coordinates for the draw using ConTexT variables like \textheight? Thank you, Peter Hopcroft ------ \starttext Some text \startMPcode pickup pensquare scaled 1pt; draw (0mm,0mm)--(0mm,\textheight) withcolor red \stopMPcode More text \startMPcode pickup pensquare scaled 1pt; draw (0mm,0mm)--(0mm,50mm) scaled \numexpr\textheight/50mm\relax \stopMPcode \stoptext ------ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id} webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________