-
Notifications
You must be signed in to change notification settings - Fork 4
Always explicitly load the kpse module
#4
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
|
First of all we can't call Beside that it feels like working around a conscious decision of ConTeXt. IMO doing something like |
| kpse.set_program_name'kpsewhich' | ||
| end | ||
| local kpse = require'kpse' | ||
| kpse.set_program_name'kpsewhich' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks name lookup when used in LaTeX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It changes the current progname in kpathsea to kpsewhich from this point on, therefore all engine specific overwrites in texmf.cnf are disabled and expansions of $progname in lookup paths lead to the wrong result.
So if you for example have a tex file with the same name in texmf/tex/luatex and texmf/tex/generic, then the luatex version is preferred before and the generic one afterwards.
This doesn't matter too much with TeX Live's default setup since that always falls back to the other directories if a file isn't found and TeX Live generally doesn't reuse filenames, but it can easily break user settings.
|
Here is my understanding: ConTeXt is commonly distributed as a part of the ConTeXt Standalone distribution, which does not contain either kpathsea or other parts of TeX Live. If you need kpsewhich in TeX Live, you can explicitly require it but it is unnecessary for the working of ConTeXt. |
|
However, I tend to agree that the responsibility for loading kpathsea in ConTeXt should perhaps fall on the shoulders of users, seeing how it affects the global state. Therefore, you may want to close both this pull request and #3 as a wontfix. |
| local codes = utf8.codes | ||
| local unpack = table.unpack | ||
|
|
||
| if tex.initialize then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zauguin Out of curiosity, where is tex.initialize defined? I don't see any mention in either luatex.pdf or ltluatex.pdf.
Closes #3. Compared to the workaround given in #3, this solution is automatic for the user and does not require setting a
kpseglobal.