visual-studio-codelatextexsynctex

How To Inverse Search From Internal PDF Viewer To The Actual Code in VS Code for a Latex Doument


I am using VS Code and in it, I am using LaTeX Workshop by James Yu. I am trying to compile my document using LaTeX Workshop. When I compile my code to a pdf file, I can double click or ctrl + click on a word in the pdf to go to that line of code which produced that output. But, when it comes to doing the opposite, that is going from the line of code to that specific line in the PDF, I am unable to do so. I have scanned all the settings available to me and I can't figure out what to do. I am using the internal pdf viewer and everything is working fine for me.

I did google the problem and there are solutions available for external pdf viewers but nothing for internal pdf viewer. I don't want to switch to any external pdf viewer since everything is working fine for me till now in the internal pdf viewer.

So, it would be really helpful if someone pointed out to me what I am missing. Essentially, I want to double click or ctrl click on a word in my tex code and be taken to that word in the pdf if that's possible or at least in the range of that word in the pdf.

I am fairly new to LaTex. So, this is my first long document. Trying to figure out stuff as I do.

enter image description here

Thank you in advance for helping.


Solution

  • Try This:

    To go from editor to internal pdf viewer's pdf:

    Ctrl + Alt + J (command + option + J in macOS)

    To go from internal pdf viewer's pdf to editor:

    Double Click or Ctrl + Click (command + click in macOS)

    You can choose one at the settings here in vs code:

    latex-workshop.view.pdf.internal.synctex.keybinding
    

    Cheers!