[Tex/LaTex] Tikz – change symbol of pmos

circuitikztikz-pgf

The default pmos symbol which appears in such a simple code

\documentclass{article}
\usepackage{tikz}
\usepackage{circuitikz}

\begin{document}
\begin{center}
\begin{tikzpicture}[american]

\ctikzset{tripoles/mos style/arrows}

\draw (0,0) node[pmos,anchor=source] (M1){}; 

\end{tikzpicture}
\end{center}
\end{document}

has a bold dot in its gate. I found some code which maybe is the definition of the component in this source file, at the line \pgfcircdeclaremos{pmos}.

With or without using that source file, is there a way to remove the dot?

I would like to obtain a pmos symbol exactly equal to the nmos one (except that for the different arrow), so I would like to remove the dot but not the arrow from the pmos.

Best Answer

A possible solution is following. I've copied pmos definition from pgfcirctripoles.sty file to preamble and commented out last lines which draw the circle. That's all.

\documentclass{article}
\usepackage{tikz}
\usepackage{circuitikz}

\makeatletter
\pgfcircdeclaremos{pmos}{
          \anchor{S}{
            \northeast
          }
          \anchor{source}{
            \northeast
          }
          \anchor{D}{
            \northeast
            \pgf@y=-\pgf@y
          }
          \anchor{drain}{
            \northeast
            \pgf@y=-\pgf@y
          }
}{%
            \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
            \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
            \pgfpathlineto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
            \pgfusepath{draw}

        \ifpgf@circuit@mos@arrows
            \pgfscope             
            \pgfslopedattimetrue 
            \pgfallowupsidedownattimetrue
            \pgfresetnontranslationattimefalse
            \pgftransformlineattime{.4}{%
                \pgfpoint%
                    {\pgf@circ@res@right}%
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
            }{%
                \pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
            }
            \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
            \endpgfscope
        \fi

            \pgfscope
            \pgfpathmoveto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
            \pgfpathlineto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
            \pgfsetlinewidth{2\pgflinewidth}
            \pgfusepath{draw}
            \endpgfscope

            \pgfpathmoveto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
            \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
            \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}      

            \pgfpathmoveto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
            \pgfpathlineto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}


            \pgfpathmoveto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
                {\pgf@circ@res@up+\pgf@circ@res@down}}
            \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
            \pgfusepath{draw}

%           \pgfpathcircle{\pgfpoint
%               {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
%               {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
%           \pgfusepath{draw,fill}      

}
\makeatother

\begin{document}
\begin{center}
\begin{tikzpicture}[american]

\ctikzset{tripoles/mos style/arrows}

\draw (0,0) node[pmos,anchor=source] (M1){new pmos}; 

\draw (0,2) node[nmos,anchor=source] (M2){nmos}; 
\end{tikzpicture}
\end{center}
\end{document}

enter image description here