我需要你的帮助来在乳胶中绘制这个包含八个八边形的图形

我需要你的帮助来在乳胶中绘制这个包含八个八边形的图形

在此处输入图片描述

如何在 Latex 中绘制此图形?你能帮帮我吗?

答案1

我不确定我是否理解了 OP 图,但这里有一个尝试元帖子,包裹起来luamplib以备使用lualatex

在此处输入图片描述

\documentclass[border=5mm]{standalone}
\usepackage{luatex85}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
    path C;  C = fullcircle scaled 144 rotated -112.5;

    numeric dx, dy; dx = 233; dy = 189;
    x0 = x2 = x5 = x7 = 0;
    x1 = x4 = -x3 = -x6 = dx;
    1/2 dy = -y1 = -y2 = -y3 = y4 = y5 = y6;
    3/2 dy = -y0 = y7;

    interim ahangle := 30;

    picture tag[], big_tag[];
    tag0 = textext("$p_1, p_2, p_3$");
    tag1 = textext("$p_2, p_3$");
    tag2 = textext("\kern 24pt $p_1, p_3$");
    tag3 = textext("\kern 24pt $p_1, p_2$");
    tag4 = textext("$p_3$");
    tag5 = textext("$p_2$");
    tag6 = textext("$p_1$");
    tag7 = nullpicture;

    big_tag0 = textext("$\diamond P_1, \diamond P_2, \diamond P_3$");
    big_tag1 = textext("$\diamond P_2, \diamond P_3$");
    big_tag2 = textext("$\diamond P_1, \diamond P_3$");
    big_tag3 = textext("$\diamond P_1, \diamond P_2$");
    big_tag4 = textext("$\diamond P_3$");
    big_tag5 = textext("$\diamond P_2$");
    big_tag6 = textext("$\diamond P_1$");
    big_tag7 = nullpicture;

    for i=0 upto 7:
        label(big_tag[i], z[i]);
        for t=0 upto 7:
            drawdot (point t of C shifted z[i]) withpen pencircle scaled dotlabeldiam;
            label(decimal (8i+t+1), point t of C scaled 13/16 shifted z[i]);
            label(tag[t], point t of C scaled 9/8 shifted z[i]);
            drawdblarrow point t of C shifted z[i] -- point t+1 of C shifted z[i]
                cutbefore fullcircle scaled 5 shifted point t of C shifted z[i]
                cutafter fullcircle scaled 5 shifted point t+1 of C shifted z[i];
        endfor
    endfor

    vardef connection(expr m, n) = 
        save a, b, p, q, r, s;
        pair a, b; numeric p, q, r, s;
        p = (m-1) mod 8; q = floor ((m-1)/8);
        r = (n-1) mod 8; s = floor ((n-1)/8);
        a = point p of C shifted z[q];
        b = point r of C shifted z[s];
        a--b cutbefore fullcircle scaled 6 shifted a cutafter fullcircle scaled 6 shifted b
    enddef;

    drawarrow connection(4, 9);
    drawarrow connection(6, 17);
    drawarrow connection(7, 26);
    drawarrow connection(14, 33);
    drawarrow connection(15, 43);
    drawarrow connection(20, 40);
    drawarrow connection(23, 51);
    drawarrow connection(28, 48);
    drawarrow connection(30, 49);
    drawarrow connection(39, 59);
    drawarrow connection(46, 57);
    drawarrow connection(52, 64);

endfig;
\end{mplibcode}
\end{document}

笔记

  • 我依赖textext于 的“内置”宏luamplib。它将 LaTeX 输入字符串转换picture为可以draw或 传递给 的变量label

  • 因为普通 MP 定义了z@# = (x@#, y@#),所以您可以z0通过单独设置x0和来设置y0。我使用这个技巧来定义八边形的 8 个中心。

  • 我擅自整理了可怕的垂直堆叠

  • 我留下了点的颜色(黑色或白色),作为读者的练习

相关内容