为了使图中图形的边缘看起来美观,我想给每条边添加以下一组选项:[draw=white, double=black, very thick]
。同时,我想像这样绘制边缘:
\draw (0, 0) -- (1, 1);
\draw (1, 0) -- (0, 1);
但事实并非如此:
\draw[draw=white, double=black, very thick] (0,0) -- (1,1);
\draw[draw=white, double=black, very thick] (1,0) -- (0,1);
我尝试使用scope
,但由于某种原因它不起作用(尽管对于简单的设置来说[red]
一切都运行正常)。
我该如何正确设置环境以便每个人都\draw
使用我想要的风格?
梅威瑟:
\begin{tikzpicture}
\def\MyDraw{\draw[draw=white, double=black, very thick]}
\foreach \i in {1, ..., 6} {
\MyDraw (c) -- (b \i);
}
\draw (0, 0) -- (1, 1);
\draw (1, 0) -- (0, 1);
\end{tikzpicture}
答案1
您可以为每条路径添加样式:
\documentclass[border=0.618cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[every path/.style={double=black},draw=white,very thick]
\draw (0,0) -- (1,1);
\draw (1,0) -- (0,1);
\end{tikzpicture}
\end{document}