Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using tikzscale with tikz external library in the list and make mode. Before using tikzscale, if I issued make -f main.makefile command, only the figures that were not present would be generated. But since I have started using tikzscale, all the figures are regenerated even if they exist already. This takes a lot of time for compilation of a long document. Please go through the MWE and let me know if I have set up everything correctly.

The testing sequence on a linux machine is:

pdflatex main.tex
make -f main.makefile
ls -l main-figure0.pdf
make -f main.makefile
ls -l main-figure0.pdf

One can see that the figure is generated again from the timestamp.

MWE

\documentclass{report}
\usepackage[showframe=true]{geometry}
\usepackage{filecontents,tikz}
\usetikzlibrary{external}
\tikzexternalize[mode=list and make]
%Comment out to external work properly without tikzscale
\usepackage{tikzscale}

\begin{filecontents}{fig.tikz}
   \begin{tikzpicture}
      \draw (0,0) rectangle (1,1);
   \end{tikzpicture}
\end{filecontents}

\begin{document}
  \begin{figure}
    \includegraphics[width=\textwidth]{fig.tikz}
    %Uncomment to see externalize work properly without tikzscale
    %\input{fig.tikz}
    \caption{Test figure}
  \end{figure}
\end{document}
share|improve this question
    
@MartinScharrer external works with tikzpicture \input from external files. Please see the modified MWE. Since .dep files are being create, I am assuming that external sees the environment. I will have to look into your package. –  devendra Jan 3 '13 at 9:22
    
Sorry, forget me previous comments (I deleted them now including your response). tikzscale works differently then the mentioned gincltex because the latter scales the text size as well. standalone also doesn't have support for keeping the text size constant because it is not TikZ-specific. The tikzscale manual actually states in section 3.2 that it is compatible with the external library. –  Martin Scharrer Jan 3 '13 at 9:22
    
Did you see this in the tikzscale package? Section 4: When the external library is used, the graphic files get regenerated more often than necessary. This is, because the axis ratio is not saved, thus assumed unknown and the graphic is thus regenerated. For performance reasons if a default axis ratio is used, the plot is not regenerated. If a nondefault axis ratio has been used for generating the externalized graphic and the default axis ratio is used in the current run, this is not detected and the graphic has the wrong size at the moment. You can, of course, delete the [..] –  Martin Scharrer Jan 3 '13 at 9:26
    
@MartinScharrer - Yes. That happens and written down in the main-figure0.log file. However, once the figure is generated, and there has been no change in the figure.tikz file and the main.tex file then the usual external behaviour of stating that all the figures are up-to-date doesn't happen if tikzscale is used. It keeps regenerating the figures with every make run. –  devendra Jan 3 '13 at 9:34
add comment

1 Answer

This might not really be a satisfactory answer, but it's too long for a comment and it is at least a workaround.

I do not recommend using mode=list and make, as the only real advantage I see (with a current version of the external library) is generating multiple figures in parallel (the security aspect should be negligible for documents being the author oneself). Unfortunately, at least with tikzscale, race conditions have been observed when using parallelisation. So avoiding mode=list and make does not seem to have any disadvantage in practice (this might change, of course, in the future), while being more comfortable, as tex does everything on its own.

That said, main-figure0.pdf is being regenerated with my installation independent of using tikzscale or not while using mode=list and make (TikZ installation from 26th of December 2012). This might be worth a bug report if you can reproduce that. When using the default mode, no file gets regenerated if it has not been changed. I tested this with version 0.2 of tikzscale, which seems to be a bit stuck on CTAN at the moment, but it can be downloaded from github.

The above problem mentioned by Martin Scharrer is also fixed in version 0.2. With version 0.2, there is no case known, which would lead to an unnecessary regeneration (i.e. after the first tex run) with the extern library when using the default mode.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.