13

How do I do this in TikZ:

I want to draw a circular node with a cross in it to resemble a multiplier like in the diagram shown in the link below. I can draw a circle but I don't know how to put the cross inside.

28
\documentclass{scrartcl}
\usepackage{tikz} 

\begin{document}
\begin{tikzpicture}[cross/.style={path picture={ 
  \draw[black]
(path picture bounding box.south east) -- (path picture bounding box.north west) (path picture bounding box.south west) -- (path picture bounding box.north east);
}}]

 \node [draw](A){start};
 \node [draw,circle,cross,minimum width=1 cm](B) at (3,0){}; 
  \node [draw](C) at( 5,0){end}; 
\draw[->] (A) -- (B) -- (C);

\end{tikzpicture}

\end{document} 

enter image description here

2

Below a solution with four parameters for putting labels in the 4 circle sections. It would be nice to place the args relatively to the shape width/height, but I don't know how it can be done.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}

\tikzset{add/.style n args={4}{
    minimum width=6mm,
    path picture={
        \draw[black] 
            (path picture bounding box.south east) -- (path picture bounding box.north west)
            (path picture bounding box.south west) -- (path picture bounding box.north east);
        \node at ($(path picture bounding box.south)+(0,0.13)$)     {\tiny #1};
        \node at ($(path picture bounding box.west)+(0.13,0)$)      {\tiny #2};
        \node at ($(path picture bounding box.north)+(0,-0.13)$)        {\tiny #3};
        \node at ($(path picture bounding box.east)+(-0.13,0)$)     {\tiny #4};
        }
    }
}

\begin{document}

\begin{tikzpicture}
\node[draw,circle,add={1}{2}{3}{4}] {}; 
\end{tikzpicture}

\end{document}

enter image description here enter image description here

1

I full the previous answer with a solution made ​​with the package schemabloc

\documentclass{article}
\usepackage{tikz}
\usepackage{schemabloc}


\begin{document}
{\centering
\begin{tikzpicture}
\sbEntree{dspk}           
\sbBloc[5]{band}{Bandpass filter}{dspk}     
\sbRelier[\parbox{5em}{DSPK \\ signal}]{dspk}{band}
 \sbBlocL{logic}{Logic circuit}{band}  
 \sbSumb[3]{sum}{logic}  
 \sbRelier{logic}{sum}
 \sbDecaleNoeudy[5]{band}{delay}
 \sbBloc[8]{delay}{Delay}{delay}
\sbRelieryx{band-logic}{delay}
\sbRelierxy{delay}{sum}
 \sbBlocL{int}{\parbox{5em}{Integrate \& Dump} }{sum}  
  \sbBlocL{thres}{\parbox{5em}{Treshold \ Device} }{int}  
  \sbSortie[4]{S}{thres}                
\sbRelier[OP]{thres}{S}
\end{tikzpicture}

}

\end{document}

Please note the package requires version 2.1cvs of pgf

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.