![Tikzset 样式禁用模糊阴影](https://linux22.com/image/349810/Tikzset%20%E6%A0%B7%E5%BC%8F%E7%A6%81%E7%94%A8%E6%A8%A1%E7%B3%8A%E9%98%B4%E5%BD%B1.png)
有没有一种样式可以禁用blur shadow
已启用的?只需添加以下选项即可轻松禁用draw
和更改:fill
draw=none, fill=yellow
但没有看到一种可行的方法来禁用现有的blur shadow
。
笔记:
- 一个解决方案是定义
\MyPicture*
一个暂时禁用 pgfplots 中的 Tikz 阴影但我更喜欢用一种风格来做这件事,没有改变\MyPicture
代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\newcommand*{\MyPicture}[1][]{%
%% #1 = draw options.
\begin{tikzpicture}
\node [draw=red, thick,fill=magenta!25, blur shadow, #1] {Text};
\end{tikzpicture}%
}%
\begin{document}
\MyPicture
\quad
\MyPicture[draw=none, fill=yellow, blur shadow={}]% <-- How to disable shadow here
\end{document}
答案1
您可以更改shadow opacity
参数:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\newcommand*{\MyPicture}[1][]{%
%% #1 = draw options.
\begin{tikzpicture}
\node [draw=red, thick,fill=magenta!25, blur shadow, #1] {Text};
\end{tikzpicture}%
}%
\begin{document}
\MyPicture
\quad
\MyPicture[draw=none, fill=yellow, blur shadow={shadow opacity=0}]% <-- How to disable shadow here
\end{document}