1

I'm experiencing the following issue when using todonotes along with TikZ and its externalize library. If my document contains no \todo's then it compiles just fine and seems like the externalization of TikZ does it trick. However, once there are \todo's in the document, then some of them fail the compilation.

If I surround such a problematic \todo as follows:

 \begingroup
  \tikzexternaldisable
  \todo{Note's content}%
  \tikzexternalenable
  \endgroup

Then the compilation runs smoothly again. So, the next step is naturally to re-define the \todo. Thus, in the preamble I added the following:

\makeatletter
\renewcommand{\todo}[2][]{%
  \begingroup \tikzexternaldisable
  \@todo[#1]{#2} \tikzexternalenable
  \endgroup}
\makeatother

and everything seems to be right. The problem I have is that I stuffed all my preamble in a separated .sty file. When I move the last snippet to the .sty file then the problem occurs again. (The last snippet is coming from this answer). Otherwise, the .sty file loads correctly, as far as I can tell.

Summary: My question is why the same code when it is in the "main" file behaves as expected, but when it is moved to a style file which is loaded (correctly) it doesn't work anymore. I guess it has nothing to to in particular with neither TikZ nor todonotes - but I mention them as they caused a problem in my case.

1
  • What happens if you put only \tikzexternalize in your document instead of the style file?
    – T. Verron
    Oct 24, 2012 at 8:51

1 Answer 1

2

It's not clear from your question but in the package file just put

\renewcommand{\todo}[2][]{%
  \begingroup \tikzexternaldisable
  \@todo[#1]{#2} \tikzexternalenable
  \endgroup}

I suspect you put \makeatother in there which would flip the meaning of @ so break any following uses of it in the package.

2
  • I'm afraid that this is not the case. Your suggestions didn't help. Thanks anyway!
    – Dror
    Oct 24, 2012 at 8:42
  • 1
    sometimes you without an MWE you guess wrong:-) (but I see you note that in your answer:-) Oct 24, 2012 at 9:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .