Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

Let us assume that we have a graph created by a program different from LaTeX (that is not with PStricks or Tikz). I was wandering if it is possible to incorporate mathematical symbols on that graph using a TeX editor.

Thank you.

share|improve this question

marked as duplicate by Werner, Peter Jansson, Malipivo, Adam Liter, Svend Tveskæg Apr 14 at 21:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

\stackinset from the stackengine package. See page 20 of the documentation in stackengine.pdf at ctan.org/tex-archive/macros/latex/contrib/stackengine –  Steven B. Segletes Apr 14 at 18:44
If it is an .eps file and there is some text in this graph file, the text can be replaced from LaTeX using the \psfrag command from the corresponding package, but this collides with pdflatex nowadays a little bit –  Christian Hupfer Apr 14 at 18:44
@StevenB.Segletes this looks awesome. I will give it a try when I have time. I suppose the package is already in the MikTeX right? –  Pantelis Kazakis Apr 14 at 18:48
sounds quite a lot like: Drawing on an image with TikZ –  cmhughes Apr 14 at 18:50
Package overpic can do it without TikZ. –  Heiko Oberdiek Apr 14 at 19:26

1 Answer 1

up vote 9 down vote accepted

Basically, this is using the example of the stackengine documentation, adapted for use in math mode with the addition of \stackMath in the preamble.

The routine you want is \stackinset which has 6 arguments, \stackinset{H-anchor}{H-offset}{V-anchor}{V-offset}{inset}{underlying anchor image}. As shown here, it can be nested and the insets themselves can be stacks.

\stackinset{l}{ .1in}{b}{.2in}{y=mx+b}{%
\stackinset{r}{ .1in}{t}{.2in}{\Longstack{F_x=ma_x\\F_y=ma_y}}{%
\stackinset{r}{ .8in}{b}{.6in}{\psi^2=0}{%
\stackinset{r}{ .1in}{c}{.0in}{\imgi}{%

enter image description here

share|improve this answer
if this question gets closed, you might post your answer here: Drawing on an image with TikZ –  cmhughes Apr 14 at 18:51
@Steven Yeah, I saw that. Looks splendid :) –  Pantelis Kazakis Apr 14 at 18:51
@cmhughes I specifically said that I want to manipulate a graph not made by PStricks or Tikz. –  Pantelis Kazakis Apr 14 at 18:55
@PantelisKazakis: The linked question is about drawing on an image... and that's that. That image could have been made using PStricks, TikZ, a camera, or whatever... –  Werner Apr 14 at 19:02
@Werner I will follow Steve's way. It is quite neat! –  Pantelis Kazakis Apr 14 at 19:03

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