AUCTeX inverse search with region or buffer compilation

by Ryan Kavanagh   Last Updated May 23, 2019 00:23 AM - source

I have inverse search working great with single-file documents with Zathura. Unfortunately, things break down when I try to do inverse search when viewing a region of my document, or a buffer in the case of multifile documents.

AUCTeX compiles the desired region (C-c C-r) or buffer (C-c C-b) by copying it to a file called _region_.tex, along with the preamble of the main document. However, when I try to do inverse search on the resulting PDF, rather than getting sent to the original source file, I get sent to _region_.tex. I've been burned by accidentally editing that file instead of the desired source file, and then loosing those changes.

How can I get inverse search to work in this case? Here is the "View" command AUCTeX uses.

zathura --synctex-forward 482:0:source.tex -x "emacsclient +%{line} %{input}" _region_.pdf

I am using AUCTeX 12.1.2 under emacs 25.2.2.

Related Questions

Emacs AUCTeX View command

Updated September 26, 2018 16:23 PM

make auctex look for .synctex.gz file in a subfolder

Updated September 16, 2017 12:23 PM

Emacs with AucTex won't compile LaTeX documents

Updated April 16, 2015 21:10 PM

Adding keybord shortcut for AUCTeX in Emacs

Updated April 20, 2015 05:10 AM