Inverse search with SumatraPDF


#1

Does anyone know how to set up inverse search with sumatra pdf? The sumatra-forwardsearch package works when compiling latex files, but I have not be able to get inverse search working. Thanks for your help.


#2

As far as I know Atom currently cannot open a file at a specific line from the command line, so I don’t think this is possible.


#3

Atom can open files at specific lines, but there is a bug with the feature depending on how you do it:


#4

Aha, I did not know that. :smile:

In that case, in theory something like this should work, perhaps once the bug is fixed. Assuming SumatraPDF is in your path, if not cd to its directory, execute the following in your console or command prompt:

SumatraPDF.exe -inverse-search "\"C:\Path\To\atom.exe\" \"%f:%l\""

#5

In case of someone still could not make it work, I entered the following command in the “Set inverse search command-line” field in the Settings panel of SumatraPDF,

C:\Users\<User>\AppData\Local\atom\bin\atom.cmd %f:%l

This works as of Atom v1.8 and SumatraPDF 3.1.1 on Windows 10.

Hope this helps.


#6

I found that this version works the best, that way if there are spaces in your directory names it still points to the right location.

C:\Users\<User>\AppData\Local\atom\bin\atom.cmd "%f:%l"

I also entered it in the “Set inverse search command-line” field in the Settings panel of SumatraPDF.