summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/yquant
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-05-07 20:37:34 +0000
committerKarl Berry <karl@freefriends.org>2022-05-07 20:37:34 +0000
commita576e8f190f9ee34a3239738aeb3984b4ff43e57 (patch)
tree9f4567df155d19dc579fc0d5cc94cf8f3136d6cf /Master/texmf-dist/tex/latex/yquant
parentb7374e712f4af6ef86668d625de13634d547b27d (diff)
yquant (7may22)
git-svn-id: svn://tug.org/texlive/trunk@63247 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/yquant')
-rw-r--r--Master/texmf-dist/tex/latex/yquant/yquant-config.tex10
-rw-r--r--Master/texmf-dist/tex/latex/yquant/yquant-langhelper.tex45
-rw-r--r--Master/texmf-dist/tex/latex/yquant/yquant-shapes.tex12
-rw-r--r--Master/texmf-dist/tex/latex/yquant/yquant.sty4
4 files changed, 41 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/yquant/yquant-config.tex b/Master/texmf-dist/tex/latex/yquant/yquant-config.tex
index ab07830929f..6da9a4be66d 100644
--- a/Master/texmf-dist/tex/latex/yquant/yquant-config.tex
+++ b/Master/texmf-dist/tex/latex/yquant/yquant-config.tex
@@ -234,8 +234,14 @@
{/yquant/this operator/.append style={#1},%
/yquant/every control line/.append style={#1},%
/yquant/this control/.append style={#1}},%
- operator/multi as single/.style=%
- {/yquant/every multi line/.style=/yquant/every control line},%
+ operator/multi as single/.code=%
+ {\ifnum\yquant@draw@@currentcontroltype=0 %
+ \pgfkeysalso{/yquant/every multi line/.style=/yquant/every control line}%
+ \else%
+ % #21: we don't need to double-draw the line in the same style as a control line if controls are present - then, the control line will already encompass all the registers
+ \pgfkeysalso{/yquant/every multi line/.style={draw=none}}%
+ \fi%
+ },%
operator/if multi/.code=%
{\ifyquant@config@operator@multi\pgfkeysalso{#1}\fi},%
circuit/seamless/.is if=yquant@config@circuit@seamless,%
diff --git a/Master/texmf-dist/tex/latex/yquant/yquant-langhelper.tex b/Master/texmf-dist/tex/latex/yquant/yquant-langhelper.tex
index 56b671fb85a..c8b96250ddb 100644
--- a/Master/texmf-dist/tex/latex/yquant/yquant-langhelper.tex
+++ b/Master/texmf-dist/tex/latex/yquant/yquant-langhelper.tex
@@ -52,40 +52,33 @@
% we need to capture every non-attribute (which means filtering them out).
\expandafter\ifyquant@beginswith\expandafter{\pgfkeyscurrentkey}{/yquant/attrs/}{%
% the key is in /yquant/attrs. Does it actually exist (but not as a handler, which would define non-existing keys)?
- \if\pgfkeyscasenumber1%
- \pgfkeysfiltercontinuetrue%
- \else%
- \if\pgfkeyscasenumber2%
+ \ifnum\pgfkeyscasenumber=3 % handler
+ % handlers are tricky. The existence does not rely on the question whether the key itself exists, but the handler. This is not what we want for attributes. We strip the handler (the handler is in \pgfkeyscurrentname, while the original key is fully contained in \pgfkeyscurrentpath) and check whether it existed (think of handlers such as .expanded, which for sure should be valid, while we don't want to define new arguments).
+ \pgfkeysifassignable{\pgfkeyscurrentkey}{%
+ % case 1 and 2
\pgfkeysfiltercontinuetrue%
- \else%
- % 0 or 3 for our case means non-existing - now we need to check whether we can find it in the global attributes.
- \pgfkeysifassignable{/yquant/global attrs/\pgfkeyscurrentkeyRAW}{%
+ }{%
+ % don't have to worry about option 3, so this is 0. But maybe this was actually a global attribute? Again, we have to discard our handler. Note that this change to the current-macros will affect further processing!
+ \edef\pgfkeyscurrentkey{/yquant/global attrs/\pgfkeyscurrentkeyRAW}%
+ \pgfkeyssplitpath%
+ \pgfkeysifassignable{\pgfkeyscurrentpath}{%
\pgfkeysfiltercontinuetrue%
}{%
- % it is not, so it is not a known attribute for this operator. Filter.
\pgfkeysfiltercontinuefalse%
}%
- \fi%
- \fi%
- }{%
- % the key is not in /yquant/attrs. Is it a global attribute (usually, the user should not access this explicitly, but let's be tolerant here)?
- \expandafter\ifyquant@beginswith\expandafter{\pgfkeyscurrentkey}{/yquant/global attrs/}{%
- % the key is in /yquant/global attrs. Does it actually exist?
- \if\pgfkeyscasenumber1%
- \pgfkeysfiltercontinuetrue%
- \else%
- \if\pgfkeyscasenumber2%
+ }%
+ \else%
+ \ifnum\pgfkeyscasenumber=0 % unknown
+ % non-existing - now we need to check whether we can find it in the global attributes.
+ \pgfkeysifassignable{/yquant/global attrs/\pgfkeyscurrentkeyRAW}%
\pgfkeysfiltercontinuetrue%
- \else%
- % no - that's it.
+ % it is not, so it is not a known attribute for this operator. Filter.
\pgfkeysfiltercontinuefalse%
- \fi%
+ \else% command key or contains value
+ \pgfkeysfiltercontinuetrue%
\fi%
- }{%
- % the key is no known attribute
- \pgfkeysfiltercontinuefalse%
- }%
- }%
+ \fi%
+ }\relax%
},%
/yquant/attr filter/.style={%
/pgf/key filters/attr filter/.install key filter,%
diff --git a/Master/texmf-dist/tex/latex/yquant/yquant-shapes.tex b/Master/texmf-dist/tex/latex/yquant/yquant-shapes.tex
index 0ebfca317ba..e4cc01e63f6 100644
--- a/Master/texmf-dist/tex/latex/yquant/yquant-shapes.tex
+++ b/Master/texmf-dist/tex/latex/yquant/yquant-shapes.tex
@@ -244,6 +244,10 @@
\csxdef{yquant@math@cache1@\xradius @\yradius @\the\pgflinewidth}%
{{\the\dimen2}{\the\dimen4}}%
\fi%
+ % now we must be careful (#21) - we emulate the line by rectangles, but rectangles are sensitive to the current scaling, while lines are not. So we must undo the scaling, which may be different for x and y direction. Let's hope there is no rotation, we'd get a mix of different scalings...
+ \pgftransformationadjustments%
+ \dimen2=\dimexpr\pgfhorizontaltransformationadjustment\dimen2\relax%
+ \dimen4=\dimexpr\pgfverticaltransformationadjustment\dimen4\relax%
\pgfpathmoveto{\pgfqpoint{-\dimexpr\xradius+\dimen4\relax}%
{-\dimexpr\yradius-\dimen2\relax}}%
\pgfpathlineto{\pgfqpoint{\dimexpr\xradius-\dimen4\relax}%
@@ -290,6 +294,10 @@
\csxdef{yquant@math@cache1@\xradius @\yradius @\the\pgflinewidth}%
{{\the\dimen2}{\the\dimen4}}%
\fi%
+ % now we must be careful (#21) - we emulate the line by rectangles, but rectangles are sensitive to the current scaling, while lines are not. So we must undo the scaling, which may be different for x and y direction. Let's hope there is no rotation, we'd get a mix of different scalings...
+ \pgftransformationadjustments%
+ \dimen2=\dimexpr\pgfhorizontaltransformationadjustment\dimen2\relax%
+ \dimen4=\dimexpr\pgfverticaltransformationadjustment\dimen4\relax%
\dimen6=\dimexpr\dimen2*\dimexpr\xradius\relax/\dimexpr\yradius\relax+%
\dimen2*\dimexpr\yradius\relax/\dimexpr\xradius\relax\relax%
\pgfpathmoveto{\pgfqpoint{-\dimexpr\xradius+\dimen4\relax}%
@@ -334,6 +342,10 @@
\csxdef{yquant@math@cache1@\xradius @\yradius @\the\pgflinewidth}%
{{\the\dimen2}{\the\dimen4}}%
\fi%
+ % now we must be careful (#21) - we emulate the line by rectangles, but rectangles are sensitive to the current scaling, while lines are not. So we must undo the scaling, which may be different for x and y direction. Let's hope there is no rotation, we'd get a mix of different scalings...
+ \pgftransformationadjustments%
+ \dimen2=\dimexpr\pgfhorizontaltransformationadjustment\dimen2\relax%
+ \dimen4=\dimexpr\pgfverticaltransformationadjustment\dimen4\relax%
\dimen6=\dimexpr\dimen4*\dimexpr\xradius\relax/\dimexpr\yradius\relax+%
\dimen4*\dimexpr\yradius\relax/\dimexpr\xradius\relax\relax%
\pgfpathmoveto{\pgfqpoint{-\dimexpr\xradius+\dimen4\relax}%
diff --git a/Master/texmf-dist/tex/latex/yquant/yquant.sty b/Master/texmf-dist/tex/latex/yquant/yquant.sty
index 1b44a60c795..2acb5d33b5c 100644
--- a/Master/texmf-dist/tex/latex/yquant/yquant.sty
+++ b/Master/texmf-dist/tex/latex/yquant/yquant.sty
@@ -1,7 +1,7 @@
% yquant.sty
% Typesetting quantum circuits using a flow-oriented language
%
-% Copyright 2019-2021 Benjamin Desef
+% Copyright 2019-2022 Benjamin Desef
%
% This work may be distributed and/or modified under the conditions of the LaTeX Project
% Public License, either version 1.3c of this license or (at your option) any later
@@ -15,7 +15,7 @@
%
% The Current Maintainer of this work is Benjamin Desef.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{yquant}[2022/02/05 v0.7 Yet another quantum circuit library for LaTeX]
+\ProvidesPackage{yquant}[2022/05/07 v0.7.1 Yet another quantum circuit library for LaTeX]
\RequirePackage{etoolbox}[2018/02/11]
\RequirePackage{tikz}[2015/08/29]