In the following MWE i define a fading monfading with the command \tikzfading which is then used in the command \fill.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns,fadings}
\begin{document}
\tikzfading[name=monfading,left color=transparent!100,right color=transparent!0]
\begin{tikzpicture}
\node[anchor=south west] at (0,0) {HALLO} ;
\fill[draw=black,path fading=monfading,fill=white] (0,0) rectangle (1.5,1);
\end{tikzpicture}
\end{document}
Now, i encounter some difficulties, because my tikz picture is actually in the header of the page (i use \RequirePackage[pagestyles]{titlesec}), and there, it seems not to remember the definition of \tikzfading. Therefore, i would like to put the definition of monfading directly in the \fill command. Therefore something like :
%Pseudocode :
\begin{tikzpicture}
\node[anchor=south west] at (0,0) {HALLO} ;
\fill[draw=black,path fading={left color=transparent!100,right
color=transparent!0},fill=white] (0,0) rectangle (1.5,1);
\end{tikzpicture}
How i can make this pseudo code a real code?
\tikzfadingcommand into your preamble? – Jake Apr 13 '12 at 16:29\fill[draw=black, path fading=west, fill=white] (0,0) rectangle (1.5,1);. Is your real fading more complicated? – Jake Apr 13 '12 at 16:42ẁest. This is enough for me, i just needs this fading (for the moment). Thanks. But I am still interested in the general answer to the question. – Loic Rosnay Apr 13 '12 at 16:56\tikzset{ define fading/.code={ \tikzfading[#1] } }allows you to define a new fading within your drawing command. Doesn't solve the header problem though, so I'm not sure if there's any utility for this. – Jake Apr 13 '12 at 17:10