TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Quite often while typing in emacs I will LaTeX a file just to see whether I am including the right figures in the right order. Is there an emacs package that will either:

  • show the figure within the latex source file or
  • show the figure when the mouse hovers over an \includegraphics command?

The idea is to truly ignore the typesetting while one is typing and to delay the latex iterations as long as possible.



Some text...


Some more text...


In the example above, I'd like emacs to show me the content of 'figure.pdf' whenever I hover over \includegraphics.

share|improve this question

migrated from stackoverflow.com Nov 23 '11 at 20:35

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Nov 23 '11 at 20:38

Well, this is far from a satisfactory answer, but probably too long for a comment.

You might want to read the docs for preview-latex, particularly chapter 4 "Simple customization", section "Preview your favourite LaTeX constructs". (Notice: I did not actually check it, and I don't know enough about dvipng to be sure that this would work.) If it works, it does in a weird way: it would typeset a small LaTeX document, bascially with only your \includegraphic command, convert the resulting dvi to png, and put it there. This means that it most probably won't work for jpg/pdf files (and if it will, then only for jpg and if you give the bounding box manually), but might work for eps files. (And this would require typing some keychord instead of hovering your mouse, probably.)

Another idea would be to look into preview-latex source and try to do something similar for jpgs/pdfs. Notice that you'd have to take care of the size of bitmaps; I would imagine using convert to, well, convert them to some reasonable size.

share|improve this answer
I'm studying your suggestion and will report back shortly, but in the meantime I have a comment regarding migrating questions... Are you also surprised that this question has everything to do with emacs and much less to do with latex in particular? I wish the point collectors would at least ask in which venue the OP would like to post. – Calaf Nov 24 '11 at 0:56
Well, I am indeed, but notice that there are probably more TeX users here than on stackoverflow.org. (Personally, I'd ask this on some emacs mailing list anyway.) – mbork Nov 24 '11 at 8:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.