From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/105907 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: blank[\lineheight] works with LMTX, fails with MkIV Date: Sat, 21 Dec 2019 15:57:53 +0100 Message-ID: <4964f504-723f-578f-eef6-e17fc8afa89b@gmail.com> References: <1a7824ee-1c2f-256f-8b64-a13d7f4aebf5@rik.users.panix.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3400169780656752282==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="229636"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.10 To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 21 15:58:44 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iigDK-000xY3-Ox for gctc-ntg-context-518@m.gmane.org; Sat, 21 Dec 2019 15:58:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 71EE3162F60; Sat, 21 Dec 2019 15:58:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3pfwz7F-MyRQ; Sat, 21 Dec 2019 15:57:58 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B9170162785; Sat, 21 Dec 2019 15:57:58 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6F3BA1624D8 for ; Sat, 21 Dec 2019 15:57:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V7pSUnjTou3p for ; Sat, 21 Dec 2019 15:57:56 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.45; helo=mail-wr1-f45.google.com; envelope-from=wolfgang.schuster.lists@gmail.com; receiver= Original-Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id DC392162273 for ; Sat, 21 Dec 2019 15:57:56 +0100 (CET) Original-Received: by mail-wr1-f45.google.com with SMTP id b6so12222302wrq.0 for ; Sat, 21 Dec 2019 06:57:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:cc:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=pM2Lzmbbyau2qqI0pqFftGJdBwsOvukQJg70qrO9BSc=; b=uZj6JTagFsoMP1evrs9+P9dSGEYVgLo6eonvgJhKSfvz9wH38kqrmmoztKFqbRk9Sr EGZlZvK6GO+E3ybB408ZomDH1c61i/dM9G68iYcYCnUU6GTgXnWroKhwh+GiwsDaXlVc /LTsn7IQGbCqCBY6NkA85oWUZc3a8qM7Rgbsu6Xt701xch0upX9bJ8CaP3cXhiLgzgU5 yDCgFnddme1Q4qhg5T1NwW11BMiXInTJ/h8MK3V2Su0a0NY6t/9GSno2y2D+xgFF6XM1 3W3JZ5XlWdIstWQuAqWaNZUM/K9YaIRUK1u5aBPpTe5c/nJX3pPSk7qfE6inoriLKezw Ysow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:cc:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=pM2Lzmbbyau2qqI0pqFftGJdBwsOvukQJg70qrO9BSc=; b=CC9J2v/eS2jn43O0IdKH5kf0vbKCNy5JIwpH2ttd5F4lfqAHVrhdhdsU1QVfqN97V2 DkfWd6V5AGae2Wx4cCqqBnEe6x/LpcyVGbmNy7tXt4fzJq2A6sxzS6dPXJ1GhEnyfoA3 gllgoEsQ34VXuKLz7/fwoXQ383UUugumH0vZvhfzmyq7jMm0C3x5c9sIBpQoll87SYgn miykzRAWkFTa9DtEwB3uPxzC0YaU1XrfKNYAA7UXKyaMr5SYMzqtoXHzAzhFPxcNQwpx GVpa8HAlRN5G/FfUHtB7JZFIFtr3ZOTWeqi957+fbIcpnEVofk6ZiNCCXfa5ZgOq4/Rg Qq8Q== X-Gm-Message-State: APjAAAXYseykGyp9AUuwbcHylkNBlwa6ujzrCACIElMi78fD+tk2uUWv CqivRg7MJUwTYfoG4Tk/94o= X-Google-Smtp-Source: APXvYqyWzMa4GuQ9fnWdxgh5NIMYaOcAjCZW0sB1o1DM0eIfGkUveEjjVdwrRGUY8RUhm93ukaneUw== X-Received: by 2002:adf:cf0a:: with SMTP id o10mr12584291wrj.325.1576940276454; Sat, 21 Dec 2019 06:57:56 -0800 (PST) Original-Received: from [192.168.1.11] (x5f731f6c.dyn.telefonica.de. [95.115.31.108]) by smtp.gmail.com with ESMTPSA id x10sm13271220wrv.60.2019.12.21.06.57.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Dec 2019 06:57:55 -0800 (PST) In-Reply-To: Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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:105907 Archived-At: This is a multi-part message in MIME format. --===============3400169780656752282== Content-Type: multipart/alternative; boundary="------------77FA130C7D4C7D94679FE456" Content-Language: en-US This is a multi-part message in MIME format. --------------77FA130C7D4C7D94679FE456 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit mf schrieb am 21.12.2019 um 11:07: > Il 20/12/19 20:04, Rik Kabel ha scritto: >> >> MkIV fails with >> >> tex error > tex error on line 3 in file c://Users/micro/Desktop/fail.tex: ! Missing \endcsname inserted >> >> given the following mwe: >> >> \starttext >> a >> \blank[\lineheight] >> z >> \stoptext >> >> Not critical as there are lots of ways to do this, but it seems >> strange that it should work in one and not the other. >> > > \starttext > a > \blank[\the\lineheight] > z > \stoptext To understand the differenecs between MkIV adn LMTX you should know how \blank handles the arguments. 1. MkII ConTeXt processes the argument list in TeX and checks first if the argument is a valid name (e.g. big) which is then expanded, when the argument isn't a valid name it is handled as a dimension which is added to the skip value. Since everything happens in TeX length registers (e.g. \lineheight) are allowed in the argument. 2. MkIV ConTeXt passes the complete list with all arguments to Lua where a loop iterates over all entries. The problem here is that Lua can't deal with \lineheight because it expects the value of the register and you have to pass the length as \the\lineheight which delivers the current value for the line height. 3. LMTX The same things as MkIV but there is a additional check on the TeX end before the arguments are passed to Lua where ConTeXt checks if the argument is a dimension. The reason why this is only done for LMTX is that a new command (\ifchkdim) in the engine was needed for this and many of these new helpers exist only here. Be aware that this check works only when a length register is the *first* argument in the list because every other case the check fails. \starttext line 1 \blank[line] line 2 \blank[\lineheight] % works line 3 \blank[preference,line] line 4 \blank[preference,\lineheight] % fails line 5 \stoptext Wolfgang --------------77FA130C7D4C7D94679FE456 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit mf schrieb am 21.12.2019 um 11:07:
Il 20/12/19 20:04, Rik Kabel ha scritto:

