!NuxCISwYQJuyWwNsEI:matrix.org

PGF/TikZ

52 Members
https://github.com/pgf-tikz11 Servers

Load older messages


SenderMessageTime
6 Feb 2022
@r_mano:matrix.orgRomano Giannetti
In reply to @muzzi:matrix.org
Maybe \pgf@sm@shape@name?
It's perfect, I used it in https://github.com/circuitikz/circuitikz/pull/610
19:12:43
11 Feb 2022
@hmenke:matrix.orghmenke Argh, I really have to push through #1116 sooner than later. It's blocking too much stuff especially the catcode changes for \matrix. 22:26:31
@hmenke:matrix.orghmenke Having normal & in \matrix would solve 90% of problems that currently require ampersand replacement. 22:27:00
@hmenke:matrix.orghmenkeIf anybody feels like helping out, please make PRs against https://github.com/hmenke/pgf/tree/l3build22:27:42
12 Feb 2022
@anaconda1988:matrix.organaconda1988 joined the room.02:56:39
14 Feb 2022
@ctx:kungfu-g.ripctx joined the room.14:14:06
15 Feb 2022
@freetux:tetaneutral.netfreetux left the room.16:18:37
17 Feb 2022
@lahcim8:matrix.orgMichal Vlasák joined the room.21:17:22
@lahcim8:matrix.orgMichal Vlasák

Hello,

I would like to improve PGF and OpTeX (LuaTeX based "extended plain TeX" format) interoperability. Before opening pull request or an issue, I would like to discuss my approach less formally here, and I would tweak accordingly, because I am unsure about a couple of things.

