Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TikZ externalization compatibility: only create cache directory if needed, patch or amend docs #73

Closed
gpoore opened this issue Apr 21, 2015 · 5 comments

Comments

@gpoore
Copy link
Owner

gpoore commented Apr 21, 2015

Based on this TeX.SE question, TikZ externalization and minted caching are inefficient when used together.

  • The docs need to be amended to deal with this case. Also, should consider automatically checking for TikZ externalization.
  • Caching needs to be modified, so that directories are only created at the last possible moment, once we are sure that they will indeed be needed.
@patrickvogt
Copy link

Hi, is it possible, that this patch introduced problems with the order of the \tikzexternalize and \usepackage{minted} command? See: Problem, when loading minted after \tikzexternalize

@gpoore
Copy link
Owner Author

gpoore commented Oct 1, 2015

Yes, it looks like there is an issue with the order. In the example case that inspired the fix, \tikzexternalize was used after minted was loaded. The case you are looking at uses \tikzexternalize first. I should be able to modify the check for externalization relatively easily, so that the order doesn't matter.

@gpoore gpoore reopened this Oct 1, 2015
@patrickvogt
Copy link

Hi, I think I found a fix for the issue. Maybe you wanna try it:

Expand the following code:

\ifcsname tikzexternalrealjob\endcsname
    \minted@drafttrue
    \minted@cachefalse
\else
\fi

with:

\ifcsname tikzifexternalizing\endcsname 
    % if \tikzexternalize is set before \usepackage{minted} this branch is used
    % the true branch of the \tikzifexternalizing will only be used if the tikz externalizing job is running at the moment
    \tikzifexternalizing{\minted@drafttrue\minted@cachefalse}{}
\else
   % else this old code will be used which will definitely work in all other cases (when \tikzexternalize is set after \usepackage{minted})
    \ifcsname tikzexternalrealjob\endcsname
        \minted@drafttrue
        \minted@cachefalse
    \else
    \fi
\fi

\tikzifexternalizing will only be true when the externalization job runs (according to thepackage documentation)

@gpoore gpoore closed this as completed in ce7a111 Dec 21, 2015
@gpoore
Copy link
Owner Author

gpoore commented Dec 21, 2015

@patrickvogt This is fixed, using your suggestion. If you'd like to be listed in the minted acknowledgements for this, let me know, and I'll do that.

@patrickvogt
Copy link

Hi,

If you'd like to be listed in the minted acknowledgements for this, let me know, and I'll do that.

This would be cool. Thanks for maintaining and enhancing the minted package. I really like this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants