0

An e-TeX generated with Jim Fowler's WEB/TeX Pascal to WebAssembly Compiler web2js should dump a LaTeX format from latex.ltx and stumbles over the babel-latex.cfg, see ShreevatsaR's instructions to get a LaTeX format working with web2js (with faked empty babe-latex.cfg.

Interestingly, the command etex -ini *latex.ltx /dump does not cause this problem. It loads switch.def after hyphen.cfg. Why no problems here?

The Babel manual says:

Now, hooks are defined. For efficiency reasons, they are dealt here in a special way. Besides luatex, format specific configuration files are taken into account.

The whole thing happens inside hyphen.cfg at line 121 \def\bbl@hook@everylanguage#1{}, see texdoc babel page 134.

Hint from Javier Bezos: Problem with \ifeof primitive

I want to prove the \ifeof-problem guess from Javier Bezos by equipping the babel-latex.cfg with an error message. This leads to the question where this file is to be stored at all.
I stored babel-latex.cfgin the same directory as hyphen.cfg. kpsewhich will find the last one but not babel-latex.cfg.

How can kpsewhich be taught to find a babel-latex.cfg?

❓ Can anyone provide an example babel-*.cfg?

8
  • 1
    Just a guess. Maybe web2js doesn't understand the \ifeof primitive. Aug 7 '19 at 12:10
  • @JavierBezos Does this include the possibility that if TeX does not find a file, it will simply ignore it, i.e. without an (error) message? This happens even before the EOF event. In the case of web2js TeX I search in the background with kpsewhich for the requested file and make it available. In this case, I would have to provide an empty file and everything would be fine? Can it really be that simple? Aug 7 '19 at 12:34
  • @JavierBezos I just found this: Straight after opening a file \ifeof is false only when the file doesn't exist. You gave the answer! 👍 Aug 7 '19 at 12:39
  • Do you actually get an error that this file couldn't be found? The only web search results for it leads to this thread, which indicates that there just is no such file.
    – siracusa
    Aug 8 '19 at 4:47
  • 1
    @CarpeDiemKopi An empty file should be fine. But if web2js doesn't handle correctly \openin (which is valid even if the file doesn't exist, but then sets EOF to true), \ifeof and the like, expect more errors. Aug 8 '19 at 6:12
0

Excerpt documentation to control kpsewhich:

3.4.6 Integrating local and personal macros
This is already mentioned implicitly in section 2.3: TEXMFLOCAL (by default, /usr/local/texlive/texmf-local or %SystemDrive%\texlive\texmf-local on Windows) is intended for system-wide localfonts and macros; and TEXMFHOME (by default, $HOME/texmfor%USERPROFILE%\texmf), is for personal fonts and macros. These directories are intended to stick around from release to release, and have their content seen automatically by a new TEX Live release. Therefore, it is best to refrain from changing the definition of TEXMFLOCAL to be too far away from the main TEX Live directory, or you will need to manually change future releases. For both trees, files should be placed in their proper TEX Directory Structure (TDS) subdirectories; see http://tug.org/tdsor consult texmf-dist/web2c/texmf.cnf. For instance, a LATEX class file or package should be placed in TEXMFLOCAL/tex/latexorTEXMFHOME/tex/latex, or a subdirectory there of. TEXMFLOCAL requires an up-to-date filename database, or files will not be found. You can update it with the command mktexlsror use the ‘Reinit file database’ button on the configuration tab of the TEXLive Manager GUI.

(texlive-en.pdf or C:\>texdoc texlive)

Result:

C:\>kpsewhich -all babel-latex.cfg
c:/texlive/texmf-local/tex/latex/local/babel-latex.cfg

Thanks to Javier Bezos's \ifeof guess without web2js babel-language.cfg is simply skipped. In order to prove this behavior, I've created a buggy babel-latex.cfg to test if it is asked at all.

c:\texlive>etex -ini *latex.ltx /dump
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (INITEX)
 restricted \write18 enabled.
entering extended mode
...
===========================================
Local configuration file hyphen.cfg used
===========================================
(c:/texlive/2019/texmf-dist/tex/generic/babel/hyphen.cfg
(c:/texlive/texmf-local/tex/latex/local/babel-latex.cfg

! LaTeX Error: Missing \begin{document}.

Conclusion:
web2js's \openin or \ifeof don't work in the same way as the standard primitives
According to the second hint from Javier Bezos probably more a \openin problem of non-existent files and follow-up faults.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.