0

The following is the MWE (Following code is taken from here, with slight modifications):

\documentclass[tikz]{standalone}
\tikzset{
    use bounding box relative coordinates/.style={
        shift={(current bounding box.south west)},
        x={(current bounding box.south east)},
        y={(current bounding box.north west)}
    },
    label/.style={draw=black},
}
\begin{tikzpicture}
\node[use as bounding box] {\includegraphics{example-image-a}};
\begin{scope}[use bounding box relative coordinates]
    \node[label] (Label) at (0.3,0.3) {GR};
    \draw[stealth-] (Label.west) edge[-stealth] (0.1,0.35)
                      (Label.west) edge[-stealth] (0.1,0.25);
\end{scope}
\end{tikzpicture}
\end{document}

I am using this piece of code to just label a diagram. The format of the diagram imported to LaTeX is .jpeg . I intend to use the labelled diagram in a PowerPoint presentation. Is it possible to export the diagram labelled using TikZ?

Aim
  • 633
  • Could you please explain a bit more what you mean by "Is it possible to export the diagram labelled using TikZ?"? You can create a pdf, say, which you import in PowerPoint. –  May 17 '20 at 06:26
  • I am using LaTeX for writing a report. This report contains images (Labelled using TikZ) along with explanation. I would like to export only the labelled images preferably in .jpeg format. – Aim May 17 '20 at 06:30
  • I see. I believe externalize can do that. See e.g. this answer. –  May 17 '20 at 06:33
  • Many people use ImageMagick to create PNG or JPEG from PDF files created with LaTeX. But, with PPT on my Mac I've have best results simply dragging the PDF file from preview into a new slide. – Thruston May 17 '20 at 09:29

1 Answers1

0

This answer finds its motivation from this source.

For those of you who are using Overleaf, I found that this is fairly straightforward. First you need to compile the code once, so that the pdf file is available. Then create a file with the name latexmkrc and paste END { system('convert -density 600 -background white -flatten output.pdf page2.png'); }. Then recompile the project one more time. Now go to Logs and output files and scroll down to the end of the page, you should be able to find a file with the name page2.png. Click on that. Your image file will open in a new tab.

Aim
  • 633