How to draw this figure in Latex?

by JSN   Last Updated May 16, 2019 06:23 AM

enter image description here

I am using latex for first time. I want to draw the picture below. How to proceed?

Tags : diagrams


Answers 2


Maybe, this can help you.

\documentclass[tikz]{standalone}

\begin{document}
    \begin{tikzpicture}
        \draw[ultra thin] (0,0)--(3.5,-2.2)--(2.7,-6)--(-2.7,-6)--(-3.5,-2.2)--(0,0)--
              (2.7,-6)--(-3.5,-2.2);
        \draw[ultra thin] (0,0)--(-2.7,-6)--(3.5,-2.2);
        \draw [fill](0,0)circle[radius=0.7mm]node[above]{$a$};
        \draw [fill](3.5,-2.2)circle[radius=0.7mm]node[right]{$b$};
        \draw [fill](2.7,-6)circle[radius=0.7mm]node[below]{$ab$};
        \draw [fill](-2.7,-6)circle[radius=0.7mm]node[below]{$ab^2$};
        \draw [fill](-3.5,-2.2)circle[radius=0.7mm]node[left]{$b^2$};
    \end{tikzpicture}
\end{document}
nico.wagner
nico.wagner
May 16, 2019 05:59 AM

Something like this:

enter image description here

The main idea is to use tikz polar coordinates and a loop:

\documentclass{article}
\usepackage{tikz}

\begin{document}

  \begin{tikzpicture}[bullet/.style={circle, fill, inner sep=2pt}]
    \foreach \lab [count=\c, 
                   evaluate=\c as \ang using {18+72*\c}] 
    in {a,b^2, ab^2, ab, b} {
       \node[bullet] (\c) at (\ang:10mm) {};
       \node at (\ang:14mm){$\lab$};
       \foreach \i in {1,...,\c} {
          \draw(\i)--(\c);
       }
    }
  \end{tikzpicture}

\end{document}

EDIT Oops, I noticed that I have an extra edge. If this really is not wanted then here is a fix to give:

enter image description here

using:

\documentclass{article}
\usepackage{tikz}

\begin{document}

  \begin{tikzpicture}[bullet/.style={circle, fill, inner sep=2pt}]
    \foreach \lab [count=\c, evaluate=\c as \ang using {18+72*\c}] in {a,b^2, ab^2, ab, b} {
       \node[bullet] (\c) at (\ang:10mm) {};
       \node at (\ang:14mm){$\lab$};
    }
    \draw(5)--(1)--(2)--(3)--(4)--(5)--(3)--(1)--(4)--(2);
  \end{tikzpicture}

\end{document}
Andrew
Andrew
May 16, 2019 06:02 AM

Related Questions


Updated February 01, 2017 14:09 PM

Updated April 05, 2018 02:23 AM

Updated August 18, 2017 09:23 AM

Updated August 20, 2017 21:23 PM

Updated September 04, 2017 17:23 PM