我使用 KOMA-Script 包创建了一封信scrlttr2
。我想在每页底部添加一张图片。以下是我为此目的准备的:
\AddToShipoutPictureBG{%
\AtPageLowerLeft{
\hspace*{1.5in}\includegraphics{Logo_unten.eps}
}
}
这样做是可行的,但如果我打印结果,图像的一半将被截断。那么,我怎样才能将图像提升 1 厘米左右呢?
答案1
因为你没有给我们提供信件的可编译示例,而只提供了一个代码片段,所以我不得不猜测你在做什么:-(
请在下一个问题中添加一个完整、简短且可编译的示例,这样我们就不必猜测您在做什么......
由于您添加的不是您自己的图片,因此Logo_unten.eps
我使用了example-image
来自包的图片mwe
。请注意,此图片的大小可能与您的不同,因此我不得不添加选项width=2cm
以避免字母文本重叠...
要简单地将图像向上移动 1 厘米,您可以使用命令\raisebox
...
请看以下编译代码
\documentclass[%
paper=a4,
backaddress=off,
foldmarks=false,
parskip=half,
addrfield=false,
]{scrlttr2}
\usepackage[english]{babel} % <=========================================
\let\raggedsignature\raggedright
\setkomavar{fromname}{john doe}
\setkomavar{fromaddress}{street number\\ plz place}
\setkomavar{fromphone}{+43 1234 567890}
\setkomavar{fromemail}{[email protected]}
\setkomavar{place}{place}
%\setkomavar{signature}{john doe\\trainer}
\renewcaptionname{english}\emailname{\Letter}% orig: \Email <===========
\renewcaptionname{english}\phonename{\Mobilefone}% orig: \Telefon <=====
\usepackage{blindtext}% <============================= to get dummy text
\usepackage{showframe}% <============ to visualize text area and margins
\usepackage{graphicx}
\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\AtPageLowerLeft{%
\raisebox{1cm}{% <========================= shift image 1cm higher
\hspace*{1.5in}\includegraphics[width=2cm]{example-image}
}
}
}
\begin{document}
\begin{letter}{Company\\Address\\City}
\setkomavar{subject}{Position Title}
\opening{Dear Recruiter,}
Content goes here.
\Blindtext
\closing{Sincerely yours,}
\end{letter}
\end{document}
导致
答案2
您可以加载scrlayer-scrpage
属于 KOMA-Script 包的包。然后,您可以为图像声明一个新层,并将该层添加到每个页面样式(包括empty
):
\usepackage{scrlayer-scrpage}
\DeclareNewLayer[
background,
align=bl,
hoffset=1.5in,
voffset=\paperheight,
addvoffset=-.3in,% <- adjust this value to your needs
mode=picture,
contents=\putLL{\includegraphics[width=2cm]{example-image}}
]{letterimage}
\AddLayersToPageStyle{@everystyle@}{letterimage}
例子:
\documentclass{scrlttr2}
\setkomavar{fromname}{Name}
\setkomavar{fromaddress}{Address}
\usepackage{lipsum}% <- only for dummy text
\usepackage{graphicx}
\usepackage{scrlayer-scrpage}
\DeclareNewLayer[
background,
align=bl,
hoffset=1.5in,
voffset=\paperheight,
addvoffset=-.3in,% <- adjust this value to your needs
mode=picture,
contents=\putLL{\includegraphics[width=2cm]{example-image}}
]{letterimage}
\AddLayersToPageStyle{@everystyle@}{letterimage}
\begin{document}
\begin{letter}{Recipient\\Address}
\opening{Hallo,}
\lipsum[1-10]
\closing{Best regards}
\end{letter}
\end{document}