如何插入整页信纸大小的图像?
我一直在尝试插入信纸大小的图像,但是由于文档样式(书籍)的边距定义,该图像被剪切,或其大小仅限于指定的边距。
下面是我成功获取图像大小的代码:
...
\newenvironment{pagportada}{
\begin{list}{}{
\setlength{\hoffset}{-1in}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}
\setlength{\leftmargin}{-1in}
\setlength{\rightmargin}{-1in}
\setlength{\textwidth}{14.3cm}
\setlength{\voffset}{-1in}
\setlength{\topmargin}{0.5cm}
\setlength{\headheight}{0pt}
\setlength{\topsep}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\footskip}{0pt}
\setlength{\textheight}{19.2cm}
%\setlength{\listparindent}{\parindent}
%\setlength{\itemindent}{\parindent}
%\setlength{\parsep}{\parskip}
}\item[]}
{\end{list}}
...然后调用环境来插入图形:
\begin{pagportada}
\includegraphics[width=\textwidth]{Portada}
\end{pagportada}
\newpage
I have been trying to insert a letter-size image, but either this is cut because of the margins definition of the document style (book), or its size is limited to the specified margins.
Below is the code with which I have managed to obtain the size of the image:
...
\newenvironment{pagportada}{
\begin{list}{}{
\setlength{\hoffset}{-1in}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}
\setlength{\leftmargin}{-1in}
\setlength{\rightmargin}{-1in}
\setlength{\textwidth}{14.3cm}
\setlength{\voffset}{-1in}
\setlength{\topmargin}{0.5cm}
\setlength{\headheight}{0pt}
\setlength{\topsep}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\footskip}{0pt}
\setlength{\textheight}{19.2cm}
%\setlength{\listparindent}{\parindent}
%\setlength{\itemindent}{\parindent}
%\setlength{\parsep}{\parskip}
}\item[]}
{\end{list}}
... and then call the environment to insert the figure as:
\begin{pagportada}
\includegraphics[width=\textwidth]{Portada}
\end{pagportada}
\newpage
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 LaTeX:
eso-pic
包将帮助您将对象放置在页面背景上。这不会尊重利润:这是你的需要。要放置图像,请在页面上包含以下代码:
将图像放置在 (0,0) 页面坐标处,并拉伸(保持纵横比)到整个页面,中间居中。
(未测试)
If you are using LaTeX:
The
eso-pic
package will help you put objects on the background of pages. This will not respect margins: which is your need.To put an image, include the following code on your page:
And the image is put at (0,0) page-coordinates and stretched (maintaining aspect ratio) onto the whole page, middle centred.
(not tested)