-1

I am trying to draw the following block diagram using TikZ... No way :( Can anyone help me?enter image description here

Thank you so much!!!

  • Please provide an MWE indicating what you have tried and where you're still having trouble! Otherwise, questions that just post an image and say "Draw this for me" don't get a good reception here... You can also look at the tutorials in the PGF manual. Thanks :-) – darthbith Apr 9 '15 at 18:54
  • 2
    Please give the OP some time to improve the post... – user31729 Apr 9 '15 at 19:12
  • Review the tikz diagrams here and I believe one of them will provide you with an working example that you can modify into your desired diagram. texample.net/tikz/examples/tag/block-diagrams – R. Schumacher Apr 9 '15 at 20:00
  • With Ignasi's answer I understood tikz diagrams! I had this a strange error with the package, but this post solved it tex.stackexchange.com/questions/166024/… – Kevin Apr 9 '15 at 20:25
10

Try to understand this one. It's just one possibility.

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning,arrows.meta}

\begin{document}
\begin{tikzpicture}[block1/.style={draw, minimum width=3cm, minimum height=1.8cm},
                    block2/.style={draw, minimum width=1cm, minimum height=.8cm},
                    >=Stealth]
\node[block1,label=above:lol] (b1) {lol};
\node[block1, right=5cm of b1] (b2) {lol2};
\path ([yshift=-3mm]b1.center)--([yshift=-3mm]b2.center) node [midway,block2] (b3) {lol3};
\draw[->] ([yshift=3mm]b1.east)--node[above] {c} ([yshift=3mm]b2.west);
\draw[->] ([yshift=-3mm]b1.east)--node[below] {a} (b3.west);
\draw[<-] ([yshift=-3mm]b2.west)--node[below] {b} (b3.east);
\draw[->] (b2.east)--++(0:1cm) node[right] {thanks!};
\end{tikzpicture}
\end{document}

enter image description here

9

Just for fun, with Plain TeX:

\obeylines\obeyspaces\let =\ \tt\catcode`\_=11
   lol
_________                c               ____________
|        |---------------------------->|            |
|  lol   |             ______          |   lol2     |----> thanks!
|        |-----------> | lol3|-------->|            |
|________|             |_____|         |____________|
              a                   b
\bye

Alternatively, with eplain's verbatim facilities:

\input eplain

\verbatim|
   lol
_________                c               ____________
|        |---------------------------->|            |
|  lol   |             ______          |   lol2     |----> thanks!
|        |-----------> | lol3|-------->|            |
|________|             |_____|         |____________|
              a                   b
|endverbatim
\bye

Both give the requested result:

enter image description here

The space between the underscore characters is a result of the font used (here, cmtt).

  • 2
    You definitely have too much spare time to use Plain TeX ;-) (+1) – user31729 Apr 13 '15 at 23:52
  • 1
    @ChristianHupfer "sometimes the old ways are best". :-) Shorter code and looks closer to the desired result than the accepted answer... ;-) – Paul Gessler Apr 14 '15 at 0:02
  • Let me make an educated guess: The OP used ASCII characters to generate the block diagram? ;-) – user31729 Apr 14 '15 at 0:04

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.