LaTeX使用tikz实现每一页全覆盖的水印,且图片不会把水印覆盖 | 您所在的位置:网站首页 › phonograph下载 › LaTeX使用tikz实现每一页全覆盖的水印,且图片不会把水印覆盖 |
使用draftwatermark的时候,图片会把水映覆盖。 使用background实现水印文字重复且多行全覆盖的效果,可参考如下链接 《LaTeX中如何给每一页加全覆盖的水印?效果如下图。?》 来自 \usepackage{background} \backgroundsetup{contents=Confidential,color=blue}使用background存在同样的问题,就是:图片会把水映覆盖。 所以参考如下链接,改用tikz 《Latex添加水印,在图片上面》 原文链接:https://blog.csdn.net/weixin_51394621/article/details/129628023 上面的链接实现的只是一行文字的效果,我们想实现的效果要像上面使用background实现的一样,每一行文字重复,且可以按需生成多行,同时水印要在图片上面。 tikz node 中的文字换行 选项中加align=center,并用\\换行,例如 \node at (-0.5,1)[draw, align=center]{example \\ example example};使用tikz实现每一页全覆盖的水印,且图片不会把水印覆盖: \documentclass{ctexart} \usepackage{lipsum} % begin watermark \usepackage{tikz} \makeatletter % prepare \bg@text \def\bg@text{} \foreach \i in {1, ..., 5} { \g@addto@macro\bg@text{\hspace{4em}你的水印内容\hspace{4em}你的水印内容\hspace{4em}你的水印内容\\ \\ \\ \\} } % allow multiline contents \AddToHook{shipout/foreground}{ \begin{tikzpicture}[remember picture,overlay] \node(a)[cyan,rotate=45,scale=2.5,opacity=0.9,align=center] at (current page.center) {\bg@text}; \end{tikzpicture} } \makeatother % end watermark \begin{document} \lipsum[1-2] \begin{frame} \centering \includegraphics[width=3cm]{example-image-a} \end{frame} \lipsum[1] \end{document}水印的文字内容,文字大小,文字颜色和文字字体可以根据需要去调整。 |
CopyRight 2018-2019 实验室设备网 版权所有 |