« first day (14 days earlier)      last day (40 days later) » 

cfr
cfr
02:03
  auto key={/tcb/breakable}{run if memoizing, outer handler=\makeunmemoizableunless{false}},
  auto key={/tcb/float}{run if memoizing, outer handler=\makeunmemoizableunless{}},
}

\def\makeunmemoizableunless#1#2\pgfeov{%
  \ifstrequal{#1}{#2}{}{\mmzUnmemoizable}%
  \AdviceOriginal#1\pgfeov
}
@SašoŽivanović I think I understand the point in the breakable case, but why this method for float? Following (I thought), the manual, I tried auto key={/tcb/float}{unmemoizable}, but I guess that only works for explicit cases. So I probably need to make the configuration more fine-grained.
 
5 hours later…
07:32
@cfr If I remember correctly, the issue was that tcolorbox executes both these keys internally, with some argument. But I might be wrong and your suggestion about float works just as well.
 
5 hours later…
12:45
@cfr Here's a new version of auto/to context, which works for internal (@ and expl3) macros as well.
\documentclass{article}

\usepackage{memoize}
\usepackage{tikz}

\makeatletter
\mmzset{
  auto/to context/.style={run if memoizing, outer handler=\mmz@auto@tocontext},
}
\def\mmz@auto@tocontext{%
  \begingroup
  \escapechar=-1
  \xdef\mmz@global@temp{\expandafter\string\AdviceName}%
  \endgroup
  \expanded{%
    \noexpand\mmz@mtoc@cs{%
      advice@o\AdviceNamespace//%
      \unexpanded\expandafter{%
        \expandafter\expandafter\expandafter\string
        \expandafter\csname\mmz@global@temp\endcsname
It uses internal Advice stuff, though, namely the internal control sequence publicly accessible by \AdviceGetOriginal. I'll put this into the next release.
 
2 hours later…
cfr
cfr
14:50
@SašoŽivanović That's fantastic! Do you mean to context will be in the next release or you'll expose the internal control sequence?
@cfr The former. (Also, in the meanwhile, I managed to make the necessary stuff public in Advice, so that Memoize doesn't hack into Advice's internals. But I can't post that here, as there are changes in the package.)
cfr
cfr
@SašoŽivanović Ah. I thought the breakable case might be designed to allow float=false to get memoized.
Many thanks for the idea!
cfr
cfr
@SašoŽivanović Thank you very much.
The tcolorbox stuff is messy ;). I get errors on first compilation regardless and, if I'm not careful, the thing doesn't even get marked as unmemoizable, so I get errors every run. And there doesn't seem to be anyway to recover. I suppose that's my fault for trying to memoize tcolorboxes ....
@cfr Messy interactions, indeed. I plan to contact the author, once I get the new release out, to see if he'd be willing to support Memoize.
cfr
cfr
15:04
@SašoŽivanović It works for some cases external doesn't, though. Would it be better to use auto={<environment>}{nomemoize} rather than auto={<environment>}{unmemoizable}?
I guess it is better since the latter doesn't actually work at all. (The code never gets marked so compilation just keeps failing.)
@cfr Ahh, I see the confusion (most likely the result of my bad docs). Auto-key nomemoize is meant to be applied to a given (command or) environment, to disable memoization for that environment. You use it for environments which are inherently impossible to memoize, perhaps because they use tikzpicture under the hood in funky ways, and not saying auto={env}{nomemoize} would attempt to memoize those internal pictures and fail.
unmemoizable, on the other hand, is meant to be applied to commands which can occur in some environment (like a tikzpicture) which is normally memoizable, but that command causes trouble if the author uses it in there. It is analogous to abort. TikZ's remember picture has abort set (and unmemoizable would work as well), so that those and only those pictures with remember picture get aborted.
So if you want to simply prevent memoization of all those tikz pictures used by tcolorbox internally, you say auto={tikzpicture}{nomemoize}.
cfr
cfr
@SašoŽivanović More likely my bad reading of them.
@cfr A contest! :D
cfr
cfr
@SašoŽivanović This was helpful until I got to this bit. Now I'm lost.
Won't that stop all memoization of all tikzpictures whether internal or not?
@cfr My bad, I should've written auto={tcolorbox}{nomemoize}, of course.
@cfr Indeed it would.
@cfr You see, my bad writing wins. :-)
cfr
cfr
15:18
@SašoŽivanović Not auto={tikzpicture}{unmemoizable}?
@SašoŽivanović :)
@cfr No, because tikzpicture, when contained in other environments, like forest, doesn't break their memoization.
cfr
cfr
@SašoŽivanović Not all tikzpictures inside tcolorboxes break memoization either. But I meant more would auto={tikzpicture}{unmemoizable} mark only internal tikzpictures? That is, simple tikzpicture environments would still get memoized?
@cfr Yes, they would.
@cfr unmemoizable only applies inside memoization. nomemoize prevents memoization from ever taking place.
cfr
cfr
@SašoŽivanović Thanks.
So if you use tcolorboxes macros to create new environments, you need auto={<environment>}{<memoize>|<nomemoize>} for each one, but you can't then use the same environment name for both floating and non-floating or both breakable and non-breakable?
@SašoŽivanović Actually, you can. The problem is only if float is default, is that right? You can't define a tcolorbox as float or breakable and then override it and have it memoized ....
15:39
@cfr I believe you're right. And even this should be doable with proper support from tcolorbox itself.
cfr
cfr
@SašoŽivanović OK. Thanks. It helps to know whether what I'm trying to do is possible or not ;).
@cfr Thank you for diving into all this!
cfr
cfr
@SašoŽivanović Thank you for writing it! I have purely selfish reasons for wanting to use it ;). Even if I can't at the moment. Except for tikz-cd, almost everything I've tried is straight out of a custom class I use to create course materials. I currently rely on a wrapper around the external library and a bunch of disable commands. It works, except when it doesn't. Oh, and the glossaries take 16 writes :(.
I haven't tried with Beamer yet, though, because that sounded complicated.
@SašoŽivanović Should memoize deal OK with tikzpicture environments invoked indirectly by commands? I guess this should work, but tikzscale may not ....
16:01
@cfr The former, sure. The latter, probably not out of the box ...
cfr
cfr
@SašoŽivanović That's what I thought ....
cfr
cfr
16:17
@SašoŽivanović I ask because I can't test easily as the code uses morewrites and it would be a pain to pull the glossaries stuff out. I keep meaning to make it more modular, but ... haven't.
@SašoŽivanović Thanks for all your help & patience.

« first day (14 days earlier)      last day (40 days later) »