使用 tikz 进行标记

使用 tikz 进行标记

我想让标签 C 不与线重叠。我应该怎么做?

\documentclass{article}
\usepackage[dvipdfmx]{graphicx}
\usepackage{tikz}
\def\PHI{1.61803}
\begin{document}
\begin{tikzpicture}[line join=bevel,z=4.5,scale=1.5]
\coordinate (A) at (\PHI, 1 , 0);
\draw (\PHI, 1 , 0) node[above right] {$A$};
\coordinate (B) at (\PHI, - 1 , 0);
\draw (\PHI, - 1 , 0) node[below right] {$D$};
\coordinate (C) at ( - \PHI , - 1 , 0);
\coordinate (D) at ( - \PHI , 1 , 0);
\coordinate (E) at ( - 1, 0 , \PHI);
\coordinate (F) at (1 , 0 , \PHI);
\coordinate (G) at ( - 1 , 0 , - \PHI);
\coordinate (H) at (1 , 0 , - \PHI);
\draw (1 , 0 , - \PHI) node[above = 0.7mm] {$C$};
\coordinate (I) at (0 , \PHI , 1);
\draw (0 , \PHI , 1) node[above] {$D$};
\coordinate (J) at (0 , \PHI , - 1);
\coordinate (K) at (0 , - \PHI , - 1);
\coordinate (L) at (0 , - \PHI , 1);
\draw[dashed] (A)--(F)--(B);
\draw[dashed] (B)--(L)--(F);
\draw[dashed] (E)--(F)--(L)--cycle;
\draw[dashed] (C)--(E)--(L)--cycle;
\draw[dashed] (C)--(E)--(D);
\draw[dashed] (E)--(I)--(F);
\draw[dashed] (B)--(L)--(K);
\draw (I)--(J)--(A)--cycle;
\draw[dashed] (I)--(J)--(D)--cycle;
\draw[dashed] (A)--(H)--(B);
\draw[dashed] (B)--(K)--(H)--cycle;
\draw[dashed] (G)--(K)--(H);
\draw[dashed] (C)--(G)--(K)--cycle;
\draw[dashed] (C)--(G)--(D);
\draw[dashed] (G)--(D)--(J)--cycle;
\draw[dashed] (G)--(J)--(H);
\draw[dashed] (A)--(H)--(J)--cycle;
\draw (A)--(I)--(D)--(C)--(K)--(B)--cycle;
\draw (I)--(J);
\draw (D)--(J);
\draw (G)--(J);
\draw (H)--(J);
\draw (A)--(J);
\draw (D)--(G);
\draw (C)--(G);
\draw (K)--(G);
\draw (H)--(G);
\draw[thick] (G)--(H);
\draw (A)--(H);
\draw (B)--(H);
\draw (K)--(H);
\end{tikzpicture}
\end{document}

答案1

下面我评论了\usepackage[dvipdfmx]{graphicx}。任何取消评论的人可能需要知道,正如 muzimuzhi Z 指出的那样,然后您需要使用例如进行编译latex并运行dvipdfmxxdvipdfmx

无论如何,对于主要问题,你需要做的就是更慷慨一点,而不是above = 0.7mm使用例如above = 2mm来获得

\documentclass{article}
%\usepackage[dvipdfmx]{graphicx}
\usepackage{tikz}
\def\PHI{1.61803}
\begin{document}
\begin{tikzpicture}[line join=bevel,z=4.5,scale=1.5]
\coordinate (A) at (\PHI, 1 , 0);
\draw (\PHI, 1 , 0) node[above right] {$A$};
\coordinate (B) at (\PHI, - 1 , 0);
\draw (\PHI, - 1 , 0) node[below right] {$D$};
\coordinate (C) at ( - \PHI , - 1 , 0);
\coordinate (D) at ( - \PHI , 1 , 0);
\coordinate (E) at ( - 1, 0 , \PHI);
\coordinate (F) at (1 , 0 , \PHI);
\coordinate (G) at ( - 1 , 0 , - \PHI);
\coordinate (H) at (1 , 0 , - \PHI);
\draw (1 , 0 , - \PHI) node[above = 2mm] {$C$};
\coordinate (I) at (0 , \PHI , 1);
\draw (0 , \PHI , 1) node[above] {$D$};
\coordinate (J) at (0 , \PHI , - 1);
\coordinate (K) at (0 , - \PHI , - 1);
\coordinate (L) at (0 , - \PHI , 1);
\draw[dashed] (A)--(F)--(B);
\draw[dashed] (B)--(L)--(F);
\draw[dashed] (E)--(F)--(L)--cycle;
\draw[dashed] (C)--(E)--(L)--cycle;
\draw[dashed] (C)--(E)--(D);
\draw[dashed] (E)--(I)--(F);
\draw[dashed] (B)--(L)--(K);
\draw (I)--(J)--(A)--cycle;
\draw[dashed] (I)--(J)--(D)--cycle;
\draw[dashed] (A)--(H)--(B);
\draw[dashed] (B)--(K)--(H)--cycle;
\draw[dashed] (G)--(K)--(H);
\draw[dashed] (C)--(G)--(K)--cycle;
\draw[dashed] (C)--(G)--(D);
\draw[dashed] (G)--(D)--(J)--cycle;
\draw[dashed] (G)--(J)--(H);
\draw[dashed] (A)--(H)--(J)--cycle;
\draw (A)--(I)--(D)--(C)--(K)--(B)--cycle;
\draw (I)--(J);
\draw (D)--(J);
\draw (G)--(J);
\draw (H)--(J);
\draw (A)--(J);
\draw (D)--(G);
\draw (C)--(G);
\draw (K)--(G);
\draw (H)--(G);
\draw[thick] (G)--(H);
\draw (A)--(H);
\draw (B)--(H);
\draw (K)--(H);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容