I have an assignment which involves drawing the layout of some wiring. I have been using a different program, but the rest of my work is in LaTeX and so I would like to learn how use LaTeX to create the image as well.

My image is here:

enter image description here

Essentially the little black squares need to be able to be connected to each other vertically across the gap. I have been using circuitikz to try to complete my task, but I haven't yet worked out how to create something that looks similar enough that someone would understand what it represented.

I am looking to create the image above, but without the fill or the grid lines, so it would be rows of little boxes with circles inside that could be connected by lines.

If anyone has any suggestions to which packages (if not circuitikz) or something that I could be doing in circuitikz then that would greatly be appreciated.


  • How elaborate will the image get? It doesn't seem like it would necessarily require the power of tikz.
    – Werner
    May 22, 2014 at 4:08
  • 1
    The most elaborate it could get is by having each point in the top row be connected to a different point in the bottom row so that they would be crossing over.
    – John W
    May 22, 2014 at 4:18
  • Do you want to use the diagram for etching PCB? Standard dimension must be well considered. May 22, 2014 at 5:12

3 Answers 3


If you prefer to use TikZ, there is a solution, which reproduces the figure you pasted:

    \filldraw[fill=red!80!black, draw=black, thick] (#1,#2) circle(0.4);
    \fill[red!50!white] (#1,#2) circle(0.1);

  % Background grid
  \draw[cyan!40] (0,0) grid (74, 20);

  % single dot

  % Top row
  \foreach \width in {4,6,8,8,5,8,8,8} { % the list is the width of each group
    \foreach \i in {1,...,\width} {
      \mydot(\x+\i, 17); \mydot(\x+\i, 16);

  % Bottom row
  \foreach \width in {8,13,10,8,5,4,4} {
    \foreach \i in {1,...,\width} {
      \mydot(\x+\i, 4); 


You can redefine \mydot macro to suit your needs (which I didn't fully understand). For example, this is what I think you described:

    \draw[draw=black, thick] (#1-0.4,#2-0.4) rectangle +(0.8,0.8);
    \draw[thin] (#1,#2) circle(0.2);

which produces (I commented out the \draw .. grid this time):


  • Cheers, this is exactly what I was imagining!
    – John W
    May 22, 2014 at 9:17

Run with xelatex (needs some time) or with latex->dvips->ps2pdf. ~ is one node, defined by row,col


\def~{ \pscircle[fillstyle=solid,fillcolor=red](0,0){2mm} & }
&&~~~~&~~~~~~&~~~~~~~~&~~~~~~~~\\ % 1
~&~~~~&~~~~~~&~~~~~~~~&~~~~~~~~\\ % 2
\\ \\ \\ % 3 4 5
\\ \\ \\ % 6 7 8
\\ \\ \\ % 9 10 11
&&~~~~~~~~&~~~~~~~~~~~~&~~~~~~~~~~\\ %12

enter image description here


This is another TiKZ solution which uses matrix nodes. Redefine point style to change connectors appearance.

    point/.style={circle,minimum size=2mm,fill=red, draw=red!30!black},
    block/.style={matrix of nodes, nodes in empty cells, nodes={point, anchor=center}},

    \node[point] (A) {};
    \matrix[block, right=3mm of A, matrix anchor=B-2-1.center] (B) {&&&\\&&&\\};
    \matrix[block, right=3mm of B] (C) {&&&&&\\&&&&&\\};
    \matrix[block, right=3mm of C] (D) {&&&&&&&\\&&&&&&&\\};
    \matrix[block, right=3mm of D] (E) {&&&&&&&\\&&&&&&&\\};
    \matrix[block, below=1cm of B-2-1, matrix anchor=F-1-1.center] (F) {&&&&&&&\\};
    \matrix[block, right=3mm of F] (G) {&&&&&&&&&&&\\};
    \matrix[block, right=3mm of G] (H) {&&&&&&&&&\\};

    \draw[thick] (B-2-3.center) -- (G-1-5.center);
    \draw[thick] (C-1-5.center) -- (F-1-2.center);

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .