You are here

Workflow for submitting journal articles with Tikz figures

winstead's picture
Submitted by winstead on Wed, 02/12/2014 - 07:15

When writing articles with LaTeX, I strongly encourage using Tikz for figures, and PGFplots for showing data curves. There are lots of advantages to using these packages, but sometimes journals are not prepared to accept all of your raw data and TikZ code. In the final stages of submission, you may need to translate your TikZ figures into PDF or EPS files so that they can be reliably processed by the publisher. Here is some advice for handling the conversion:

From the beginning, make sure your TikZ figures are well organized in external files. I usually create a directory called "figures" and place my plots and illustrations in that directory, with the "tikz" extension. Then in your main tex file, a typical figure declaration should look like this:

\begin{figure}[ht]
  \centering
  \input{figures/my_plot.tikz}
  \label{fig:some label}
  \caption{Here is some caption for my plot.}
\end{figure}

If you have prepared a complete article for submission to a journal, then there will probably be many such figures. To convert them to PDF files, use the preview package by placing these lines in your document preamble:

\usepackage[active,pdftex,tightpage,delayed]{preview}
\PreviewEnvironment{tikzpicture}

Now if you compile the document again, you will get a PDF file that contains only the Tikz figures. Use a program like pdfsam to split the PDF into individual figure files, and give them names like "fig1.pdf", "fig2.pdf" and so on. Place all of these files in the "figures" directory. Finally, for each figure in your latex file, make a change like this:

\begin{figure}[ht]
  \centering
  %\input{figures/my_plot.tikz}
  \includegraphics[scale=1]{figures/fig1.pdf}
  \label{fig:some label}
  \caption{Here is some caption for my plot.}
\end{figure}

These changes need to be made carefully, one at a time, to replace the TikZ figure with the newly produced PDF version. After making the changes, recompile your document and verify that you got all the right figures in the right places. Your document should look exactly the same as the original version with the TikZ figures.

When making the final submission, prepare a "clean" version of your document directory, containing only the main tex file, the bibliography and the PDF figures. The journal editors don't want any extraneous files, just the ones needed to reproduce the final article.

These steps are usually only needed in the last stage or publication, after an article has passed peer review. I discovered today that this procedure was necessary to complete a pre-print submission at the arXiv, so I though it might be useful to post the procedure here.