diff options
author | Karl Berry <karl@freefriends.org> | 2018-02-06 23:59:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-02-06 23:59:08 +0000 |
commit | 33ae20b26cfa6ba6ecaf5138f6783de144de396f (patch) | |
tree | 7c6f53852fee50c10ed67a3d0082fe82f971e8c6 /Master/texmf-dist/tex | |
parent | 7ce484f314ab1fcba2367c2c3ff88347ed183252 (diff) |
tikz-ladder (6feb18)
git-svn-id: svn://tug.org/texlive/trunk@46555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikz-ladder/tikzlibrarycircuits.plc.ladder.code.tex (renamed from Master/texmf-dist/tex/latex/tikz-ladder/tikzlibraryladder.code.tex) | 158 |
1 files changed, 103 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/latex/tikz-ladder/tikzlibraryladder.code.tex b/Master/texmf-dist/tex/latex/tikz-ladder/tikzlibrarycircuits.plc.ladder.code.tex index 4960c8ece87..b4b9c965acb 100644 --- a/Master/texmf-dist/tex/latex/tikz-ladder/tikzlibraryladder.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-ladder/tikzlibrarycircuits.plc.ladder.code.tex @@ -1,5 +1,7 @@ -%% This is file `tikzlibraryladder.code.tex' -%% Version 1 of 10 January 2018 +%% This is file `tikzlibrarycircuits.plc.ladder.code.tex' +%% Version: 1.1 +%% Version date: 2018-02-06 +%% %% %% Copyright (C) 2018 by Luis Paulo Laus, laus@utfpr.edu.br %% @@ -7,9 +9,10 @@ %% of the LaTeX Project Public License distributed from CTAN %% archives in directory macros/latex/base/lppl.txt; either %% version 1 of the License, or (at your option) any later version, -%% with `The Package' referring to the software `tikzlibraryladder.code.tex' and its -%% accompanying documentation and `The Copyright Holder' referring to the -%% person Luis Paulo Laus. +%% with `The Package' referring to the software +%% `tikzlibrarycircuits.plc.ladder.code.tex' +%% and its accompanying documentation and `The Copyright Holder' +%% referring to the person Luis Paulo Laus. %% %% %% IMPORTANT NOTICE: @@ -19,15 +22,20 @@ %% laus@utfpr.edu.br %% %% +%% Change History: +%% 1.0: 10 January 2018: Original Version +%% 1.1: 06 February 2018: Macro file renamed to proper TikZ library file name. +%% Parent library changed from `circuit.ee' to `circuits'. +%% Bug fixes: added \pgfusepathqstroke where is was missing, +%% block anchors reworked. - -\usetikzlibrary{circuits.ee} +\usetikzlibrary{circuits} % % Setting up an ladder % \tikzset{ - ladder/.style={ - circuit ee, + circuit plc ladder/.style={ + circuit, inputs/.style={block ladder inputs={##1}}, outputs/.style={block ladder outputs={##1}}, input sep/.style={block ladder input sep={##1}}, @@ -35,7 +43,7 @@ clksize/.style={block ladder clksize={##1}}, symbol/.style={ladder symbol={##1}}, symbol color/.style={ladder symbol color={##1}}, - every ladder/.try + every circuit plc ladder/.try } } @@ -229,7 +237,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@ladder@numinputs<1\relax% - \pgferror{An block must have at least one input}% + \pgferror{A block must have at least one input}% \fi% % \def\pgf@lib@sh@ladder@inout{outputs} @@ -245,7 +253,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@ladder@numoutputs<1\relax% - \pgferror{An block must have at least one output}% + \pgferror{A block must have at least one output}% \fi% }% @@ -258,22 +266,31 @@ \pgfpointorigin } \savedanchor\midpoint{% - \pgf@x0pt% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x0pt% - \pgf@y0pt% + \pgfpointorigin + \advance\pgf@y-.5\ht\pgfnodeparttextbox + \advance\pgf@y.5\dp\pgfnodeparttextbox + \pgfmathaddtolength\pgf@y{+0.5ex}% } - \anchor{text}{\dimensions\pgfpointorigin\advance\pgf@x-.5\wd\pgfnodeparttextbox\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox} -% \anchor{text}{\dimensions\pgfpointorigin\pgf@y\symbolypos\advance\pgf@x-.5\wd\pgfnodeparttextbox\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox} % symbol - \anchor{center}{\pgfpointorigin} - \anchor{mid}{\dimensions\midpoint\advance\pgf@x-.5\wd\pgfnodeparttextbox\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox\advance\pgf@y0.5ex} - \anchor{mid west}{\dimensions\midpoint\advance\pgf@x-\halfwidth\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox\advance\pgf@y0.5ex}% - \anchor{mid east}{\dimensions\midpoint\advance\pgf@x\halfwidth\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox\advance\pgf@y0.5ex}% - \anchor{base}{\dimensions\basepoint\advance\pgf@x-.5\wd\pgfnodeparttextbox\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox} - \anchor{base west}{\dimensions\basepoint\advance\pgf@x-\halfwidth\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox}% - \anchor{base east}{\dimensions\basepoint\advance\pgf@x\halfwidth\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@y-.5\ht\pgfnodeparttextbox\advance\pgf@y-.5\dp\pgfnodeparttextbox}% + \savedanchor\basepoint{% + \pgfpointorigin + \advance\pgf@y-.5\ht\pgfnodeparttextbox + \advance\pgf@y.5\dp\pgfnodeparttextbox + } + \savedanchor\textpoint{% + \pgfpointorigin + \advance\pgf@x-.5\wd\pgfnodeparttextbox + \advance\pgf@y-.5\ht\pgfnodeparttextbox + \advance\pgf@y.5\dp\pgfnodeparttextbox + } + \anchor{center}{\pgfpointorigin}% + \anchor{block center}{\dimensions\pgfpointorigin\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth}% + \anchor{text}{\dimensions\textpoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth}% + \anchor{mid}{\dimensions\midpoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth}% + \anchor{mid west}{\dimensions\midpoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@x-\halfwidth}% + \anchor{mid east}{\dimensions\midpoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@x\halfwidth}% + \anchor{base}{\dimensions\basepoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth}% + \anchor{base west}{\dimensions\basepoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@x-\halfwidth}% + \anchor{base east}{\dimensions\basepoint\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth\advance\pgf@x\halfwidth}% \anchor{north}{\dimensions\pgfpointorigin\advance\pgf@y\halfheight\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth}% \anchor{south}{\dimensions\pgfpointorigin\advance\pgf@y-\boxdepth}% \anchor{east}{\dimensions\pgfpointorigin\advance\pgf@x\halfwidth\advance\pgf@y\halfheight\advance\pgf@y-\boxdepth}% @@ -371,7 +388,6 @@ {\csname outputs-\pgfmathcounter\endcsname}% }% \repeatpgfmathloop% - }% } \anchorborder{% @@ -393,19 +409,33 @@ % contact \pgfdeclareshape{contact ladder} { - \inheritsavedanchors[from=rectangle ee] - \inheritanchor[from=rectangle ee]{center} - \inheritanchor[from=rectangle ee]{north} - \inheritanchor[from=rectangle ee]{south} - \inheritanchor[from=rectangle ee]{east} - \inheritanchor[from=rectangle ee]{west} - \inheritanchor[from=rectangle ee]{north east} - \inheritanchor[from=rectangle ee]{north west} - \inheritanchor[from=rectangle ee]{south east} - \inheritanchor[from=rectangle ee]{south west} - \inheritanchor[from=rectangle ee]{input} - \inheritanchor[from=rectangle ee]{output} - \inheritanchorborder[from=rectangle ee] + \inheritsavedanchors[from=rectangle] + \inheritanchor[from=rectangle]{center} + \inheritanchor[from=rectangle]{north} + \inheritanchor[from=rectangle]{south} + \inheritanchor[from=rectangle]{east} + \inheritanchor[from=rectangle]{west} + \inheritanchor[from=rectangle]{north east} + \inheritanchor[from=rectangle]{north west} + \inheritanchor[from=rectangle]{south east} + \inheritanchor[from=rectangle]{south west} + \inheritanchor[from=rectangle]{input} + \inheritanchor[from=rectangle]{output} + \inheritanchorborder[from=rectangle] % New: + \anchor{input}{ + \pgf@process{\northeast}% + \pgf@ya=.5\pgf@y% + \pgf@process{\southwest}% + \pgf@y=.5\pgf@y% + \advance\pgf@y by \pgf@ya% + } + \anchor{output}{% + \pgf@process{\southwest}% + \pgf@ya=.5\pgf@y% + \pgf@process{\northeast}% + \pgf@y=.5\pgf@y% + \advance\pgf@y by \pgf@ya% + } \savedanchor\centerpoint{% \pgf@x.5\wd\pgfnodeparttextbox% \pgf@y.5\ht\pgfnodeparttextbox% @@ -427,6 +457,7 @@ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yb}} \fi \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}} + \pgfusepathqstroke } \foregroundpath{ \pgftransformshift{\centerpoint} @@ -437,19 +468,33 @@ % coil \pgfdeclareshape{coil ladder} { - \inheritsavedanchors[from=rectangle ee] - \inheritanchor[from=rectangle ee]{center} - \inheritanchor[from=rectangle ee]{north} - \inheritanchor[from=rectangle ee]{south} - \inheritanchor[from=rectangle ee]{east} - \inheritanchor[from=rectangle ee]{west} - \inheritanchor[from=rectangle ee]{north east} - \inheritanchor[from=rectangle ee]{north west} - \inheritanchor[from=rectangle ee]{south east} - \inheritanchor[from=rectangle ee]{south west} - \inheritanchor[from=rectangle ee]{input} - \inheritanchor[from=rectangle ee]{output} - \inheritanchorborder[from=rectangle ee] + \inheritsavedanchors[from=rectangle] + \inheritanchor[from=rectangle]{center} + \inheritanchor[from=rectangle]{north} + \inheritanchor[from=rectangle]{south} + \inheritanchor[from=rectangle]{east} + \inheritanchor[from=rectangle]{west} + \inheritanchor[from=rectangle]{north east} + \inheritanchor[from=rectangle]{north west} + \inheritanchor[from=rectangle]{south east} + \inheritanchor[from=rectangle]{south west} + \inheritanchor[from=rectangle]{input} + \inheritanchor[from=rectangle]{output} + \inheritanchorborder[from=rectangle] % New: + \anchor{input}{ + \pgf@process{\northeast}% + \pgf@ya=.5\pgf@y% + \pgf@process{\southwest}% + \pgf@y=.5\pgf@y% + \advance\pgf@y by \pgf@ya% + } + \anchor{output}{% + \pgf@process{\southwest}% + \pgf@ya=.5\pgf@y% + \pgf@process{\northeast}% + \pgf@y=.5\pgf@y% + \advance\pgf@y by \pgf@ya% + } \savedanchor\centerpoint{% \pgf@x.5\wd\pgfnodeparttextbox% \pgf@y.5\ht\pgfnodeparttextbox% @@ -479,6 +524,7 @@ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yb}} \fi \pgfpatharc{\pgf@yc}{-\pgf@yc}{\pgf@ya} + \pgfusepathqstroke } \foregroundpath{ \pgftransformshift{\centerpoint} @@ -577,4 +623,6 @@ shape=block ladder, every ladder block/.try } -}
\ No newline at end of file +} + +\endinput
\ No newline at end of file |