* blank[\lineheight] works with LMTX, fails with MkIV
@ 2019-12-20 19:04 Rik Kabel
2019-12-21 10:07 ` mf
0 siblings, 1 reply; 3+ messages in thread
From: Rik Kabel @ 2019-12-20 19:04 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 353 bytes --]
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.
--
Rik
[-- Attachment #1.2: Type: text/html, Size: 668 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: blank[\lineheight] works with LMTX, fails with MkIV
2019-12-20 19:04 blank[\lineheight] works with LMTX, fails with MkIV Rik Kabel
@ 2019-12-21 10:07 ` mf
2019-12-21 14:57 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: mf @ 2019-12-21 10:07 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1.1: Type: text/plain, Size: 463 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 983 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: blank[\lineheight] works with LMTX, fails with MkIV
2019-12-21 10:07 ` mf
@ 2019-12-21 14:57 ` Wolfgang Schuster
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2019-12-21 14:57 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1948 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 2804 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-21 14:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-20 19:04 blank[\lineheight] works with LMTX, fails with MkIV Rik Kabel
2019-12-21 10:07 ` mf
2019-12-21 14:57 ` Wolfgang Schuster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).