Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

support lua*tex engines detection #1

Closed
norbusan opened this issue Oct 24, 2019 · 8 comments
Closed

support lua*tex engines detection #1

norbusan opened this issue Oct 24, 2019 · 8 comments

Comments

@norbusan
Copy link

Dear all,

would it be possible to include code similar to the following, which allows detection of which luatex engine is actually used:

   \ifcase\directlua{tex.write(({harftex = 2, luatex = 0, luahbtex = 1})[status.luatex_engine] or 3)}
      % Lua\TeX
    \or
      % LuaHB\TeX
    \or
      % Harf\TeX
    \or
      % UNKNOWN
    \fi

Furthermore, at the same time, detecting whether harfbuzz rendering is enabled could be detected with

  \ifLuaTeX
    \if1\directlua{if luaotfload.harfbuzz then tex.print("1") else tex.print("2") end}
      % harf mode is available
      % eg: \renewfontface{\tibNoto}[RawFeature={mode=harf;script=tibt;}]{Noto Serif Tibetan}
    \fi
  \fi

Thanks

Norbert

@davidcarlisle
Copy link
Member

yes we can certainly do something, it would be good though if we could rationalise these if... packages, iftex here detecting [pdf|lua|xe]tex, then wearing a different hat, ho-tex/oberdiek/ifluatex detecting luatex (which could also be extended for luhbtex in the same way) ZR's ifptex package, @wspr's ifxetex package, .. and so it goes.

Perhaps one for TL list but I'm wondering if this iftex package should be moved out of this bidi collection to something more central, and made to detect all variants, with the other if... packages just including it for legacy compat reasons. For latex, expl3 already has robust engine detection and it could use that, but probably best to keep these generic (@josephwright ?)

@josephwright
Copy link

Well yes, there is a lot of code if all you want to do is work out which engine is which. Could we get all the packages 'together' and have one iftex which provides all of the switches, then make the others stubs?

@davidcarlisle
Copy link
Member

@josephwright exactly, yes.

@norbusan
Copy link
Author

Hi
I'm all for reconciliating all these packages into one, and move it into a more proper location. Full support!

Thanks a lot

Norbert

@davidcarlisle
Copy link
Member

@norbusan An initial sketch at

https://github.com/davidcarlisle/iftex

not to be taken too seriously any part could be changed but comments welcome
@josephwright (also @zr-tex8r )

@zr-tex8r
Copy link

@davidcarlisle What should I do with my ifptex package then?
You’ve already said that the new iftex won’t import all the features of ifptex, and I’d like to agree that.
Then it would be reasonable that ifptex will be maintained (by me) to provide the rest of the features.

@davidcarlisle
Copy link
Member

@zr-tex8r Yes I think it's best that if ifptex status stays exactly as it is (we should check that if both are loaded then something sensible happens). If you would rather it was all combined in to one, that is another possibility but in that case I'd need to give you write access as I wouldn't trust me to maintain those tests...

But I think it's reasonable to have the basic tests here and the more specific tests in the separate ptex-specific package, but really I have no experience here I need to go on whatever you suggest?

@davidcarlisle
Copy link
Member

development moved to https://github.com/latex3/iftex/ and first release made to ctan.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants