2

I'm trying to create this simple diagram:

enter image description here

How can I do?

7
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Sep 30, 2021 at 12:18
  • Welcome to the TeX.SE. community.
    – Sebastiano
    Sep 30, 2021 at 12:18
  • 1
    for a suggestion \documentclass[tikz,border=5mm]{standalone} \usepackage{amssymb} \begin{document} \begin{tikzpicture}[scale=1.8] \draw[nodes={fill=white}] (30:1) node{$\{a\}$}-- (90:1) node{$\{a,b,c\}$}-- (150:1) node{$\{a,b\}$}-- (210:1) node{$\{a\}$}-- (270:1) node[below]{$\varnothing$}-- (330:1) node{$\{c\}$} --cycle; \end{tikzpicture} \end{document}
    – Black Mild
    Sep 30, 2021 at 12:29
  • 1
    Thank you so much, it's perfect.
    – Pablo
    Sep 30, 2021 at 12:30
  • 2
    I’m voting to close this question because solved in comments.
    – Roland
    Oct 5, 2021 at 3:25

3 Answers 3

7

Another alternative is tikz-cd:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep = small, arrows = -]
& \{a,b,c\}\\
\{a,b\}\ar[ru] && \{a,c\}\ar[lu]\\
\{a\}\ar[u] && \{c\}\ar[u]\\
& \emptyset\ar[lu]\ar[ru]
\end{tikzcd}
\end{document}

enter image description here

6

The xypic package is quite good at this sort of diagram.

enter image description here

\documentclass[margin=5mm]{standalone}
\usepackage[all]{xy}
\begin{document}
\xymatrix @R=5mm @C=4mm {
& \{a,b,c\} \ar@{-}[rd] \ar@{-}[ld] \\
\{a,b\} \ar@{-}[d]  & & \{a,c\} \ar@{-}[d] \\
\{a\}   \ar@{-}[rd] & & \{c\}   \ar@{-}[ld] \\
& \emptyset}
\end{document}
1
  • 1
    I like very much xy package :-)
    – Sebastiano
    Sep 30, 2021 at 15:37
3

A pstricks  solution, based on the \psDefBoxNodes, which defines 12 nodes in the bounding box of a text, and a matrix environment:

\documentclass[pstricks]{standalone}
\usepackage{mathtools, amssymb}
\usepackage{pst-node}

\begin{document}
\[
 \renewcommand{\arraystretch}{2.5}
\begin{matrix}
  & \psDefBoxNodes{T}{\{a,b,c\}} & \\
   \psDefBoxNodes{P1}{\{a,b\}} & & \psDefBoxNodes{P2}{\{a,c\}}\\
\psDefBoxNodes{S1}{\{a\}} & & \psDefBoxNodes{S2}{\{c\}} \\
  & \psDefBoxNodes{B}{\varnothing}
\end{matrix}
\psset{linewidth=1.5pt, linejoin=1, labelsep=3pt}
\uput[u](B:tC){\pnode{E}}\uput[d](T:bC){\pnode{U}}
\uput[u](P1:tC){\pnode{Q1}}\uput[u](P2:tC){\pnode{Q2}}
\uput[d](P1:bC){\pnode{Q3}}\uput[d](P2:bC){\pnode{Q4}}
\uput[u](S1:tC){\pnode{T1}}\uput[u](S2:tC){\pnode{T2}}
\uput[d](S1:bC){\pnode{T3}}\uput[d](S2:bC){\pnode{T4}}
\psline(Q1)(U)(Q2)
\psline(Q3)(T1)\psline(Q4)(T2)
\psline(T3)(E)(T4)
\]

\end{document} 

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.