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

Compatibility with PGF/TikZ #61

Closed
vlasakm opened this issue Jul 9, 2021 · 5 comments
Closed

Compatibility with PGF/TikZ #61

vlasakm opened this issue Jul 9, 2021 · 5 comments

Comments

@vlasakm
Copy link
Contributor

vlasakm commented Jul 9, 2021

With #60 we are getting more compatible with PGF/TikZ. Although we will no longer clash with the use of \pdfpageresources primitive token register, by either using PGF's mechanism when detected, we don't let PGF write the page resources.

This is because PGF delegates the PDF object writing to \pgfutil@everybye and that is never executed in OpTeX (it hooks into \end and we do \_end).

This can be mitigated manually by e.g. loading PGF/TikZ like this:

\load[tikz]
\_addto\_byehook{\_the\_cs{pgfutil@everybye}}

In my opinion this should be hanled by OpTeX. What about having something like tikz.opm that would load the real tikz and also do this? Maybe we could later include other compatibility code there (e.g. for pgf-tikz/pgf#983?). This of course bring the problem of syncing with (possible) PGF internals updates.

@vlasakm vlasakm mentioned this issue Jul 9, 2021
14 tasks
@olsak
Copy link
Owner

olsak commented Jul 10, 2021

Using tikz.opm is good idea. If a user does \input tikz then somewhat will not work well, but \load[tikz] is in our competence and we can do corrections (e.g. for pgf-tikz/pgf#983). And we add a message about it to documentation.

@vlasakm
Copy link
Contributor Author

vlasakm commented Jul 15, 2021

@olsak Should I try to also make PGF use the .ref file instead of a .pgf auxiliary file?

(Not sure if it is feasible, but I would like to know if this is even desirable).

@olsak
Copy link
Owner

olsak commented Jul 15, 2021

@olsak Should I try to also make PGF use the .ref file instead of a .pgf auxiliary file?

(Not sure if it is feasible, but I would like to know if this is even desirable).

No. I think that better is the TikZ behavior like in plain TeX.

@vlasakm
Copy link
Contributor Author

vlasakm commented Jul 15, 2021

Both ideas presented here are implemented in #63.

But in the future it may be a better idea create more thorough pgfutil-optex.def and pgfsys-optex.def files. This would hopefully provide better/cleaner integration in areas such as color, auxiliary file writing, font selelction, "shipout hacking", and logging.

Notably PGF uses the atbegshi package to hook into output box processing. The injections that it does are only usefull with (x)dvipdfm(x) as far as I can tell. But atbegshi requires more packages (iftex, infwarerr, ltxcmd), which troubles me more.

olsak added a commit that referenced this issue Jul 21, 2021
@vlasakm
Copy link
Contributor Author

vlasakm commented Jul 21, 2021

Closing (at least for now).

@vlasakm vlasakm closed this as completed Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants