TransWikia.com

Tikz hexagon with arrows and key

TeX - LaTeX Asked on April 20, 2021

How can I construct the following hexagon in tikz?

enter image description here

For now I tried:

begin{tikzpicture}[]
foreach l [count=n] in {text,text,text,text,text,text}
{pgfmathsetmacroangle{90-360/6*(n-1)}
node[label={angle:l}] (nn) at (angle:1) {};}
draw[dashed] (n2) -- (n4) -- (n6) -- (n2);
draw[dotted] (n1) -- (n3) -- (n5) -- (n1);
draw[->] (n2) -- (n1);
draw[->] (n2) -- (n3);
draw[->] (n4) -- (n3);
draw[->] (n4) -- (n5);
draw[->] (n6) -- (n5);
draw[->] (n6) -- (n1);
draw[>-<] (n1) -- (n4);
draw[>-<] (n2) -- (n5);
draw[>-<] (n3) -- (n6);
end{tikzpicture}

One Answer

Probably not the most elegant way... but it works:

documentclass[border=2mm]{standalone}
usepackage{tikz}

begin{document}
begin{tikzpicture}[
    implikation/.style={stealth-stealth, thick},
    disjunktion/.style={dotted},
    exklusion/.style={dashed},
    kontravalenz/.style={>-<, shorten >=5pt, shorten <=5pt},
]
    foreach[count=i from 1] txt/pos in {%
        verboten/right,%
        pflichtig/above,%
        geboten/left,%
        {(relativ)erlaubt}/left,%
        {indifferent(absolut) erlaubt}/below,%
        {ungeboten(freigestellt)}/right%
    }{
        coordinate[label={[align=center]pos:txt}] (node-i) at ({60*i-30}:2.5cm) {};
    }

    draw[exklusion] (node-1) -- (node-3) -- (node-5) -- (node-1);
    draw[disjunktion] (node-2) -- (node-4) -- (node-6) -- (node-2);

    foreach from/to in {1/4, 2/5, 3/6}{
        draw[kontravalenz] (node-from) -- (node-to);
    }

    foreach i/j/k in {6/1/2, 2/3/4, 4/5/6}{
        draw[implikation] (node-i) -- (node-j) -- (node-k);
    }

    begin{scope}[shift={(-3,-4)}]
        foreach xpos/ypos/name/style in {%
            0/0/Implikation/implikation,%
            3.5/0/Disjunktion/disjunktion,%
            0/-0.5/Exklusion/exklusion,%
            3.5/-0.5/Kontravalenz/kontravalenz%
        }{
            draw[style] (xpos,ypos) -- ++(0.8,0) node[right] {$=${} name};
        }
    end{scope}
end{tikzpicture}
end{document}

Correct answer by Wulle on April 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP