diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-08 22:59:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-08 22:59:29 +0000 |
commit | 147bfcd0c0aafd20e8893a1be104f51602906d5e (patch) | |
tree | 5f2fa1794dd7413d2770769d9c4072909bf93f5d | |
parent | ca4dab97ce02af391dc3582183a1c50d5709535f (diff) |
circuitikz (8mar17)
git-svn-id: svn://tug.org/texlive/trunk@43430 c570f23f-e606-0410-a88d-b1316a301751
14 files changed, 397 insertions, 127 deletions
diff --git a/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf b/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf Binary files differindex 179cccdcbfd..077ae0066b9 100644 --- a/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf +++ b/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf diff --git a/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md index bbed4c5b9e9..46a6cee4a49 100644 --- a/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md +++ b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md @@ -1,6 +1,16 @@ <!--- CircuiTikz - Changelog ---> The major changes among the different circuitikz versions are listed here. See <https://github.com/circuitikz/circuitikz/commits> for a full list of changes. +* Version 0.8 (2017-03-08) + - Allow use of voltage label at a [short] + - Correct line joins between path components (to[...]) + - New Pole-shape .-. to fill perpendicular joins + - Fixed direction of controlled american current source + - Fixed incorrect scaling of magnetron + - Fixed: Number of american inductor coils not adjustable + - Fixed Battery Symbols and added new battery2 symbol + - Added non-inverting Schmitttrigger + * Version 0.7 (2016-09-08) - Added second annotation label, showing, e.g., the value of an component - Added new symbol: magnetron @@ -69,7 +79,7 @@ The major changes among the different circuitikz versions are listed here. See < - rename of context.tex and context.pdf (thanks to Karl Berry) - updated the email address - in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) - - fixed scaling inconsistencies in quadrupoles + - fixed scaling inconsistencies in quadrupoles - fixed division by zero error on certain vertical paths - introduced options straighlabels, rotatelabels, smartlabels diff --git a/Master/texmf-dist/doc/generic/circuitikz/README.md b/Master/texmf-dist/doc/generic/circuitikz/README.md index f0d61a8c9c0..c156af6663a 100644 --- a/Master/texmf-dist/doc/generic/circuitikz/README.md +++ b/Master/texmf-dist/doc/generic/circuitikz/README.md @@ -1,7 +1,7 @@ circuitikz ========== -This is CircuiTikz, version 0.7 (2016-09-08). +Version 0.8 (2017-03-08) This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. @@ -12,7 +12,7 @@ So I based everything with the very impressive (if somewhat verbose at times) Ti -------------- ## Requirements -* Tikz graphics library, version 2 +* Tikz/PGF graphics library, version 3 * xstrings not older than 2009/03/13 ## Installation diff --git a/Master/texmf-dist/doc/latex/circuitikz/changelog.tex b/Master/texmf-dist/doc/latex/circuitikz/changelog.tex index 9be77ba6782..61f39b1c6f9 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/changelog.tex +++ b/Master/texmf-dist/doc/latex/circuitikz/changelog.tex @@ -4,12 +4,34 @@ here. See \url{https://github.com/circuitikz/circuitikz/commits} for a full list of changes. \begin{itemize} -\itemsep1pt\parskip0pt\parsep0pt +\tightlist +\item + Version 0.8 (2017-03-08) + + \begin{itemize} + \tightlist + \item + Allow use of voltage label at a {[}short{]} + \item + Correct line joins between path components (to{[}\ldots{}{]}) + \item + New Pole-shape .-. to fill perpendicular joins + \item + Fixed direction of controlled american current source + \item + Fixed incorrect scaling of magnetron + \item + Fixed: Number of american inductor coils not adjustable + \item + Fixed Battery Symbols and added new battery2 symbol + \item + Added non-inverting Schmitttrigger + \end{itemize} \item Version 0.7 (2016-09-08) \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item Added second annotation label, showing, e.g., the value of an component @@ -36,7 +58,7 @@ full list of changes. Version 0.6 (2016-06-06) \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item Added Mechanical Symbols (damper,mass,spring) \item @@ -64,7 +86,7 @@ full list of changes. Version 0.5 (2016-04-24) \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item new option boxed and dashed for hf-symbols \item @@ -82,7 +104,7 @@ full list of changes. Version 0.4 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item minor improvements to documentation \item @@ -100,7 +122,7 @@ full list of changes. Version 0.3.1 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item different management of color\ldots{} \item @@ -121,7 +143,7 @@ full list of changes. Version 0.3.0 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item fixed gate node for a few transistors \item @@ -156,7 +178,7 @@ full list of changes. Version 0.2.4 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item added square voltage source (contributed by Alistair Kwan) \item @@ -177,7 +199,7 @@ full list of changes. in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) \item - fixed scaling inconsistencies in quadrupoles\\ + fixed scaling inconsistencies in quadrupoles \item fixed division by zero error on certain vertical paths \item @@ -187,7 +209,7 @@ full list of changes. Version 0.2.3 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item fixed compatibility problem with label option from tikz \item @@ -237,7 +259,7 @@ full list of changes. Version 0.2.2 - 20090520 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item Added the shape for lamps. \item @@ -252,7 +274,7 @@ full list of changes. Version 0.2.1 - 20090503 \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item Op-amps added \item @@ -263,7 +285,7 @@ full list of changes. Version 0.2 - 20090417 First public release on CTAN \begin{itemize} - \itemsep1pt\parskip0pt\parsep0pt + \tightlist \item \emph{Backward incompatibility}: labels ending with \texttt{:}\textit{angle} are not parsed for positioning anymore. diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf Binary files differindex 54caadf2efc..e530be02b35 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex index f49f9600445..9667284b504 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex @@ -1,6 +1,6 @@ % % Konfiguration für Texstudio (Version > 2.9) -% !TeX program = xelatex -% !TeX TXS-program:compile = txs:///xelatex/[-8bit] +% % !TeX program = xelatex +%% !TeX TXS-program:compile = txs:///xelatex/[-8bit] % !BIB program = biber % !TeX spellcheck = en_US % !TeX encoding = utf8 @@ -114,7 +114,7 @@ This documentation is somewhat scant. Hopefully the authors will find the leisur \bottomrule \end{tabular} \end{table} -\footnotetext{\ConTeXt\ suppurt was added mostly thanks to Mojca Miklavec and Aditya Mahajan.} +\footnotetext{\ConTeXt\ support was added mostly thanks to Mojca Miklavec and Aditya Mahajan.} \noindent \TikZ\ will be automatically loaded. @@ -137,7 +137,7 @@ This documentation is somewhat scant. Hopefully the authors will find the leisur So, if loaded with said option, one must write \verb!(0,0) to[*R] (2,0)! and, for transistors on a path, \verb!(0,0) to[*Tnmos] (2,0)!, and so on (but \verb!(0,0) node[nmos] {}!). See example at page~\pageref{ex:compatibility}. \subsection{License} -Copyright \copyright\ 2007--2016 Massimo Redaelli. This package is author-maintained. Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. +Copyright \copyright\ 2007--2017 Massimo Redaelli. This package is author-maintained. Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. \subsection{Feedback} The easiest way to contact the authors is via the official Github repository: \url{https://github.com/circuitikz/circuitikz/issues} @@ -145,11 +145,13 @@ The easiest way to contact the authors is via the official Github repository: \u \section{Incompabilities between version} Here, we will provide a list of incompabilitys between different version of circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than including a lot of switches and compatibility layers. +You can check the used version at your local installation using the macro \verb!\pgfcircversion{}!. \begin{itemize} \item Since v0.7?: The label behaviour at mirrored bipoles has changes, this fixes the voltage drawing, but perhaps you have to adjust your label positions. \item Since v0.5.1: The parts pfet,pigfete,pigfetebulk and pigfetd are now mirrored by default. Please adjust your yscale-option to correct this. \item Since v0.5: New voltage counting direction, here exists an option to use the old behaviour \end{itemize} +For older projects, you can use an older version locally using the git-version and picking the correct commit from the repository (branch gh-pages). \section{Package options} @@ -450,6 +452,7 @@ There is also a transmission line: \begin{itemize} \circuititembip{battery}{Battery}{} \circuititembip{battery1}{Single battery cell}{} + \circuititembip{battery2}{Single battery cell}{} \circuititembip{european voltage source}{Voltage source (european style)}{} \circuititembip{american voltage source}{Voltage source (american style)}{} \circuititembip{european current source}{Current source (european style)}{} @@ -734,7 +737,7 @@ Transformers with core are also available: \subsection{Logic gates} - +\subsubsection{American Logic gates} \begin{itemize} \circuititem{american and port}{American \textsc{and} port}{} \circuititem{american or port}{American \textsc{or} port}{} @@ -744,7 +747,7 @@ Transformers with core are also available: \circuititem{american xor port}{American \textsc{xor} port}{} \circuititem{american xnor port}{American \textsc{xnor} port}{} \end{itemize} - +\subsubsection{European Logic gates} \begin{itemize} \circuititem{european and port}{European \textsc{and} port}{} \circuititem{european or port}{European \textsc{or} port}{} @@ -761,6 +764,10 @@ If (default behaviour) \texttt{americanports} option is active (or the style \te If otherwise \texttt{europeanports} option is active (or the style \texttt{[european ports]} is used), the shorthands \texttt{and port}, \texttt{or port}, \texttt{not port}, \texttt{nand port}, \texttt{not port}, \texttt{xor port}, and \texttt{xnor port} are equivalent to the european version of the respective logic port. \end{framed} +\begin{itemize} + \circuititem{schmitt}{Non-Inverting \textsc{Schmitttrigger}}{} + \circuititem{invschmitt}{Inverting \textsc{Schmitttrigger}}{} +\end{itemize} \subsection{Amplifiers} \begin{itemize} @@ -1409,10 +1416,26 @@ Placing labels, currents and voltages works also, please note, that mirroring an \end{circuitikz} \end{LTXexample} +\subsection{Line joins between Path Components} +Line joins should be calculated correctly, if the were on the same path and if the path is not closed. For example, the following path is not closed correctly(\textit{--cycle} does not work here!): +\begin{LTXexample}[varwidth=true] + \begin{tikzpicture}[line width=3pt,european] + \draw (0,0) to[R]++(2,0)to[R]++(0,2) + --++(-2,0)to[R]++(0,-2); + \draw[red,line width=1pt] circle(2mm); + \end{tikzpicture} +\end{LTXexample} +To correct the line ending, there are support shapes to fill the missing rectangle. They can be used like the support shapes(*,o,d) using a dot (.) on one or both ends of a component(have a look at the last resistor in this example: +\begin{LTXexample}[varwidth=true] + \begin{tikzpicture}[line width=3pt,european] + \draw (0,0) to[R]++(2,0)to[R]++(0,2) + --++(-2,0)to[R,-.]++(0,-2); + \draw[red,line width=1pt] circle(2mm); + \end{tikzpicture} +\end{LTXexample} \section{Not only bipoles} - Since only bipoles (but see section~\ref{sec:transasbip}) can be placed "along a line", components with more than two terminals are placed as nodes: \begin{LTXexample}[varwidth=true] \begin{circuitikz} @@ -1477,7 +1500,7 @@ In the case of \textsc{not}, there are only \texttt{in} and \texttt{out} (althou (pigfete.G) node[anchor=east] {G} (pigfete.D) node[anchor=north] {D} (pigfete.S) node[anchor=south] {S} - (pigfete.bulk) node[anchor=east] {Bulk} + (pigfete.bulk) node[anchor=west] {Bulk} ;\end{circuitikz} \end{LTXexample} @@ -1537,7 +1560,7 @@ Similarly, transistors and other components can be reflected vertically: ;\end{circuitikz} \end{LTXexample} -\begin{LTXexample} +\begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw (0,2) node[rground, yscale=-1] {} diff --git a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex index d3c9d6949a1..cf74436658d 100644 --- a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex +++ b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex @@ -1,5 +1,5 @@ -\def\pgfcircversion{0.7} -\def\pgfcircversiondate{2016/09/08} +\def\pgfcircversion{0.8} +\def\pgfcircversiondate{2017/03/08} \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion} \usemodule[tikz] diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index 4c962cdc74c..828a7af89ee 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -186,6 +186,8 @@ \ctikzset{bipoles/battery/width/.initial=.3} \ctikzset{bipoles/battery1/height/.initial=.6} \ctikzset{bipoles/battery1/width/.initial=.3} +\ctikzset{bipoles/battery2/height/.initial=.6} +\ctikzset{bipoles/battery2/width/.initial=.3} \ctikzset{bipoles/diode/height/.initial=.50} \ctikzset{bipoles/diode/width/.initial=.40} \ctikzset{bipoles/varcap/height/.initial=.50} @@ -222,8 +224,14 @@ \ctikzset{bipoles/tfullgeneric/width/.initial=.80} \ctikzset{bipoles/fullgeneric/height/.initial=.30} \ctikzset{bipoles/fullgeneric/width/.initial=.80} -\ctikzset{bipoles/open/height/.initial=.25} -\ctikzset{bipoles/open/width/.initial=.8} +\ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages +\ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages +\ctikzset{bipoles/open/voltage/straight label distance/.initial=0} +\ctikzset{bipoles/open/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning +\ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning +%\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2} +%\ctikzset{bipoles/short/voltage/distance from node/.initial=.5} \ctikzset{bipoles/ammeter/height/.initial=.60} \ctikzset{bipoles/ammeter/width/.initial=.60} \ctikzset{bipoles/ohmmeter/height/.initial=.60} @@ -791,11 +799,13 @@ \ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}} \ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}} \ctikzset{bipole/nodes/left/diamond/.code={\ctikzsetvalof{bipole/nodes/left}{diamond}}} +\ctikzset{bipole/nodes/left/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/left}{rectjoinfill}}} \ctikzset{bipole/nodes/right/.is choice} \ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}} \ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}} \ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}} \ctikzset{bipole/nodes/right/diamond/.code={\ctikzsetvalof{bipole/nodes/right}{diamond}}} +\ctikzset{bipole/nodes/right/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/right}{rectjoinfill}}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index a66e907e656..28470321cd8 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -329,7 +329,7 @@ } -%% Battery 1 +%% Battery 1 % poles with equl thickness \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} @@ -344,15 +344,29 @@ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}} - + \pgfusepath{draw} +} +%% Battery 2 % negative pole thicker +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery2/height}}{battery2}{\ctikzvalof{bipoles/battery2/height}}{\ctikzvalof{bipoles/battery2/width}}{ + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfsetlinewidth{3\pgflinewidth} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}} \pgfusepath{draw} } - %% cute inductor \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/lower coil height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{ @@ -422,10 +436,10 @@ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases + \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}} + { \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} - \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} - \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} - \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + } \pgfsetbuttcap \pgfsetbeveljoin \pgfusepath{stroke} @@ -443,10 +457,10 @@ \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases + \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}} + { \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} - \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} - \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} - \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + } \pgfsetbuttcap \pgfsetbeveljoin \pgfusepath{stroke} @@ -875,8 +889,16 @@ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} \pgfusepath{draw} \pgfscope - \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}} + \ifpgf@circ@oldvoltagedirection + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \else + \ifpgf@circuit@bipole@current@backward + \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgftransformrotate{180} + \else + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \fi\fi + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope } @@ -1719,6 +1741,16 @@ \ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=diamond}} \ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=diamond}} +\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}} +\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=full}} +\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=empty}} +\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamond}} +\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}} +\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}} +\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}} +\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}} +\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}} + \tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}} @@ -1727,29 +1759,41 @@ \def\drawpoles{ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{diamond} } \ifx\pgf@temp\pgf@circ@temp - { (\tikztostart) node[diamondpole] {} } + (\tikztostart) node[diamondpole] {} \else - \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} } + \pgfextra{ \def\pgf@temp{empty} } \ifx\pgf@temp\pgf@circ@temp - { (\tikztostart) node[ocirc] {} } + (\tikztostart) node[ocirc] {} \else - \pgfextra{ \def\pgf@temp{full} } - \ifx\pgf@temp\pgf@circ@temp - { (\tikztostart) node[circ] {} } + \pgfextra{ \def\pgf@temp{full} } + \ifx\pgf@temp\pgf@circ@temp + (\tikztostart) node[circ] {} + \else + \pgfextra{ \def\pgf@temp{rectjoinfill} } + \ifx\pgf@temp\pgf@circ@temp + (\tikztostart) node[rectjoinfill] {} + \else + \fi \fi \fi \fi \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{diamond} } \ifx\pgf@temp\pgf@circ@temp - { (\tikztotarget) node[diamondpole] {} } + (\tikztotarget) node[diamondpole] {} \else - \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} } + \pgfextra{ \def\pgf@temp{empty} } \ifx\pgf@temp\pgf@circ@temp - { (\tikztotarget) node[ocirc] {} } + (\tikztotarget) node[ocirc] {} \else - \pgfextra{ \def\pgf@temp{full} } - \ifx\pgf@temp\pgf@circ@temp - { (\tikztotarget) node[circ] {} } + \pgfextra{ \def\pgf@temp{full} } + \ifx\pgf@temp\pgf@circ@temp + (\tikztotarget) node[circ] {} + \else + \pgfextra{ \def\pgf@temp{rectjoinfill} } + \ifx\pgf@temp\pgf@circ@temp + (\tikztotarget) node[rectjoinfill] {} + \else + \fi \fi \fi \fi @@ -1757,23 +1801,6 @@ - - - - - - - - - - - - - - - - - %% Lamp \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{ diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex index 38dee46769c..2af7aaa9e78 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex @@ -47,29 +47,33 @@ %% Generic bipole path \def\pgf@circ@bipole@path#1#2{ - \pgfextra{ + +\pgfextra{ \ctikzset{bipole/kind = #1} - \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \edef\pgf@temp{\ctikzvalof{bipole/name}} \def\pgf@circ@temp{} \ifx\pgf@temp\pgf@circ@temp % if it has not a name \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} \ctikzset{bipole/name = #2\pgf@circ@rand} % create it \fi - - \def\pgf@temp{open} - \def\pgf@circ@temp{#1} + \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates } - (\tikztostart) coordinate (\ctikzvalof{bipole/name}start) + (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relativ start/end or constructions like ((node1)-|(node2)) (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end) \pgfextra{ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} - \edef\pgf@circ@direction{\pgfmathresult} + \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path + \pgfsyssoftpath@setcurrentpath{\myp@th} } - - ($(\tikztostart) ! .5 ! (\tikztotarget)$) + \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}} + \ifx\pgf@temp\pgf@circ@temp % if it is an open + \else + --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?) + \fi + ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}] (\ctikzvalof{bipole/name}) {} \ifpgf@circuit@bipole@inverted @@ -89,33 +93,40 @@ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right) \fi \fi + \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}} \ifx\pgf@temp\pgf@circ@temp % if it is an open \else \ifpgf@circuit@bipole@strokedsymbol%draw line thrue symbol(e.g. diodes) \ifcsname pgf@anchor@#1shape@strokepathstart\endcsname%if special path-anchors are defined, use them! - (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.strokepathstart) + (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.strokepathstart) (\ctikzvalof{bipole/name}.strokepathend) -- (\ctikzvalof{bipole/name}end.center) \else - (\ctikzvalof{bipole/name}start.center)--(\ctikzvalof{bipole/name}end.center) + (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}end.center) \fi \else - (\ctikzvalof{bipole/name}start.center) --(anchorstartnode) + (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode) (anchorendnode) -- (\ctikzvalof{bipole/name}end.center) - \fi \fi - + \drawpoles \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi - \drawpoles \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi + \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}} + \ifx\pgf@temp\pgf@circ@temp % if it is an open + (\ctikzvalof{bipole/name}end)%Move to end of path + \else + ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?) + %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2) + + \fi % reset \pgfextra{ \pgfcircresetpath } - (\tikztotarget) \tikztonodes % e si continua + \tikztonodes%draw pending nodes an path } @@ -133,7 +144,8 @@ \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}} \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} -\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}} +\def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}} +\def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}} \def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} \def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}} \def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}} @@ -285,7 +297,8 @@ \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}} \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}} -\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}} +\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}} +\compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}} \compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} \compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} \compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}} @@ -662,4 +675,4 @@ \pgf@circ@definetranspath{pigbt} \pgf@circ@definetranspath{nigbt} \pgf@circ@definetranspath{Lpigbt} -\pgf@circ@definetranspath{Lnigbt}
\ No newline at end of file +\pgf@circ@definetranspath{Lnigbt} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex index 3f5091a6ea2..07a8ce6be06 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -115,12 +115,40 @@ } } +%% Fill for correct rectangular joins + +\pgfdeclareshape{rectjoinfill}{ + \anchor{center}{ + \pgfpointorigin + } + \anchorborder{ + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + } + \behindforegroundpath{ + \pgfscope + \pgfpathrectanglecorners + {\pgfpoint{0}{.5\pgflinewidth}} + {\pgfpoint{0}{-.5\pgflinewidth}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfusepath{draw,fill} + \endpgfscope + } +} + + %% Current arrow \pgfdeclareshape{currarrow}{ \anchor{center}{ \pgfpointorigin } + \anchor{tip}{ + \pgfpointorigin + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \divide \pgf@circ@res@step by 16 + \pgf@x =\pgf@circ@res@step + } \behindforegroundpath{ \pgfscope diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index 255aa335f0e..b98af8b9123 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -738,13 +738,14 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} + \pgfpathclose \pgfusepath{draw} \pgfpathellipse {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}} {\pgfpoint{.5\pgf@circ@res@other}{0pt}} {\pgfpoint{0pt}{.5\pgf@circ@res@other}} - \pgfusepath{draw} + \pgfsetfillcolor{white} + \pgfusepath{draw,fill} \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} @@ -769,7 +770,111 @@ } } - +\pgfdeclareshape{schmitt} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x + \pgf@x=.5\pgf@x + } + \savedanchor\left{% + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathclose + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}} + \pgfusepath{draw} + %draw inner shape + + \pgfsetlinewidth{2\pgflinewidth} + + \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}} + \pgfusepath{draw} + + } + } @@ -3235,22 +3340,29 @@ \pgfpointorigin } \anchor{anode}{ - \northwest - \pgf@circ@res@step= \pgf@y - \pgfpointorigin - \pgfpathmoveto{ \pgfpointpolar{-90}{\pgf@circ@res@step}} + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y } \anchor{cathode1}{ \northwest - \pgf@circ@res@step= \pgf@y - \pgfpointorigin - \pgfpathmoveto{ \pgfpointpolar{105}{\pgf@circ@res@step}} + \pgf@circ@res@step=\pgf@y + \pgfmathparse{cos(105)} + \pgf@x=\pgfmathresult\pgf@circ@res@step + \pgfmathparse{sin(105)} + \pgf@y=\pgfmathresult\pgf@circ@res@step + %\pgfpointorigin + %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture } \anchor{cathode2}{ \northwest - \pgf@circ@res@step= \pgf@y - \pgfpointorigin - \pgfpathmoveto{ \pgfpointpolar{75}{\pgf@circ@res@step}} + \pgf@circ@res@step=\pgf@y + \pgfmathparse{cos(75)} + \pgf@x=\pgfmathresult\pgf@circ@res@step + \pgfmathparse{sin(75)} + \pgf@y=\pgfmathresult\pgf@circ@res@step + %\pgfpointorigin + %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture } \anchor{text}{ \pgfpointorigin diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 5a944419fd8..a9322362709 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -90,16 +90,26 @@ \def\pgf@circ@drawvoltagegeneric{ \pgfextra{ + + + \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance} + \pgfkeysifdefined{\pgf@temp} + { \edef\partwidth{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}} + \def\tmpdistfromline{\partwidth\pgf@circ@Rlen}} + { + \edef\partwidth{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}} + \def\tmpdistfromline{(\partwidth\pgf@circ@Rlen+0.2\pgf@circ@Rlen)} + } \ifnum \ctikzvalof{mirror value}=-1 \ifpgf@circuit@bipole@inverted \ifpgf@circuit@bipole@voltage@straight - \def\distfromline{\eudist} + \def\distfromline{\tmpdistfromline} \else \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} \fi \else \ifpgf@circuit@bipole@voltage@straight - \def\distfromline{-\eudist} + \def\distfromline{-\tmpdistfromline} \else \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} \fi @@ -107,13 +117,13 @@ \else \ifpgf@circuit@bipole@inverted \ifpgf@circuit@bipole@voltage@straight - \def\distfromline{-\eudist} + \def\distfromline{-\tmpdistfromline} \else \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} \fi \else \ifpgf@circuit@bipole@voltage@straight - \def\distfromline{\eudist} + \def\distfromline{\tmpdistfromline} \else \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} \fi @@ -136,11 +146,17 @@ { \edef\bumpb{\ctikzvalof{voltage/bump b}} } } + % %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}/16 is equal to the length of the currarrow + coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}/16 ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead + coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorstartnode)$) - coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \distacefromnode ! (anchorstartnode)$) + coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$) - coordinate (pgfcirc@mid) at ($(\tikztotarget) ! \distacefromnode ! (anchorendnode)$) - coordinate (pgfcirc@Vto) at ($(pgfcirc@mid) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$) + coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}/16 ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead + coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorendnode)$) + + coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$) + \ifpgf@circuit@bipole@voltage@below coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$) @@ -153,9 +169,9 @@ \ifpgf@circuit@europeanvoltage \ifpgf@circuit@bipole@voltage@straight \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1] {} + (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {} \else - (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1] {} + (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {} \fi \else @@ -194,18 +210,18 @@ \def\pgf@circ@drawvoltagegenerator{ \ifpgf@circuit@bipole@voltage@below - coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$) - coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$) + coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$) + coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$) \else - coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$) - coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$) + coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$) + coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$) \fi \ifpgf@circuit@europeanvoltage \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vcont2) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont1) + (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vfrom) \else - (pgfcirc@Vcont1) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont2) + (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vto) \fi \else % american voltage @@ -213,9 +229,9 @@ \ifpgf@circuit@bipole@voltageoutsideofsymbol % if it is a battery, must put + and - \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vcont1) node {$-$} (pgfcirc@Vcont2) node {$+$} + (pgfcirc@Vfrom) node {$-$} (pgfcirc@Vto) node {$+$} \else - (pgfcirc@Vcont1) node {$+$} (pgfcirc@Vcont2) node {$-$} + (pgfcirc@Vfrom) node {$+$} (pgfcirc@Vto) node {$-$} \fi \fi @@ -321,14 +337,23 @@ \pgf@circ@drawvoltagegeneric \fi - - - (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) + % (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) %Zeile sinnlos!? + \ifpgf@circuit@bipole@voltage@straight + coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $) + node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] + at (Vlab) { \pgf@circ@finallabels{voltage/label} } + \else coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) ! - \ifpgf@circuit@europeanvoltage\eudist\else\ctikzvalof{voltage/american label distance}\fi ! + \ifpgf@circuit@europeanvoltage + \eudist + \else + \ctikzvalof{voltage/american label distance} + \fi ! (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$) - node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0] - at (Vlab) { \pgf@circ@finallabels{voltage/label} } -} + node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] + at (Vlab) { \pgf@circ@finallabels{voltage/label} } + + \fi + }%end drawvoltages \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty index acc29cf5ef7..3c2641d7807 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -17,8 +17,8 @@ \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.7} -\def\pgfcircversiondate{2016/09/08} +\def\pgfcircversion{0.8} +\def\pgfcircversiondate{2017/03/08} \ProvidesPackage{circuitikz}% [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion] |