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

Okular opens .tex file instead of .pdf #1561

Open
RJDan opened this issue Jun 21, 2022 · 1 comment
Open

Okular opens .tex file instead of .pdf #1561

RJDan opened this issue Jun 21, 2022 · 1 comment

Comments

@RJDan
Copy link

RJDan commented Jun 21, 2022

Building a tex file results in Okular trying to open the .tex file instead of the pdf.

I think this may be a snap issue but I can't be sure.
I recently move both Okular and sublime from the ppa install to snaps. Both work fine but building the .tex file results in the following error:

Could not open file:///home/XXXX/.cache/sublime-text-3/Cache/LaTeXTools/dbf46e7462bf661bf33ff56bbe21196e/FILE_220529.pdf%23src:36/home/XXXX/FILE_220529.tex. 

When I sway to using Evince, it does not start up at all on build (also snap package).

Okular : Version 20.12.3
Sublime Text: Stable Channel, Build 4126
Ubuntu Jammy
Asus Tuf A15

@ig0774
Copy link
Contributor

ig0774 commented Oct 16, 2022

So, this isn’t going to solve things, but a bit of a comment on what’s happening here:

In order for forward and reverse sync to work, i.e., to open the PDF at the “same” spot as in the editor and vice versa, when opening the PDF file in Okular, we pass the file and line number in the TeX file in addition to the PDF name. This is done via a hash so we end up running something like:

okular file://<path_to_pdf>.pdf#src:<line>:<path_to_tex>.tex

This is a URL that should resolve to the PDF with a locator (the bit after the #) to tell it where it goes.

In the error message you show above, the # has been converted to %23, so when this gets to Okular, it isn’t being interpreted correctly.

I’m not exactly sure where that conversion from # -> %23 is happening, but it’s outside of LaTeXTools itself.

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

No branches or pull requests

2 participants