9

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.

Pantelis Kazakis
  • 1,346
  • 1
  • 12
  • 29
  • 2
    \stackinset from the stackengine package. See page 20 of the documentation in stackengine.pdf at http://ctan.org/tex-archive/macros/latex/contrib/stackengine – Steven B. Segletes Apr 14 '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 –  Apr 14 '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 '14 at 18:48
  • @PantelisKazakis The package is about a year old. I think it is part of MikTeX, but if not, you can grab it from CTAN and place the .sty file in your working directory until you figure out how to install it. – Steven B. Segletes Apr 14 '14 at 18:52
  • @StevenB.Segletes I ckecked my MikTeX installation. I have the very late one, and YES, it is here already :) – Pantelis Kazakis Apr 14 '14 at 18:53
  • 2
    Package overpic can do it without TikZ. – Heiko Oberdiek Apr 14 '14 at 19:26

1 Answers1

13

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.

\documentclass[standard]{letter}
\usepackage[usestackEOL]{stackengine}
\stackMath
\usepackage{graphicx}
\def\imgi{\includegraphics[width=.75in]{example-image}}
\begin{document}
\stackinset{l}{ .1in}{b}{.2in}{y=mx+b}{%
\stackinset{r}{ .1in}{t}{.2in}{\Longstack{F_x=ma_x\\F_y=ma_y}}{%
\stackinset{c}{-.5in}{c}{.4in}{E=mc^2}{%
\stackinset{r}{ .8in}{b}{.6in}{\psi^2=0}{%
\stackinset{r}{ .1in}{c}{.0in}{\imgi}{%
\includegraphics[width=3in]{example-image}%
}}}}}
\end{document}

enter image description here