ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: witiko@gmail.com
To: ntg-context@ntg.nl
Subject: [NTG-context] In LuaMetaTeX, `\read` sometimes doesn't grab the entire balanced text
Date: Fri, 19 Sep 2025 21:46:38 -0000	[thread overview]
Message-ID: <175831839816.2547.17497282640946726671@cgl.ntg.nl> (raw)

Dear list,

I noticed that in LuaMetaTeX, `\read` sometimes doesn't grab the entire balanced text.

Consider the following two example files:

#### example.tex

```
\starttext
\newread\example
\openin\example=example.txt
\read\example to\hello
\read\example to\world
\closein\example
\hello\ \world
\stoptext
```

#### example.txt

```
{%
hello}
world
```

Running ConTeXt MkIV with the command `context --luatex example.tex` produces a PDF file with the text "hello world", as expected.

In contrast, running ConTeXt LMTX with the command `context example.tex` produces a PDF file with just the text "world", and a warning that "\end occurred inside a group at level 1". Adding the lines `\show\hello` and `\show\world` before `\stoptext` and rerunning the command `context example.tex` reveals that `\read` only assigned the opening brace `{` rather than the whole balanced text `{hello}` to `\hello`:

```
> \hello=global macro:
{
> \world=global macro:
world
```

Best,
Vit
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2025-09-19 21:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 21:46 witiko [this message]
2025-09-20 10:15 ` [NTG-context] " Hans Hagen via ntg-context
2025-09-20 10:51   ` Joseph Wright
2025-09-21 18:37     ` Hans Hagen via ntg-context
2025-09-23  9:14 ` witiko
2025-09-23  9:49   ` Hans Hagen via ntg-context
2025-09-23 10:09     ` witiko
2025-09-23 11:27       ` Hans Hagen via ntg-context
2025-09-23 11:40         ` witiko
2025-09-23 12:58           ` Hans Hagen via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175831839816.2547.17497282640946726671@cgl.ntg.nl \
    --to=witiko@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).