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

Option '-tex lualatex' makes an unexpected shift #123

Closed
lemniscati opened this issue Nov 13, 2019 · 10 comments
Closed

Option '-tex lualatex' makes an unexpected shift #123

lemniscati opened this issue Nov 13, 2019 · 10 comments

Comments

@lemniscati
Copy link
Contributor

@lemniscati lemniscati commented Nov 13, 2019

Asymptote 2.49 with LuaLaTeX 1.10 as engine on Cygwin makes an unexpected shift.
Is it an issue on Asymptote or on LuaLaTeX?

A test file a.asy:

real s=30;
draw(scale(s)*unitsquare,defaultpen+.5mm);
label("\TeX",scale(s)*(.5,.5));

Compiling as follows results in default.pdf and lualatex.pdf.

asy -f pdf -o default a
asy -f pdf -o lualatex -tex lualatex a

And, default.pdf has no problem, but lualatex.pdf has unexpected shift.

@johncbowman
Copy link
Member

@johncbowman johncbowman commented Nov 17, 2019

I tested this example with TeXLive 2019 and I can't see any difference between the two outputs.
I tried the current obsolete version Asymptote 2.49 and the latest stable version, 2.61, which I am just about to release...

@lemniscati
Copy link
Contributor Author

@lemniscati lemniscati commented Nov 17, 2019

Checking logs, and noticed the followings:

It seems to depend on whether luaotfload is successfully loaded through lualatex.

When luaotfload-main.lua is succesfully loaded on lualatex, it makes an unexpected shift.
But when luaotfload-main.lua is not found, it makes no unexpected shift.

Please, check kpsewhich luaotfload-main.lua.

Maybe, this issue is attributed to luaotfload...

@johncbowman
Copy link
Member

@johncbowman johncbowman commented Nov 18, 2019

Here is what I get (however, I have no idea what luaotfload-main is or how it might get loaded by your example; maybe there is a problem with your path?):

/usr/local/texlive/2019/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua

@johncbowman
Copy link
Member

@johncbowman johncbowman commented Nov 18, 2019

I do see the line:
luaotfload | main : initialization completed in 0.141 seconds
Can you post an example pdf that illustrates the shift you are seeing?

@lemniscati
Copy link
Contributor Author

@lemniscati lemniscati commented Nov 18, 2019

Thank you for testing.

Here is an example with unexpected shift
lualatex.pdf

and intermediate files
lualatex_with_luaotfload-main.zip

@lemniscati
Copy link
Contributor Author

@lemniscati lemniscati commented Nov 18, 2019

And, here is an example without unexpected shift
lualatex.pdf

and intermediate files
lualatex_without_luaotfload-main.zip

@lemniscati
Copy link
Contributor Author

@lemniscati lemniscati commented Nov 24, 2019

@johncbowman, please reopen the issue.

It can happen on Ubuntu 18.04 with TeX Live 2017, not only on Cygwin.

https://cygwin.com/ml/cygwin/2019-11/msg00137.html

And, on cygwin, I tried compiling from the source with ec3c7f0 (Asymptote version 2.62-3), and got same results (A logo TeX and an unit square are shifted to the right with luaotfload-main.lua).

@johncbowman
Copy link
Member

@johncbowman johncbowman commented Nov 24, 2019

I could never see what was bothering you as the TeX label looks properly typeset and centered in the square in both examples that you posted. I now see that you are referring to a tiny horizontal offset of 0.4bp of the bounding box. It looks like a lualatex bug. I can change \hoffset in the generated texfile from -1in to -72.4bp as a temporary work around, until a proper fix is made in the lualatex sources.

@johncbowman johncbowman reopened this Nov 24, 2019
johncbowman added a commit that referenced this issue Nov 24, 2019
@johncbowman
Copy link
Member

@johncbowman johncbowman commented Nov 24, 2019

A workaround was implemented in commit 41fbc67.
Please test that this works with and without luaotfload.

@lemniscati
Copy link
Contributor Author

@lemniscati lemniscati commented Nov 25, 2019

It works.
Thank you, @johncbowman!

I tested on cygwin in following cases. But I think the first case is important and sufficient, because both of luaotfload.sty and luaotfload-main.lua come with luatex/lualatex.

  1. With luaotfload.sty and with luaotfload-main.lua: OK.
  2. Without luaotfload.sty and with luaotfload-main.lua: OK.
  3. With luaotfload.sty and without luaotfload-main.lua: shifted to the left.
  4. Without luaotfload.sty and without luaotfload-main.lua: shifted to the left.
lemniscati added a commit to lemniscati/asymptote that referenced this issue Dec 9, 2019
This reverts commit 41fbc67.
Not a lualatex bug, but a wrong assumption in asymptote that
\parindent were always 17.61pt.
lemniscati added a commit to lemniscati/asymptote that referenced this issue Dec 9, 2019
johncbowman added a commit that referenced this issue Dec 9, 2019
* Revert "Workaround lualatex bug #123."

This reverts commit 41fbc67.
Not a lualatex bug, but a wrong assumption in asymptote that
\parindent were always 17.61pt.

* Fix offset settings where texengine is latex and pdf #123.
lemniscati added a commit to lemniscati/asymptote that referenced this issue Dec 9, 2019
johncbowman added a commit that referenced this issue Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants