SumatraPDF 反向搜索

编译 LATEX 时, 在 Windows 下 SumatraPDF 是一款很不错的 PDF 查看软件, 同时还支持反向定位搜索.

设置方法:

点击 SumatraPDF 左上角菜单 — 设置 — 选项

在下面的命令框中输入命令即可, 前一个 “” 中是编辑器的位置, 根据自身情况调整.

几个软件对应命令:


TeXStudio:

“D:\App\TeXstudio\texstudio.exe” “%f” -line %l

WinEdt:

“D:\App\WinEdt\WinEdt.exe” -C=”WinEdt 10.3″ “[Open(|%f|);SelPar(%l,8);]”


Sublime Text 3:

“C:\Program Files\Sublime Text 3\sublime_text.exe” “%f:%l”

Notepad++:

“C:\Program Files\Notepad++\notepad++.exe” -n%l “%f”

“D:\App\Notepad++/notepad++.exe” “%f” -n%l

“D:\App\Notepad++/notepad++.exe” “%f” -n%l -c%c


但是, 若打开的界面没有下方的命令框, 怎么办? 那就点高级选项, 打开的 txt 文件中对照以下修改:

(还可以先编译一次, 再打开 sumatrapdf 的设置就好了)


# For documentation, see http://www.sumatrapdfreader.org/settings3.2.html

MainWindowBackground = #80fff200
EscToExit = false
ReuseInstance = false
UseSysColors = false
RestoreSession = true

FixedPageUI [
TextColor = #000000
BackgroundColor = #ffffff
SelectionColor = #f5fc0c
WindowMargin = 2 4 2 4
PageSpacing = 4 4
]
EbookUI [
FontName = Georgia
FontSize = 12.5
TextColor = #5f4b32
BackgroundColor = #fbf0d9
UseFixedPageUI = false
]
ComicBookUI [
WindowMargin = 0 0 0 0
PageSpacing = 4 4
CbxMangaMode = false
]
ChmUI [
UseFixedPageUI = false
]
ExternalViewers [
]
ShowMenubar = true
ReloadModifiedDocuments = true
FullPathInTitle = false
ZoomLevels = 8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400
ZoomIncrement = 0

PrinterDefaults [
PrintScale = shrink
]
ForwardSearch [
HighlightOffset = 0
HighlightWidth = 15
HighlightColor = #6581ff
HighlightPermanent = false
]
CustomScreenDPI = 0

RememberStatePerDocument = true
UiLanguage = cn
ShowToolbar = true
ShowFavorites = false
AssociateSilently = false
CheckForUpdates = false
RememberOpenedFiles = false
InverseSearchCmdLine = “D:\App\TeXstudio\texstudio.exe” “%f” -line %l
EnableTeXEnhancements = true
DefaultDisplayMode = automatic
DefaultZoom = fit width
WindowState = 2
WindowPos = 355 0 593 768
ShowToc = true
SidebarDx = 151
TocDy = 0
ShowStartPage = true
UseTabs = true

FileStates [
]
SessionData [
]
TimeOfLastUpdateCheck = 0 0
OpenCountWeek = 391

# Settings after this line have not been recognized by the current version
PrereleaseSettings [
TabWidth = 300
]
AnnotationDefaults [
HighlightColor = #ffff60
SaveIntoDocument = true
]


和上面一样, 只修改编辑器的地址即可; 也可以复制这段文字替换掉原来的设置, 再按照前一种方法修改.