user797257
user797257

Reputation:

Make Emacs open pdf/dvi after tex-view in a new buffer

In TeX mode I can compile (region / buffer) and then ask Emacs to show what was compiled by running M-x tex-view or C-c C-v, however, when this command runs it looks into tex-dvi-view-command variable for the program to open the recently compiled file.

There are two problems with this approach now:

  1. The text color in the generated DVI is the same as in the Emacs buffer, but the background is not (I get white text on white background...), but it can be the problem of the particular program it is using to display it, not sure yet. Ocular shows black text on white background.

  2. It opens in dvi viewer. But I would like it to open in Emacs (Emacs can display PDF / DVI on its own, no need for external viewer).

So, my question is: is there a common way to achieve this (esp. #2) or I'll have to add that function myself?

Upvotes: 1

Views: 1018

Answers (1)

Greg E.
Greg E.

Reputation: 2742

I haven't used the specific feature that you've described, but I would imagine that if you ran emacs as a server (q.v., Using Emacs as a Server), you could set tex-dvi-view-command to use emacsclient, in which case the file would be opened in a new buffer in your current emacs session.

Upvotes: 2

Related Questions