修饰路径加填充节点绝对定位

修饰路径加填充节点绝对定位

我想将绝对定位(当前页面)节点与修饰路径相结合。修饰文本应出现在节点中,以便可以自由定位此单元。这可能吗?到目前为止,我已经完成了以下工作:

    \documentclass[]{article}
    \usepackage{tikz}
    \usetikzlibrary{math, %evaluate
                    decorations.text,
                   }
    %%%%%
    \definecolor{turquoise}{rgb:wave}{490}
    \definecolor{violet}{rgb:wave}{390}
    \begin{document}
     \begin{tikzpicture}[remember picture,overlay,decoration={text effects along path,
                 text={Snah-G{\"u}ngen Joik --- 04.01.2023},
                 text effects/.cd,
                 character count=\i, 
                 character total=\n,
                 characters={text along path, evaluate={\c=\i/\n*100;},
                 text=violet!\c!turquoise,}
                }]
           \node[xshift=6cm,
                 yshift=1cm,
                 left color=violet,
                 right color=turquoise,
                 text=white,
                ] at (current page.south west) 
                [%text width = 4cm,
                 above right
                ] (a)
              {\tiny Snah-G{\"u}ngen Joik ---   \today};
    
           \path [%late options={name=a, label=above:world},%pgfmanual 17.14
                  decorate 
                 ] %; % no decorate on empty path, 17.14
             (current page.south west) -- (current page.south east) ;
     \end{tikzpicture}
    \end{document}

输出

答案1

我不确定我是否理解了这个问题。要附加装饰节点,我使用此节点的名称而不是当前页面。我使用来calc library定位此装饰节点。

($(a.south west)+(0,-0.5)$) -- ($(a.south east)+(0,-0.5)$)

代码

\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{math, %evaluate
        decorations.text,
        calc%<- added
        }
%%%%%
\definecolor{turquoise}{rgb:wave}{490}
\definecolor{violet}{rgb:wave}{390}
\begin{document}
\begin{tikzpicture}[remember picture,overlay,decoration={text effects along path,
    text={Snah-G{\"u}ngen Joik --- 04.01.2023},
    text effects/.cd,
    character count=\i,
    character total=\n,
    characters={text along path, evaluate={\c=\i/\n*100;},
            text=violet!\c!turquoise,}
    }]
    \node[xshift=6cm,
        yshift=1cm,
        left color=violet,
        right color=turquoise,
        text=white,
    ] at (current page.south west)
    [%text width = 4cm,
            above right
        ] (a)
    {\tiny Snah-G{\"u}ngen Joik ---   \today};

    \path [%late options={name=a, label=above:world},%pgfmanual 17.14
        decorate,
    ] %; % no decorate on empty path, 17.14
    %(current page.south west) -- (current page.south east) ;%<--- this line
    ($(a.south west)+(0,-0.5)$) -- ($(a.south east)+(0,-0.5)$) ;
\end{tikzpicture}
\end{document}

相关内容