MkIV fails with

tex error       > tex error on line 3 in file c://Users/micro/Desktop/fail.tex: ! Missing \endcsname inserted

given the following mwe:

\starttext
a
\blank[\lineheight]
z
\stoptext

Not critical as there are lots of ways to do this, but it seems strange that it should work in one and not the other.


\starttext
a
\blank[\the\lineheight]
z
\stoptext

To understand the differenecs between MkIV adn LMTX you should know how \blank handles the arguments.


1. MkII

ConTeXt processes the argument list in TeX and checks first if the argument is a valid name (e.g. big) which is then expanded, when the argument isn't a valid name it is handled as a dimension which is added to the skip value. Since everything happens in TeX length registers (e.g. \lineheight) are allowed in the argument.


2. MkIV

ConTeXt passes the complete list with all arguments to Lua where a loop iterates over all entries. The problem here is that Lua can't deal with \lineheight because it expects the value of the register and you have to pass the length as \the\lineheight which delivers the current value for the line height.


3. LMTX

The same things as MkIV but there is a additional check on the TeX end before the arguments are passed to Lua where ConTeXt checks if the argument is a dimension. The reason why this is only done for LMTX is that a new command (\ifchkdim) in the engine was needed for this and many of these new helpers exist only here.

Be aware that this check works only when a length register is the *first* argument in the list because every other case the check fails.


\starttext

line 1

\blank[line]

line 2

\blank[\lineheight] % works

line 3

\blank[preference,line]

line 4

\blank[preference,\lineheight] % fails

line 5

\stoptext


Wolfgang

--------------77FA130C7D4C7D94679FE456-- --===============3400169780656752282== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============3400169780656752282==--