0

I have some pdf figures that I generated in Mathematica with latex labels using matex. I need to update the labels on the figures, but I generated them a few years ago and I can't get the Mathematica code to run again now. Would there be some reasonably straightforward way in latex to put new figure labels on top of the old ones? I would prefer a method which would modify the pdfs of the figures themselves. I am importing them into a latex document, so I could add commands into my document to do this if necessary.

Here is one of my figures as an example enter image description here

Jojo
  • 111
  • (i) convert pdf image to epd, (ii) use psfrag package and replace desired labels. (I never used). – Zarko Feb 21 '22 at 12:13
  • What exactly do you mean with 'labels'? Do you mean tick labels on the x-axis and y-axis of a line chart or something? Or edge labels on a network graph? Or some kind of caption or figure title at the top or bottom? – Marijn Feb 21 '22 at 13:13
  • 1
    @Marijn edge labels on a network graph, I've added an example to my question – Jojo Feb 21 '22 at 13:34
  • Maybe something like https://tex.stackexchange.com/a/451833/ would work, when you draw a white filled rectangle with the new label in it over the current label. – Marijn Feb 21 '22 at 13:42
  • @Marijn, oh yeah this is the kind of thing I had in mind. I can't work out, are they putting white rectangles down in the example code that you linked? Or is that your additional idea? Can I get some kind of text command in Tikz that has a solid white background do you think? – Jojo Feb 21 '22 at 15:20
  • [fill=white] will hide the background. Don't remember if it also hides the new text. – John Kormylo Feb 21 '22 at 15:34
  • @JohnKormylo, do you mean [fill=white] in \node at (x,y) {text}? – Jojo Feb 21 '22 at 18:08
  • @joe - Das ist eine grosse Zehn Vier gutter Kamerad! (yes) *from Black Forrest Bluegrass by PDQ Bach – John Kormylo Feb 22 '22 at 13:57
  • @JohnKormylo, glad you included the '(yes)', the rest was totally lost on me haha – Jojo Feb 23 '22 at 13:02

1 Answers1

1

Using tikz as in this question linked to me by Marijn in the comments, and using [fill=white] as suggested by John Kormylo, I solved the problem like this;

\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[scale=0.2]{giffrommyquestion}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
 \node [fill=white,scale = .9] at (.48,.32) {$|0]\langle0|$};
 \node [fill=white,scale = .9] at (.48,.15) {$\alpha|4]\langle1|$};
\end{scope}
\end{tikzpicture}
Jojo
  • 111