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.

  • So you want to remove the dot but not the arrow? Or both the dot and arrow? – Alenanno Apr 9 '15 at 9:56
  • I want to remove the dot but not the arrow. – BowPark Apr 9 '15 at 9:58
up vote 3 down vote accepted

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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