LaTeX forum ⇒ Graphics, Figures & TablesSimple Box Diagram Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Simple Box Diagram

Postby Kotoschow » Thu Jun 13, 2013 4:03 pm

Hi,

I've been fussing about endlessly attempting to draw simple box diagrams. What I need is circular nodes connected with plain lines - no arrows. Every single option I tried failed somehow.

I tried using xymatrix, but whenever I asked for plain arrows, the command would not execute. I tried the diagrams package, but couldn't understand how to draw plain lines instead of arrows. Finally, I tried pgf/TikZ and pstricks, but whenever I try to import them to my code, the following error occurs (within the xcolor package).
  1. ! TeX capacity exceeded, sorry


If anyone could give me a simple, working, fool-proof solution, I would name him my hero. Thanks.

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4100
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Jun 13, 2013 4:10 pm

PGF/TikZ is a powerful tool to draw almost everything. Additionally, the package pgfplots is very good to draw almost every kind of diagram.

Try to make a self-contained and minimal working example of your attempts and post it here using the code button. This helps you to isolate the problem and us to help you.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Jun 13, 2013 5:28 pm

Kotoschow wrote:[…] 've been fussing about endlessly attempting to draw simple box diagrams. What I need is circular nodes connected with plain lines - no arrows. Every single option I tried failed somehow. […]

As you know for sure, you should always show those efforts. Otherwise nobody knows what you are doing and what's gone wrong. But …

Lucky you! Although I fully agree with Johannes about a minimal example, I found a small sample code based on PGF/TikZ in my archives which can serve as a good starting point.
  1. \documentclass[11pt]{standalone}
  2. \usepackage{tikz}
  3. \usetikzlibrary{positioning}
  4.  
  5. \begin{document}
  6. \begin{tikzpicture}[%
  7. node distance=1cm,
  8. noname/.style={%
  9. circle,
  10. minimum size=3em,
  11. draw
  12. }
  13. ]
  14. \node[noname] (1) {1};
  15. \node[noname] (2) [below=of 1] {2};
  16. \node[noname] (4) [node distance=1cm and 3mm,below left=of 2] {4};
  17. \node[noname] (3) [left=of 4] {3};
  18. \node[noname] (5) [below=of 4] {5};
  19. \node[noname] (6) [node distance=2cm,right=of 5] {6};
  20.  
  21. \path (1) edge node {} (2)
  22. (2) edge node {} (3)
  23. (2) edge node {} (4)
  24. (2) edge node {} (6)
  25. (3) edge node {} (5)
  26. (4) edge node {} (5)
  27. (5) edge [bend right=20pt] node {} (2);
  28. \end{tikzpicture}
  29. \end{document}

Take the user guide, try some modifications and ask targeted questions if you run into trouble or don't get what you want..


Thorsten
Attachments
tmp.png
tmp.png (3.44 KiB) Viewed 4092 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Postby Kotoschow » Fri Jun 14, 2013 6:24 pm

Well, it's actually embarrassing to admit, but the problem was that I imported gb4e before importing pgf/TikZ. That's all. For this reason, my MWEs were working, but my articles weren't. I realized it while I successfully compiled your MWE. So thanks a lot! And I surely learned a lesson here about the importance of a MWE.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 2 guests