4

I am writing my documents using TeXstudio with TeX Live on Windows (all up to date). After typesetting a document with SyncTeX (which is the default), I should be able to Ctrl + Click into the PDF preview in order to move the cursor to the appropriate position in the source editor.

This works fine with pdflatex, but when using lualatex (which I do in most of my documents) I am often directed to a seemingly random position later in the file. The discrepancy can be quite large, spanning several pages. This is of course not ideal.

After searching the web a bit I discovered a bug report in TeXstudio's issue tracker from three years ago describing the same problem. The people there seemed to agree that it was an issue with TeX Live, as it didn't appear with MiKTeX.

So my questions are

  • Can I do anything to remedy this? (I assume no.)
  • Can some of you maybe confirm the behavior I see on your own setup? Does it appear independently of the editor? Can you confirm that it does not happen with MiKTeX?
  • Is there a public bug tracker for TeX Live where I can check if this has already been reported? Or should I just write to the mailing list?
  • Is this more likely a bug in LuaLaTeX, SyncTeX or something else?

(I do realize that this question (set) somewhat breaks the format of this site but I felt that it is useful.)


Here's an MWE for testing. On my system, clicking on "1", "2" or "3" takes me to 3, clicking on "4" or "5" takes me to 5 and the rest of the paragraphs take me where they should. I can also provide longer examples if required.

% !TeX program = lualatex
\documentclass{article}

\begin{document}

1

2

3

4

5

6

7

\end{document}
4
  • Which TeX distribution and which version of LuaTeX do you employ? The reason I ask is that I don't encounter any of the issues you describe on my system, which employs MacOS 12.1 "Monterey", MacTeX2021 (with all updates installed), LuaHBTeX 1.13.2, LaTeX2e <2021-11-15> patch level 1, and TeXworks 0.6.6 for MacOS.
    – Mico
    Commented Jan 17, 2022 at 18:54
  • 1
    @Mico I'm using TeX Live 2021, LuaHBTeX, Version 1.13.2 and LaTeX2e <2021-11-15> (with L3 programming layer <2022-01-12>), same as you (just on Windows). I updated just before asking the question, just to be sure.
    – schtandard
    Commented Jan 17, 2022 at 19:00
  • 1
    Does the same problem arise if you use TeXworks rather than TeXstudio as the front-end?
    – Mico
    Commented Jan 17, 2022 at 19:06
  • @Mico Yes, exactly the same behavior.
    – schtandard
    Commented Jan 17, 2022 at 19:13

2 Answers 2

1

This very morning Akira Kakuto replied to a respective question on the [email protected] mailinglist:

There was a bug in SyncTeX, he has fixed it locally already, the fix will be available with TeX Live 2022.

2
  • What a coincidence that there was an email just now.. ;-)
    – schtandard
    Commented Jan 19, 2022 at 13:10
  • Uf! I had struggling with that all this year along, suddenly my files stopped to sync!!! So, tomorrow Apr-03-22 will this be fixed? Great!!!!
    – tatojo
    Commented Apr 2, 2022 at 23:54
5
  • Your example works fine both with miktex and texlive when I use sumatra as viewer and winedt as editor.

  • With texstudio I can confirm that it works with miktex but fails with texlive with lualatex but works with pdflatex.

If one expect the synctex files one can see one difference which could be the source of the problem:

miktex with lualatex

(1,6:8799518,8865054:22609920,436470,0
h1,5:8799518,8865054:983040,0,0
x1,5:10110238,8865054          %<---------
g1,6:31409438,8865054
g1,6:31409438,8865054
)

texlive with lualatex

(1,6:8799518,8865054:22609920,436470,0
h1,5:8799518,8865054:983040,0,0
x1,5:10110238,0                %<--------- 
g1,6:31409438,8865054
g1,6:31409438,8865054
)

texlive with pdflatex

(1,6:8799518,8865054:22609920,422343,0
h1,5:8799518,8865054:983040,0,0
x1,5:10110239,8865054          %<---------  
k1,6:31409438,8865054:21299199
g1,6:31409438,8865054
)

I can't tell you if it is a bug in lualatex to produce a zero there, or if it is a bug in texstudio that it (probably) can't handle it. Your best bet for an answer is probably the texlive mailing list.

Update

Akira Kakuto announced a change in luatex for texlive 2022.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .