2

I just wanted to know if there are any packages that build two or three intersecting sets, where you can put a number inside them, a capital letter on the set and with the universe set indicated a capital letter. Thank you.

See the example below.

enter image description here

Follow up 2023-10-16

I have these two MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb,venndiagram}
\begin{document}
\begin{venndiagram3sets}[labelOnlyA={1},labelOnlyB={2},labelOnlyC={3},
labelOnlyAB={4},labelOnlyAC={5},labelOnlyBC={6},labelABC={7},
labelNotABC={8}]
\end{venndiagram3sets}
\end{document}

enter image description here

The code with 2 sets not work well if I write labelOnlyAB={4}. In fact the 4 is missing in the A∩B. It is necessary to write labelAB={4} instead of labelOnlyAB={4}.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb,venndiagram}
\begin{document}
\begin{venndiagram2sets}[labelOnlyA={5},labelOnlyB={7}, labelAB={4},labelNotAB={15}]
\end{venndiagram2sets}
\end{document}

enter image description here

How can I put the set U outside the rectangle and upper right above the rectangle?

Sebastiano
  • 54,118

1 Answers1

1

By the comments of @Qrrbrbirlbel user I have found the correct aspect.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb,venndiagram,tikz} 
\begin{document} 
\begin{venndiagram2sets}[labelOnlyA={5},labelOnlyB={7}, labelAB={4},labelNotAB={15}] 
\setpostvennhook{\node[above right] at (venn top right){$|U|=50$};}
\end{venndiagram2sets} 
\end{document}

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb,venndiagram}
\begin{document}
\begin{venndiagram3sets}[labelOnlyA={1},labelOnlyB={2},labelOnlyC={3},
labelOnlyAB={4},labelOnlyAC={5},labelOnlyBC={6},labelABC={7},
labelNotABC={8}]
\setpostvennhook{\node[above right] at (venn top right){$|U|=30$};}
\end{venndiagram3sets}
\end{document}

enter image description here

Sebastiano
  • 54,118