![带边距的背景图像/图片](https://linux22.com/image/373036/%E5%B8%A6%E8%BE%B9%E8%B7%9D%E7%9A%84%E8%83%8C%E6%99%AF%E5%9B%BE%E5%83%8F%2F%E5%9B%BE%E7%89%87.png)
答案1
您可以使用该background
包,但实际上要获得正确的位置可能很棘手!请参见以下示例,其中我使用hshift
和vshift
设置将随机图片设置为固定边距的背景,并遵循您的图像:
% !TeX program = xelatex
\documentclass{article}
\usepackage{background,lipsum}
\backgroundsetup{
scale=1,
color=black,
opacity=1,
contents={%
\includegraphics[%
height=\dimexpr\paperheight-2cm\relax, % double the vert. margin
width=\dimexpr\paperwidth-2cm\relax % double the horiz. margin
]{example-image-a}
},
angle=0,
position = current page.south west,
nodeanchor = south west,
hshift = 1cm, % horizontal margin
vshift = 1cm % vertical margin
}
\begin{document}
\lipsum[1-10]
\end{document}
答案2
我用这个解决了我的问题:
\usepackage{background}
\definecolor{myColor}{RGB}{234,234,234}
\backgroundsetup{
contents={
\begin{tikzpicture}
\fill[myColor] (0,0) rectangle (18.5,28);
\end{tikzpicture}
},
angle=0,
scale=1
}
谢谢您的帮助!