Skip to content
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

Always explicitly load the kpse module #3

Open
Witiko opened this issue Feb 13, 2023 · 0 comments · May be fixed by #4
Open

Always explicitly load the kpse module #3

Witiko opened this issue Feb 13, 2023 · 0 comments · May be fixed by #4

Comments

@Witiko
Copy link

Witiko commented Feb 13, 2023

The lua-uni-algos library uses the kpse global in two files: lua-uni-normalize.lua and lua-uni-parse.lua. This works out in a format such as LaTeX, where kpse has already been loaded. However, in ConTeXt MkIV and LMTX, kpse is a library stub that causes a fatal error when find_file and other methods are called.

Consider the following document example.tex with an MWE for ConTeXt MkIV:

\starttext
\directlua{
  local uni_case = require'lua-uni-case'
  tex.print(uni_case.casefold('Straße', true, false))
}
\stoptext

Typesetting the MWE with the context example command produces the following error:

fatal error: kpse library is accessed (key: find_file)

We can replace the stub library by explicitly loading the external kpse library:

\starttext
\directlua{
  kpse = require'kpse'
  kpse.set_program_name'kpsewhich'
  local uni_case = require'lua-uni-case'
  tex.print(uni_case.casefold('Straße', true, false))
}
\stoptext

Running context example again will produce a PDF document example.pdf with the expected output:

strasse

@Witiko Witiko changed the title Always explicitly load the kpse module Only configure the KPathSea library if it has not been configured yet Feb 19, 2023
@Witiko Witiko changed the title Only configure the KPathSea library if it has not been configured yet Only configure the Kpathsea library if it has not been configured yet Feb 19, 2023
@Witiko Witiko changed the title Only configure the Kpathsea library if it has not been configured yet Always explicitly load the kpse module Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant