2

I want to make a logical diagram like that : diagram

mirror image : https://pasteboard.co/HicPswl.png

But I don't want to add picture with \includegraphics... I have no experience diagrams in latex. Can you give an example code ? I find some example in circuit diagram TikZ package. But I could not find similar above diagram. Thanks for your help.

My attempt and result :

\tikzstyle{block} = [draw,fill=blue!20,minimum size=2em]
% diameter of semicircle used to indicate that two lines are not connected
\def\radius{.7mm} 
\tikzstyle{branch}=[fill,shape=circle,minimum size=3pt,inner sep=0pt]
\tikzstyle{block} = [draw,fill=blue!10,minimum size=2em]

\begin{tikzpicture}[circuit logic US, huge circuit symbols]

\node[block] at (0,0) (block1) {Sınıf diğer sınıfların niteliklerine erişmekte \newline
ATFD > 3};
\node[block] at (0,2) (block2) {Sınıfın fonksiyonel karmaşıklığı fazla
\newline
WMC >= 47};
\node[block] at (0,4) (block3) {Sınıf diğer sınıfların niteliklerine erişmekte \newline
ATFD > 3};

\node[and gate US, draw, rotate=0] at (7,2) (And1) {};

\draw[->] (block1) -- (And1);
\draw[->] (block2) -- (And1);
\draw[->] (block3) -- (And1);
\node[block] at (9,2) (Result) {God Class};
\draw[->] (And1) -- (Result);
\end{tikzpicture}

result : https://pasteboard.co/HidxBjn.png

  • Welcome to TeX.SX! Basically circuitikz is able to draw the logical gates you need and provides the anchor points to connect with arbitrary TikZ nodes, so please have a try and post your attempt here (as minimal compilable code example). – TeXnician Apr 25 '18 at 6:03
  • @TeXnician I post my attempt – Melih Altıntaş Apr 25 '18 at 7:47
2

Here is a starting point

\documentclass[tikz]{standalone}
\usetikzlibrary{circuits.logic.US}
\begin{document}
\begin{tikzpicture}[circuit logic US]
\node[draw,align=center] (box1) at (-2,2) {Some centered tex \\ with math \\ \\ $\sin(\pi)$};
\node[draw,align=center] (box2) at (-2,0) {Some centered tex \\ with math \\ \\ $\sin(\pi)$};
\node[draw,align=center] (box3) at (-2,-2) {Some centered tex \\ with math \\ \\ $\sin(\pi)$};
\node [and gate] (a1) at (1,0) {VE};
\node[draw] (a2) at (3,0) {other node};

\draw (box1.east) -|++(1mm,-1mm)|- ([yshift=1mm]a1.west);
\draw (box3.east) -|++(1mm,1mm)|- ([yshift=-1mm]a1.west);
\draw(box2) -- (a1);
\draw (a1) -- (a2);
\end{tikzpicture}
\end{document}

enter image description here

The rest you can find it either in the manual or searching on this site.

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.