Closed xkwxdyy closed 3 weeks ago
我看手册后面提供了 tikz 的方法:
\background+(tikz)[./logo]{
\node at (text.east) {\includegraphics[height = \textheight]{logo-black}};
}
这样可行,但是一旦加上了 \transparent{0.2}
:
\background+(tikz)[./logo]{
% \put(6cm, -7cm){\transparent{0.2}\includegraphics[width = 5cm]{logo-black}}
\node at (text.east) {\transparent{0.2}\includegraphics[height = \textheight]{logo-black}};
}
就报错
Package tikz: Giving up on this path. Did you forget a semicolon?.
加括号,或者直接用 text opacity=0.2
,如果是 XeLaTeX 还需要 \DocumentMetadata{}
:
\background+(tikz)[./logo]{
% \put(6cm, -7cm){\transparent{0.2}\includegraphics[width = 5cm]{logo-black}}
\node at (text.east) {{\transparent{0.2}\includegraphics[height = \textheight]{logo-black}}};
}
另外,上面的代码,图片位置并不一定是你想要的位置。
加括号,或者直接用
text opacity=0.2
,如果是 XeLaTeX 还需要\DocumentMetadata{}
:
感谢!效果很好。
另外,上面的代码,图片位置并不一定是你想要的位置。
谢谢提醒,我对 anchor 加了一个 shift
调整就行
\node[text opacity = 0.05] at ([shift={(-10em,0em)}]text.east) {\includegraphics[height = \textheight]{logo-black}};
另外还有个延伸的问题,就是 cus
下奇偶不同水印的最佳方案是什么呢?我的想法是在 shiftout
的 hook 处判断 page 的奇偶,然后用不同的 \background
。不过这个 cus
能否将其打包成一个命令,就是奇偶页的 \foreground
和 \background
。
直接用 \ifodd\c@page
判断就可以了,它们总是能获得正确的值。
\def\oddbackground{..}
\def\evenbackground{..}
\background{\ifodd\c@page \oddbackground\else \evenbackground\fi}
直接用
\ifodd\c@page
判断就可以了,它们总是能获得正确的值。
好的,感谢
手册上:
我试了一下好像
lm
rm
这种不行,为什么不把c
和m
也放入可选中呢?主要需求是想实现这样的 logo
就是放在页面的左侧或者右侧,只出现一半。