I need to draw following hypergraph in Latex.
enter image description here

My attempt-

\usepackage{pst-grad} % For gradients
\usepackage{pst-plot} % For axes
\usepackage[space]{grffile} % For spaces in paths
\usepackage{etoolbox} % For spaces in paths
\makeatletter % For spaces in paths
\patchcmd\Gread@eps{\@inputcheck#1 }{\@inputcheck"#1"\relax}{}{}



\psscalebox{0.5 0.5} % Change this value to rescale the drawing.
\psrotate(2.7260337, 0.3329967){-38.651867}{\psellipse[linecolor=black, linewidth=0.04, dimen=outer](2.7260337,0.33299673)(3.3083334,1.3883333)}
\psrotate(1.1277003, 1.5757744){7.4958577}{\psdots[linecolor=black, dotsize=0.8378179](1.1277003,1.5757744)}
\psdots[linecolor=black, dotsize=0.8](2.585478,0.40244114)
\psdots[linecolor=black, dotsize=0.8](4.1499224,-0.8420033)
\psellipse[linecolor=black, linewidth=0.04, dimen=outer](6.994367,-0.80867)(3.6977777,1.2588888)
\psdots[linecolor=black, dotsize=0.8](6.8521447,-0.7708922)
\psdots[linecolor=black, dotsize=0.8](9.056589,-0.69978106)
\psellipse[linecolor=black, linewidth=0.04, dimen=outer](6.9232564,-2.6731143)(1.2444445,3.0044444)
\psdots[linecolor=black, dotsize=0.8](6.745478,-2.619781)
\psdots[linecolor=black, dotsize=0.8](6.7810335,-4.1131144)
\psellipse[linecolor=black, linewidth=0.04, dimen=outer](9.234367,-4.2197814)(3.3422222,1.0311111)
\psdots[linecolor=black, dotsize=0.8](9.234367,-4.219781)
\psdots[linecolor=black, dotsize=0.8](11.225478,-4.219781)

however it does not give any result. If possible can anyone explain or give a sample code? I am ok with tikz too.

  • I obtain a result compiling with xelatex but the upper-leftmost dot is not where it should be.
    – Bernard
    Dec 18, 2021 at 9:20

2 Answers 2


Welcome to TeX.SE!!!

This can be easily done in TikZ defining a \pic for the ellipse with the three dots. We can add a parameter which shifts the \pic to one dot or another, and then the positioning is very simple.

Something like this:


  pics/my ellipse/.style={% #1 --> shift to node (1,2,3)
            \draw (0,0) ellipse (2.5cm and 0.75cm);
            \foreach\i in {1,2,3}
              \fill (1.5*\i-3,0) circle  (0.5) node (-\i) {};
  pics/my ellipse/.default={2},

\pic             (A) at (0,0) {my ellipse};
\pic[rotate= 90] (B) at (A-2) {my ellipse=1};
\pic             (C) at (B-1) {my ellipse=3};
\pic[rotate=300] (D) at (A-1) {my ellipse=1};

enter image description here

  • Fabulous also this LOL :-)
    – Sebastiano
    Dec 21, 2021 at 8:10

run with lualatex to get directly the pdf:






or with easier coordinates:


1.06 = 0.75*sqrt(2) (cosinus)

enter image description here

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.