我有以下代码,其中我重写了淡入淡出效果,以便它快速淡入淡出。这些效果称为等South
。North
在标记的代码片段中,我展示了命令不产生任何输出FIXME: problematic
的区域 。相反,照常工作。因此,在下面的代码中,我确实用 定义了一些路径,但生成的 pdf 是空的。问题是,我的东西在哪里?(c) 请不要介意代码本身可以以更模块化的形式编写;没有时间进行重构,一次性使用也是如此。path fade=South
path fade=south
fade
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shadings,tikzmark}
\usetikzlibrary{backgrounds,shadings,shadows,shapes,chains,calc,positioning,decorations.pathreplacing}
\usetikzlibrary{calc,arrows,decorations.pathmorphing,intersections,fit,patterns,fadings}
\usepackage{xcolor}
\begin{document}
\tikzstyle{myedgestyle}=[
thin,
decorate,decoration={random steps,segment length=0.5pt,amplitude=0.1pt}
]%
\begin{tikzpicture}
\coordinate (origin) at (0,0);
\coordinate (A) at (8ex,8ex);
\coordinate (B) at (40ex,8ex);
\coordinate (C) at (40ex,24ex);
\coordinate (D) at (8ex,24ex);
\foreach \x/\y in {1/2,2/1} {
\coordinate (midHorAB\x\y) at ($\x*(A)+\y*(B)$);
\coordinate (midHorab\x\y) at ($0.33334*(midHorAB\x\y)$);
\coordinate (midHorCD\x\y) at ($\x*(D)+\y*(C)$);
\coordinate (midHorcd\x\y) at ($0.33334*(midHorCD\x\y)$);
}
\foreach \x/\y in {1/1} {
\coordinate (midVerAD\x\y) at ($\x*(A)+\y*(D)$);
\coordinate (midVerad\x\y) at ($0.5*(midVerAD\x\y)$);
\coordinate (midVerBC\x\y) at ($\x*(C)+\y*(B)$);
\coordinate (midVerbc\x\y) at ($0.5*(midVerBC\x\y)$);
}
%\makeatletter
\pgfdeclareverticalshading{pgf@lib@fade@South}{10ex}
{color(0ex)=(pgftransparent!0); color(5ex)=(pgftransparent!75);
color(7.5ex)=(pgftransparent!80); color(10ex)=(pgftransparent!100)}%
\pgfdeclarefading{South}{\pgfuseshading{pgf@lib@fade@South}}%
%\makeatother
%\makeatletter
\pgfdeclareverticalshading{pgf@lib@fade@North}{100bp}
{color(0bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100);
color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%
\pgfdeclarefading{North}{\pgfuseshading{pgf@lib@fade@North}}%
%\makeatother
%\makeatletter
\pgfdeclarehorizontalshading{pgf@lib@fade@East}{100bp}
{color(0bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100);
color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%
\pgfdeclarefading{East}{\pgfuseshading{pgf@lib@fade@East}}%
%\makeatother
%\makeatletter
\pgfdeclarehorizontalshading{pgf@lib@fade@West}{100bp}
{color(0bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100);
color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%
\pgfdeclarefading{West}{\pgfuseshading{pgf@lib@fade@West}}%
%\makeatother
% FIXME: Problematic zone: fading effects South/North/East/West do not take effect
\path[draw,myedgestyle,path fading=South] (midHorab12) to ($(midHorab12)!-0.3!(midHorcd12)$);
\path[draw,myedgestyle,path fading=South] (midHorab21) to ($(midHorab21)!-0.3!(midHorcd21)$);
\path[draw,myedgestyle,path fading=North] (midHorcd12) to ($(midHorcd12)!-0.45!(midHorab12)$);
\path[draw,myedgestyle,path fading=North] (midHorcd21) to ($(midHorcd21)!-0.45!(midHorab21)$);
\path[draw,myedgestyle,path fading=West] (midVerad11) to ($(midVerad11)!-0.2!(midVerbc11)$);
\path[draw,myedgestyle,path fading=East] (midVerbc11) to ($(midVerbc11)!-0.2!(midVerad11)$);
\end{tikzpicture}
\end{document}
编辑:删除多余的命令以使其成为 MWE-ish。