You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I agree that custom attributes for own gates would be useful, and I will add them when I have time to do so, the same applies as in the controlbox-issue: If you want to define more complicated gates, have a look at how this is done in yquant-lang.tex and just copy the behavior.
In this way, you can define for example your rx box:
You can also define custom attributes if you wish, you just have to declare the attribute once (see the top of yquant-lang.tex for examples) and then in setup@attrs say which required or optional attributes you want to have. Then you can combine them as you wish. Just make sure that the attributes are expanded before \yquant@prepare is called.
Things are in some way even simpler for defined gates instead of boxes, as they allow to do much more. I would simply define the three attributes that you want, then define the gate to use these attributes (note that the content of the gate is expanded at creation, so you'll have to wrap everything in \unexpanded), and finally associate the attributes with the gate. Then, your given code works as you wrote it.
Be aware of the fact that numbers and letters by default have a different category code, so you cannot define (easily) a macro that contains a number in its name. This will always end the name and be interpreted as the token that follows the macro, unless you change the catcode of the char or wrap everything in \csname...\endcsname.
Let's leave this issue open until I have implemented a better attribute support (I guess April or May).
A motivation is to support$R_{x}, R_{y}, R_{z}$ . It would be nice if the following syntax is possible.
A more complicated usage might be
The text was updated successfully, but these errors were encountered: