loopspace / tikzmark

The dread tikzmark arrives on github
14 stars 3 forks source link

add an option to write the tikzmark position not to the aux but some other file #3

Closed u-fischer closed 5 years ago

u-fischer commented 6 years ago

Sometime it would be useful to use tikzmark position in other documents. This is difficult if the position are only in the aux-file as this file contains a lot of unrelated code. So please add an option or a command (e.g. \externaltikzmark) which allows to write the positions of all or some tikzmarks to some other file.

See e.g. https://tex.stackexchange.com/questions/391350/set-baseline-from-coordinates-in-a-standalone-tikz-image/391381#391381 for an example.

loopspace commented 6 years ago

Sounds like a very good idea. My initial thoughts are that this would be in addition to the auxfile, so that you can save only selected ones to the additional file and it doesn't affect the other tikzmarks in the document. I would also think that you'd want three basic hierarchies: all tikzmarks in the document, all tikzmarks in a specific picture, and individual tikzmarks. For the first two, I imagine setting a key, such as:

\tikzset{save tikzmarks to=<filename>}

(Actually, thinking about it then so long as it respected TeX's grouping, this would work at many levels.)

For the individual ones, one could set a key to the \tikzmark itself, though this would mean a slight change in the API since \tikzmark already takes an optional argument but this isn't used for setting keys. (I've never been particularly happy with the current argument interpretation so this would be a good time to look at it.)

Should the file have a standard file name, such as \jobname.tkzmk, or should that be up to the author to decide?

loopspace commented 5 years ago

Implemented in https://github.com/loopspace/tikzmark/commit/fa8c2a5710c279b1b48aebd503e41f2eecd83c25