weixin_39902345
weixin_39902345
2020-12-02 02:59

issue with sumatraPDF inverse search

I am using win 7, Atom 1.14.2 (portable version, no install), sumatraPDF 3.1.2.

After compiling any .tex file, sumatraPDF is automatically opened. But the inverse search won't work. Alongside the compliled pdf file, two more tabs in sumatraPDF opens, one says "Error loading C:\path-to-Atom\(x86)\Atom\atom.exe "%f.%l"". Now, my atom is in the C:\path-to-Atom\ folder, not in C:\path-to-Atom\(x86)\Atom. In fact this folder doesn't exist. The other opened tab says "Error loading C:\path-to-Atom\Files", which doesn't exist.

If I now correct the inverse search path in sumatraPDF manually, inverse search will work temporarily. But next time I compile something in atom and open sumatraPDF again, it stops working.

If I installed atom in the system, everything works.

该提问来源于开源项目:thomasjo/atom-latex

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

8条回答

  • weixin_39902345 weixin_39902345 4月前

    Oh.... I think I know the direct reason for this bug now. It's because my path to Atom contains an empty space in D:\Program Files... Then, when latex package invoke sumatra, in the inverse search path it renders D:\Program. That's it. If I place Atom somewhere with no white space in the path, everything works.

    点赞 评论 复制链接分享
  • weixin_39662263 weixin_39662263 4月前

    You can simply wrap the path to the Atom in SumatraPDF with quotes. So, with this it will work:

    "C:\path-to-Atom\(x86)\Atom\atom.exe" "%f.%l"
    
    点赞 评论 复制链接分享
  • weixin_39902345 weixin_39902345 4月前

    Unfortunately no. I was using the quote marks by default, and it does not fix it. I mentioned that you can manually fix it one time, but the next time you open up SumatraPDF, it will still fail. Maybe this is because synctex or atom is feeding the wrong path to SumatraPDF?

    点赞 评论 复制链接分享
  • weixin_39535349 weixin_39535349 4月前

    atom-latex is going to reset the inverse search command each time a new document is opened.

    Can you check on a few things for us?

    1. Restart Atom
    2. Verify that sumatra is explicitly selected as the opener in the settings page.
    3. Compile a LaTeX document and open resulting PDF from Atom.
    4. Get the current setting of the inverse sync option.
    5. Try inverse sync. iIf it doesn't work, what setting does work?
    点赞 评论 复制链接分享
  • weixin_39902345 weixin_39902345 4月前

    1. Restarted atom many times. Tested on multiple machines. I cleaned .atom and texlive and reinstalled everything to confirm. 2. Yes. 3. Did it - 4. Let me make this extra clear again. In SumatraPDF, it should be "D:\Program Files\Atom\Atom.exe" "%f.%l" This is where my Atom is. but now just "D:\Program Yes double quote at the beginning, but missing the rest. At the same time, there is a separate tab opened in Sumatra with the title atom.exe" "%f.%l" (yes I got the quotes right.) In this tab there is nothing but an error message Error loading D:\Program Files\Atom\Files\Atom\atom.exe" "%f:%l" This path does not exist. Before D:\ there is no double quote, but there is a double quote at the end of the path .exe". 5. Does not work obviously. Manually set the path to "D:\Program Files\Atom\Atom.exe" "%f.%l" would work one time. But next time open SumatraPDF it will go back to square one. If I move Atom to D:\Atom\, without a white space in the path, things go smoothly without any problem. By smooth I mean inverse sync will go though, the path in smatraPDF is the correct path. There is no extra tab containing error msg opened in SumatraPDF. 6. I am using atom windows x64 1.15.0 zip. Texlive 2016. Windows 7. SumatraPDF 3.1.2 x64 portable.

    点赞 评论 复制链接分享
  • weixin_39535349 weixin_39535349 4月前

    Thanks

    I'll try to reproduce and find a fix. I'll let you know if we need more info.

    点赞 评论 复制链接分享
  • weixin_39535349 weixin_39535349 4月前

    I have reproduced the bug and put a fix into #357 which will be merged soon. Thanks for reporting the isssue!

    点赞 评论 复制链接分享
  • weixin_39902345 weixin_39902345 4月前

    Thanks a lot for the fix!

    点赞 评论 复制链接分享