如何去除 tikz 中双线的核心颜色?
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[show background rectangle, background rectangle/.style={fill=lightgray}]
\draw[thin,double,-implies] (0,-0.8,0) -- (0,-1.9,0) ;
\end{tikzpicture}
\end{document}
答案1
这不是一个完美的解决方案,但如果没有其他选择……
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[show background rectangle, background rectangle/.style={fill=lightgray}]
\draw[thin,double,-implies] (0,-0.8,0) -- (0,-1.9,0) ;
\draw[-Triangle Cap,lightgray,line width=.589pt] (0,-0.8,0) -- (0,-1.866,0) ;
\end{tikzpicture}
\end{document}
答案2
当背景颜色已知且均匀时,可以double
使用背景颜色填充双线芯来模拟透明线。
double
选项默认绘制一条以白色为芯的双线,但我们可以使用double=red
来选择内部颜色。
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[show background rectangle, background rectangle/.style={fill=lightgray}]
\draw[thin,double,-implies] (0,-0.8) -- (0,-1.9);
\draw[thin,double=lightgray,-implies] (.5,-0.8) -- (.5,-1.9);
\draw[thin,double=red,-implies] (1,-0.8) -- (1,-1.9);
\end{tikzpicture}
\end{document}