如何使用 eso-pic 在頁面右上角右對齊列印?

如何使用 eso-pic 在頁面右上角右對齊列印?

如何使用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} 

在此輸入影像描述

相關內容