# Externalize pdf_tex like externalize tikz

I am using the workflow explained in this tutorial for typesetting images in my document: Tutorial for pdf_tex using inkscape Briefly, a vector image is imported into inkscape and then image itself is saved as pdf with figure labels removed and figure labels along with their positions are saved as a separate pdf_tex file. Finally that pdf_tex file is used inside figure environment. It results in perfect consistency between document and figure label fonts. The MWE can be found from the link provided along with the necessary files.

Now the problem is that many journals require labelled pdf files to be directly imported in the main tex document. I can do so by manually saving each figure separately but I am looking for something like "tickz externalize" to generate pdf files separately with correct font so that after compiling once, they may be directly used in the main document at the submission stage. Any thing like "pdf_tex externalize"? Any ideas?

When tikz externalizes a tikzpicture it basically copies all its contents into a new .tex document, which is compiled using the standalone class. So you can manually do the same thing for your incscape picture. Just create a new tex document with following content

\documentclass{standalone}
\usepackage{graphics}
\usepackage{xcolor}

\begin{document}
\input{your_incscape_file_goes_here.pdf_tex}
\end{document}


When you compile this document, you will probably get an error. I could resolve it by deleting width=\unitwidth in the *.pdf_tex file. After success compiling this document you can include the resulting pdf in your main document.

EDIT: There is also a very hacky solution, using the externalize function of tikz

\begin{tikzpicture}
\node at (0,0) {\includegraphics[width=\columnwidth]{YourIncscapeFile.pdf}};
\end{tikzpicture}


I assumed that your article will have two columns, that's why I used \columnwidth instead of \textwidth.

Remark: this gives you just the image without the text, which you have to manually place with some \node constructions afterwards. But this method guarantees that text will always have the correct size.

• Hi thanks manthano. But, when I do exactly as suggested by you, it does not result in a pdf file in the working directory. It does compile correctly, and shows correctly in the document. However, I do not find the resulting pdf file from pdf_tex file which I will have to include in the main document. – Mist Feb 17 '16 at 17:14
• @Mist do you compile using pdflatex? – manthano Feb 17 '16 at 17:18
• Yes! I am using texstudio and pdflatex – Mist Feb 17 '16 at 17:23
• @Mist then, in that case, the resulting pdf should be in the same folder as this little "script". There is no other way then manually doing this for all your incscape files – manthano Feb 17 '16 at 17:27
• Hello, I have got the pdf now. But now there is another problem. I have no control over size of pdf. I can't reduce it or increase it. One of the reasons that I use pdf_latex functionality: I can control the size of figure while keeping the size of texts same. So following this method does not fulfill that primary purpose, I am afraid. Or perhaps, I am missing something? – Mist Feb 17 '16 at 17:45