## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Simple 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

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).
! TeX capacity exceeded, sorry

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

Tags:

Johannes_B
Site Moderator
Posts: 4109
Joined: Thu Nov 01, 2012 4:08 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.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 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.
\documentclass[11pt]{standalone}\usepackage{tikz}\usetikzlibrary{positioning} \begin{document}   \begin{tikzpicture}[%     node distance=1cm,     noname/.style={%       circle,       minimum size=3em,       draw     }   ]     \node[noname] (1)                                             {1};     \node[noname] (2) [below=of 1]                                {2};     \node[noname] (4) [node distance=1cm and 3mm,below left=of 2] {4};     \node[noname] (3) [left=of 4]                                 {3};     \node[noname] (5) [below=of 4]                                {5};     \node[noname] (6) [node distance=2cm,right=of 5]              {6};      \path (1) edge                   node {} (2)           (2) edge                   node {} (3)           (2) edge                   node {} (4)           (2) edge                   node {} (6)           (3) edge                   node {} (5)           (4) edge                   node {} (5)           (5) edge [bend right=20pt] node {} (2);   \end{tikzpicture}\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 (3.44 KiB) Viewed 4160 times
LaTeX Community Moderator

¹ 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
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.