enter image description here

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

  • 1
    What have you tried so far? – user156344 May 16 at 5:35
  • 1
    In the future, please post an MWE to show what you have already tried ;-) – Thorbjørn E. K. Christensen May 16 at 6:41
  • 1
    The first step is to start going through the TikZ manual. You don't need to read the whole thing, but some of the tutorials will get you started. – John Kormylo May 16 at 12:12

Something like this:

enter image description here

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



  \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} {


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




  \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$};


Without additional packages:








enter image description here


Based on https://tex.stackexchange.com/a/152591/189040

pair[] vertices;
int n = 5; 
real r = 1.0; 

// Add the vertices to the array:
for (real angle = 18; angle < 378; angle += 360/n) {
    // The `push` command adds its argument to the end of the array.
    vertices.push(r*dir(angle));  // r*dir(angle) gives the point with polar coordinates (r, angle).

// Draw the vertices:
for (pair vertex : vertices)

// Draw a couple lines in respective:
draw(vertices[0] -- vertices[1], black);
//draw(vertices[0] -- vertices[2], black);
draw(vertices[0] -- vertices[3], black);
draw(vertices[0] -- vertices[4], black);

draw(vertices[1] -- vertices[2], black);
draw(vertices[1] -- vertices[3], black);
draw(vertices[1] -- vertices[4], black);

draw(vertices[2] -- vertices[3], black);
draw(vertices[2] -- vertices[4], black);

draw(vertices[3] -- vertices[4], black);

label("b", vertices[0], align=E);
label("a", vertices[1], align=N);
label("$b^2$", vertices[2], align=W);
label("$ab^2$", vertices[3], align=SW);
label("ab", vertices[4], align=SE);


enter image description here


Based on https://tex.stackexchange.com/a/228371/189040




  \multido{\i=0+1}{7}{\rput{90}{\degrees[5]\pnode(1;\i){v\i}}}% Mark nodes
    \pcline(v\i)(v\number\numexpr\i+1)% C_5<1>
    \pscircle[fillstyle=solid,fillcolor=black](v\i){2pt}% node
       \pcline(v\i)(v\number\numexpr\i+2)% C_5<2>




enter image description here

  • 1
    \SpecialCoor is no longer needed. – Gold Digging Programmer May 16 at 15:44
  • @ArtificialOdorlessArmpit Good to know! Thanks! – user189040 May 16 at 15:44

Or using shapes.geometric.

 \node[regular polygon,regular polygon sides=5,draw,minimum width=8em] (5gon){};
 \draw (5gon.corner 2) node[circle,fill,inner
 foreach \X in {4,1,3,5} {-- (5gon.corner \X)

enter image description here


Maybe, this can help you.


        \draw[ultra thin] (0,0)--(3.5,-2.2)--(2.7,-6)--(-2.7,-6)--(-3.5,-2.2)--(0,0)--
        \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$};

A PSTricks solution only for fun purposes. It was intentionally or deliberately made complicated to popularize the buried features in PSTricks such as:

  • \degrees
  • saveNodeCoors
  • \curvepnodes
  • \psnpolygon
  • PtoCrel
  • DegtoAny

    \curvepnodes[plotpoints=6]{0}{5}{4 t 1 4 div add PtoCrel}{A}
    \foreach \i/\j in {0/b,1/a,2/{b^2},3/{ab^2},4/{ab}}
            {\uput{10pt}[!N-A\i.y N-A\i.x atan DegtoAny](A\i){$\j$}}
    \foreach \i/\j in {3/0,3/1,4/1,4/2}

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.