With plain LuaTeX one would \input pgf.tex (or similar), which before loading the bulk of the code base, abstracts the plain format (pgfutil-plain.def) and the engine (pgfsys-luatex.def in OpTeX's case). For OpTeX, this is currently not sufficient, since there are a couple of issues:

  • \pgfutil@everybye needs to be added to \_byehook, otherwised it is unused (https://github.com/olsak/OpTeX/issues/61)
  • some possibilities of OpTeX font system are not used
  • several packages are loaded for unnecessary hacking with \shipout (needed only by dvipdfmx), which wasn't even in effect (OpTeX uses \_shipout)
  • wrong origin point was used (https://github.com/pgf-tikz/pgf/issues/983)

Most of these issues were solved by introducing the file tikz.opm, which would transparently be loaded instead of tikz.tex when user writes \load[tikz]. However, soon OpTeX will change how PDF resources are managed, since there is a need to keep things compatible with different packages. Maybe pursuing greater "standardization effort" is the way to go, but for now, I think that PGF could use a few OpTeX specific macros on the system / utitilities level.

There are two possible approaches to go with this:

  • Keep tikz.opm in OpTeX, make it interleave loading things from PGF and patching them (because order matters). The currentversion of this is here: https://github.com/vlasakm/OpTeX/blob/resources2/optex/pkg/tikz.opm. The pgfutil-plain.def file is also loaded, because most of it is just fine, but some things are changed or mostly ignored. Similarly, pgfsys-luatex.def is loaded, since most of it is fine, but a few fixups are done after loading it.
  • Introduce OpTeX compatibility directly in PGF. OpTeX uses .opm files so there are no collisions with plain TeX. Now from these "proxy" opm files, instead of loading pgfutil-plain.def and pgfsys-luatex.def, OpTeX files pgfutil-optex.def and pgfsys-optex.def can be loaded instead. These are mostly copies, but instead of patching, the behaviour is contained directly there. A proof of concept of this is here: https://github.com/pgf-tikz/pgf/compare/master...vlasakm:optex.

Of course, the second approach can be also done outside of PGF. But the main advantage of that approach is that the OpTeX files will stay sync with the rest of PGF. A problem may be the initial synchronization of releasing this (especially since both packages would contain the tikz.opm file, unless both are updated at once).

The first, patching approach, keeps more control for OpTeX, and is less dependant on PGF release cycle, but is also error prone, since a lot of the files loaded by tikz.tex are emulated to achieve "hooks" at the right times. And of course it is not possible to do \load[pgf] and expect it to work, since a similar thing would need to be done for pgf.opm (pgf.tex).

There are other questions both technical, documentational:

  • I introduced pgfsys-optex.def even though OpTeX is not a format. I think that something similar will be needed for ConTeXt LMTX, so I went this route, but I think this needs to be discussed more.
  • Add OpTeX to the manual? Here https://github.com/pgf-tikz/pgf/blob/master/tex/latex/pgf/doc/pgfmanual-en-macros.tex#L1026-L1027? What about the tutorial? There are also some inconsistencies about these "proxy format specific files" - e.g. there is only pgfparser.sty, but possibility of loading it is advised even for plain and ConTeXt.

Maybe more I am now forgetting. Before discussing the details of my initial approaches (which are in coordination with Petr Olšák, OpTeX's author) I would like to know whether you you think that including OpTeX support in PGF directly is the way to go or you don't want to "have to deal with OpTeX" and it should be managed outside of PGF entirely?

22:10:03
18 Feb 2022
@hmenke:matrix.orghmenke Michal Vlasák: I don't think adding OpTeX support to PGF is a good idea. In fact, ConTeXt also provides its own shims to make PGF work with LuaMetaTeX and mostly ignores the stuff we provide. 16:36:23
@hmenke:matrix.orghmenkeFor example https://github.com/contextgarden/context-mirror/blob/beta/tex/context/modules/mkxl/m-tikz.mkxl16:40:21
@lahcim8:matrix.orgMichal Vlasák I understand, I'll keep it entirely out of PGF. But if I am not missing anything, ConTeXt is in fact using the original upstream pgfutil-context.def and pgfsys-luatex.def, and the module file is just a "frontend", so its a different situation. (As far as I know it also has "pseudo primitives" in its base to accomodate PGF's needs, but that apparently doesn't work as of now https://github.com/pgf-tikz/pgf/issues/990). 16:54:22
@lahcim8:matrix.orgMichal Vlasák * hmenke: I understand, I'll keep it entirely out of PGF. But if I am not missing anything, ConTeXt is in fact using the original upstream pgfutil-context.def and pgfsys-luatex.def, and the module file is just a "frontend", so its a different situation. (As far as I know it also has "pseudo primitives" in its base to accomodate PGF's needs, but that apparently doesn't work as of now https://github.com/pgf-tikz/pgf/issues/990). 16:55:16
1 Mar 2022
@obscuredcode:matrix.orgMac Mac Millan joined the room.02:07:07
9 Mar 2022
@zpm-p1d:matrix.uni-hannover.deFritz Webering joined the room.19:56:58
18 Mar 2022
@hmenke:matrix.orghmenke

Little preview of what I started working on:

\begin{tikzpicture}[
  declare function={
    x = 1;
  }]
  \path (0,0) if x == 0 {
    node {foo}
  } else {
    if (x == 1) {
      node {bar}
    } else {
      node {baz}
    }
  };
\end{tikzpicture}
18:51:20
@qrr:matrix.orgqrr I've used if keys with insert paths in the past. 🤔 19:19:22
@hmenke:matrix.orghmenke qrr: In what sense? Like [insert path={\ifnum\x=0 circle (1)\fi}]? 19:33:16
@qrr:matrix.orgqrr
In reply to @hmenke:matrix.org
qrr: In what sense? Like [insert path={\ifnum\x=0 circle (1)\fi}]?
\tikzset{if/.code n args={3}{\pgfmathparse{#1}\ifnum\pgfmathresult=1\pgfkeysalso{#2}\else\pgfkeysalso{#3}\fi}}
19:44:06
@qrr:matrix.orgqrrSo, either if={}{insert path=…}{} or another if insert path key that's based on the if key.19:44:51
@qrr:matrix.orgqrr* So, either `if={}{insert path=…}{}` or another `if insert path` key that's based on the `if` key.19:45:20
@qrr:matrix.orgqrrWould be better to firstoftwo/secondoftwo the pgfkeysalso but that's the first example I could find in my Tex.SX answers.19:47:14
@qrr:matrix.orgqrr
In reply to @hmenke:matrix.org
qrr: In what sense? Like [insert path={\ifnum\x=0 circle (1)\fi}]?
I'm not saying an if path operator is unnecessary, at least this way we won't have to protect = and , in the conditional … but )?
20:07:01
18 Apr 2022
@wybpip:matrix.orgAn exploring bot joined the room.10:12:15
@wybpip:matrix.orgAn exploring bot left the room.10:12:15
1 May 2022
@wybpip:matrix.orgAn exploring bot joined the room.20:47:28
@wybpip:matrix.orgAn exploring bot left the room.20:47:30
24 May 2022
@haiiliin:matrix.orgHailin Wang joined the room.06:03:02
27 May 2022
@s:matrix.qrrbr.duckdns.orgQrrbrbirlbel joined the room.02:15:28
14 Jun 2022
@hmenke:matrix.orghmenke muzimuzhi: I wanted to update the pgf-pie CI with the IoT Docker image, but there is some weird problem with hyperref. 10:46:12

Show newer messages


Back to Room ListRoom Version: 6