如何使用eso-pic
右对齐、在页面的右上角打印?
该手册可以在这里找到: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/eso-pic/eso-pic.pdf
答案1
以下按您的需要放置内容。若要稍微移动内容,只需0pt
根据您的喜好进行更改即可。
\documentclass[]{article}
\usepackage{eso-pic}
\AddToShipoutPictureBG
{%
\put(\LenToUnit{\paperwidth-0pt},\LenToUnit{\paperheight-0pt})
{%
\llap % make it overlap to the left from this point
{%
\raisebox{-\height} % move it down a bit to make it top-aligned
{\parbox{5cm}{\blindduck}}% contents
}%
}%
}
\usepackage{duckuments} % dummy text
\begin{document}
\mbox{}% produces one empty page
\end{document}
答案2
变体代码:
\documentclass{article}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{lipsum}
\begin{document}
\AddToShipoutPictureBG{\AtPageUpperLeft{\hspace*{\paperwidth\llap{\raisebox{-\height}{\includegraphics{pepe-le-pew2}}}}}}
\lipsum[1]
\begin{figure}[!h]
\centering
\includegraphics{pepe-le-pew2}
\caption{Pepe le Pew in action}
\end{figure}
\end{document}