1

I'm looking for the symbol of the Open Collector Inverter in Circuitikz, but I can't find it. Anyone knows how to do it?

1

Since this version draws a symbol in the text area, I commented out the code for the text area (but left it there in case anyone wants to fix the american not port).

\documentclass{standalone}
\usepackage{circuitikz}

\makeatletter
\pgfdeclareshape{inverter}
    {
    \anchor{center}{\pgfpointorigin}
%    \anchor{text}{% this is used to center the text in the node
%      \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}%
%      \pgf@x = 0.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
%      \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@x
%      \pgfpoint{\dimexpr-\pgf@circ@res@other-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}%
%    }%
    \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% draw borders (shift origin to left side)
        \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}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}

        \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}
    \endpgfscope

    \pgfscope% draw undelined diamond
        \pgfsetlinewidth{1.5\pgflinewidth}
        \pgftransformxshift{0.3\pgf@circ@res@left}

        \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
        \pgfpathlineto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
        \pgfpathclose
        \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
        \pgfusepath{draw}
    \endpgfscope
        % draw leads
        \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}{0pt}}

        \pgfusepath{draw}
      }
    }
  \makeatother

\begin{document}

\begin{circuitikz}
\node[inverter] {};
\end{circuitikz}

\end{document}

demo

|improve this answer|||||
  • Great, thanks! Any chance you also know how to make that symbol? – thesmith Jun 14 '16 at 6:44
  • I wasn't sure if the symbol was really part of the inverter or something else (trademark?). – John Kormylo Jun 14 '16 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.