I'm a LaTeX beginner and I'm trying to represent non-crossing pair partitions. An example of the kind of thing I want is in the attached jpg.
This is only an example so I would like to be able to draw anything that looks like it with different values and partitions.
I have installed the pgf package but I don't want to go through the whole manual so I can do this one thing. Can someone guide me through how to do it or give an example of some code for e.g. 3 partitions?
Thanks in advance.
Graphics, Figures & Tables ⇒ Drawing partitions
Drawing partitions
- Attachments
-
- partitions.jpg (5.14 KiB) Viewed 3336 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Drawing partitions
Sooner or later you will have study the manual. Some code off the top of my head.notnek wrote:[…] I have installed the pgf package but I don't want to go through the whole manual so I can do this one thing. […]
Code: Select all
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[thick,font=\small]
\path (0,0) node[circle,draw] (a) {1}
(1,0) node[circle,draw] (b) {2}
(2,0) node[circle,draw] (c) {3}
(3,0) node[circle,draw] (d) {4}
(4,0) node[circle,draw] (e) {5}
(5,0) node[circle,draw] (f) {6};
\draw (a) -- +(0,0.75) -| (d);
\draw (b) -- +(0,0.5) -| (c);
\draw (e) -- +(0,0.75) -| (f);
\end{tikzpicture}
\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10