Using Visual Studio Code with SumatraPDF to open LaTeX source files

0

When you double click on a PDF file opened with SumatraPDF in Windows OS, it'll invoke a command (see the blue rectangle in the following image).

enter image description here

If the PDF file and its LaTeX source file are in the same folder, then double clicking on the PDF file will open the source file with notepad. However, I do not know what to enter instead of notepad %f so that the source file is opened in Visual Studio Code. Any ideas?

Opt

Posted 2019-03-15T10:54:06.053

Reputation: 103

Associate the source file with vscode. – Biswapriyo – 2019-03-15T13:12:24.707

@Biswapriyo I meant double-clicking on the PDF file so vscode opens the source file (this is currently the case for notepad not vscode). I didn't mean double-clicking on the source file. – Opt – 2019-03-16T02:09:16.903

And how vscode will know the corresponding source file of that specific PDF? – Biswapriyo – 2019-03-16T15:12:53.983

@Biswapriyo I just know that notepad can recognise the corresponding source file. I think vscode is advanced enough to be able to do that, but I don't know how. – Opt – 2019-03-17T08:47:40.653

Doesn't code %f work? – ihmels – 2019-03-17T16:22:36.357

@ihmels I already tried this and some variants of it but none of them works. It says "Can't start inverse search command". – Opt – 2019-03-18T02:46:47.343

No answers