[Tex/LaTex] Question about including tikzpicture in a research paper

ieeeconfieeetrantikz-pgf

I am using \documentclass[conference]{IEEEtran} for writing a paper. I will be using tikz environment for drawing figures. Some figures will occupy only a single column, but I have a couple of figures that will occupy both.

For drawing figures, I have two options:

  1. I create separate .tex-files for drawing my block diagrams and then import the fig.pdf in my paper.tex by using \begin{figure} .... \end{figure}
  2. Include tikz code directly in my paper.tex

Which one is a better option? I am more inclined towards option 2 but am not aware of any problems if I use this option.

Best Answer

I would suggest doing your preparation with TikZ, as Przemysław Scherwentke comments, it's much easier if you want to edit your diagrams - and it would be foolhardy to assume this will never be necessary.

Yet at the same time it's likely - and I think the best way to confirm is to contact the relevant journal itself - that the journal will want a separate file for the graphic. Though this is not necessarily because they can't process TikZ, but so they can include the image separately on an article's webpage for example.

To this end a sensible workflow might be to use in the article

\begin{figure}
\input{tikzcode}
\end{figure}

and have a separate file tikzcode.tex which contains the TikZ code, alongside a second file to compile just the image (https://tex.stackexchange.com/a/29821/106162)

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\input{tikzcode}
\end{document}

You can then replace the \input{tikzcode} with \includegraphics{tikzstandalone} which links to a PDF copy of the image if necessary. By using \input{tikzcode} like this you always have the latest version of the image when you just compile the main article, yet it's very quick to switch to using a separate image if/when necessary.

The TikZ external library should alternatively allow for including the TikZ code in the main file and using it to generate separate files for all the images as well (https://tex.stackexchange.com/a/271475/106162).

There are I guess some things which can be done in TikZ but not (easily?) replicated when importing a graphic, like references in the tikzpicture Compiling a tikzpicture including \ref but from my own experience, I've yet to construct anything in tikz that would suffer (other than by way of customisability) from generating a pdf of the image and using \includegraphics{}.

Related Question