olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 14 forks source link

Manage graphics states #60

Closed vlasakm closed 3 years ago

vlasakm commented 3 years ago

PDF page resources (like ExtGStates) in the pdfTeX model are settable only using \pdfpageresources primtive token register. While that is enough if the register has a single user, it requires a more thorough mechanism for anything more substantial.

I think in OpTeX we reached that point. Shadows and slide layers already used the register, now with the (coming) addition of transparency OpTeX trick and already existing clash with TikZ we have to do something about it.

The implemented solution either hooks into PGF/TikZ's way of managing PDF page resources or creates our own (very similar) mechanism. The principle is to set \pdfpageresources to point to pretty much a single global dictionary of ExtGStates (or other resources) that applies to all pages.

The global idea is of course prone to naming clashes. Another catch is that, for example only one value of shadow transparency can be used per document. But that was the case previously as well.

olsak commented 3 years ago

Thanks, it seems more better than original implementation of features based on \pdfpageresources.