-
Notifications
You must be signed in to change notification settings - Fork 32
Enable LuaMetaTeX in ConTeXt tests and examples #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
600a7fc
to
40aa8a2
Compare
8c981c0
to
98e0b37
Compare
98e0b37
to
c8aba5e
Compare
I wanted to test the new support for ConTeXt LMTX but I am still seeing some issues, namely the lack of support for the KPathSea library in LMTX, even in TeX Live, see the CI failure from this PR:
Looking into the file
This is perhaps to be expected: Even if KPathSea is available for LuaMetaTeX in TeX Live, we apparently need to use the predefined object |
@andreiborisov: Can you please test that you can compile the example file \startluacode
local kpse = require("kpse")
kpse.set_program_name("luatex")
\stopluacode Furthermore, you will also need to copy all dependencies to the directory
Please, let me know how that goes! If you manage to compile the example document, I will use your feedback to hopefully have the CI running the LMTX tests and compiling the LMTX examples in the next version, to be released by the end of March at the latest. 🤞 |
97ee0f0
to
4902747
Compare
@andreiborisov seems unavailable with no GitHub activity since at least January. Therefore, I will jump on this in the meantime and try to get things moving before the end of April. This includes adding examples and tests for LuaMetaTeX and ConTeXt LMTX, writing instructions for installation with ConTeXt standalone, and fixing any issues I find along the way. Adding a Dockerfile for ConTeXt standalone, continuously building a Docker image, running tests with it, and releasing it sounds great on paper but I am not using ConTeXt nearly enough to feel comfortable as the only maintainer of this part of the Markdown Package for TeX. Therefore, this is currently not a goal. |
I removed the part of file
Then, I ran
The line 77 from file I opened a ticket tracking this issue upstream: latex3/latex3#1724. Any further work on this PR is blocked until the upstream ticket has been resolved. |
Continuing #557 (comment) by patching the file
This still seems to be an issue with expl3, not with lt3luabridge, as I discuss in latex3/latex3#1702 (comment). |
After @josephwright's patch from latex3/latex3@885643a, running
This is different from calling
The latter seems reasonable: The library lua-uni-algos requires the library KPathSea, which is generally unavailable in ConTeXt LMTX, as discussed in #557 (comment) and elsewhere. We may need to get rid of our dependency on the library lua-uni-algos if we wish to support ConTeXt LMTX (and ConTeXt standalone more generally) properly. The former does not seem reasonable and seems to indicate that there are still corner cases where |
I applied the latest update from @josephwright in latex3/latex3#1725 and removed all calls to the library KPathSea from the file 75,83d74
< ;(function()
< local should_initialize = package.loaded.kpse == nil
< or tex.initialize ~= nil
< kpse = require("kpse")
< if should_initialize then
< kpse.set_program_name("luatex")
< end
< end)()
< local uni_algos = require("lua-uni-algos")
6933,6934c6924
< for _, pathname in ipairs{kpse.lookup(language_map,
< {all=true})} do
---
> for _, pathname in ipairs{} do
8881,8883c8871
< local pathname = assert(kpse.find_file(filename),
< [[Could not locate user-defined syntax extension "]]
< .. filename)
---
> local pathname = filename After these changes, running context
This seems comparable to the output of the command Then, I removed all uses of the library lua-uni-algos from the file 3025,3028d3024
< if not options.unicodeNormalization
< or options.unicodeNormalizationForm ~= "nfc" then
< normalized_s = uni_algos.normalize.NFC(normalized_s)
< end
3072,3073d3067
< -- Case-fold all alphabetic characters.
< char = uni_algos.case.casefold(char)
3095,3098d3088
< if not options.unicodeNormalization
< or options.unicodeNormalizationForm ~= "nfc" then
< normalized_s = uni_algos.normalize.NFC(normalized_s)
< end
3142,3143d3131
< -- Case-fold all alphabetic characters.
< char = uni_algos.case.casefold(char)
4849d4836
< tag = uni_algos.case.casefold(tag, true, false)
6627,6641d6613
< if options.unicodeNormalization then
< local form = options.unicodeNormalizationForm
< if form == "nfc" then
< input = uni_algos.normalize.NFC(input)
< elseif form == "nfd" then
< input = uni_algos.normalize.NFD(input)
< elseif form == "nfkc" then
< input = uni_algos.normalize.NFKC(input)
< elseif form == "nfkd" then
< input = uni_algos.normalize.NFKD(input)
< else
< return writer.error(
< format("Unknown normalization form %s.", form))
< end
< end This allowed me to compile the file There are other concerns, which seem minor in comparison. Namely, there are numerous occurrences of the texts "haracter U+007D 'right curly bracket'" and "haracter U+007B 'left curly bracket'" in the PDF document. Namely, the first three pages of the document consist entirely of these: However, they also occur elsewhere in the document: These texts aren't present in the output of the command |
I created a minimal working example and opened a ticket upstream in latex3/latex3#1728. |
I am getting a clean compile of the file Based on #557 (comment) and below, here are the necessary steps than need to be taken before the CI is green:
To fully resolve #436 and close ticket #402, here are some of the next steps for v3.11.3, first outlined in #557 (comment):
After this has been done, we should publicize the support for ConTeXt LMTX:
Don't forget to mention @josephwright's numerous contributions in |
The linked message contains the following remarks by @hanshagen:
Let's perhaps respond with a question about if and how we could recompile the ConTeXt format files to include
In the future, if there is sufficient demand, expl3 could perhaps be included with ConTeXt; if not by default, then with a simple runtime switch. Official support for expl3 in ConTeXt would ensure better long-term support. At the moment, expl3 contains some support for LuaMetaTeX with minimal tests thanks to @josephwright's efforts but there is currently no testing at the ConTeXt side and any changes to LuaMetaTeX are potentially breaking for us. |
This PR enables LuaMetaTeX in ConTeXt tests and examples after #551.