2009/09/15

[TeX] 加浮水印

在文件中加入浮水印的方法有很多,我個人比較偏好用 eso-pic 套件,因為它只要填入檔名,再用指令 \AddToShipoutPicture 就可以做出浮水印效果了。如果有些頁面不想有浮水印,也可以 \ClearShipoutPicture 這個命令取消浮水印(請參閱 eso-pic 的 eso-ex2.tex)

在下面的列子中,圖檔檔名是 bg.eps,lipsum 則是純綷 demo 用,它負責產生一堆內文。

\documentclass[12pt]{scrartcl}
\usepackage{eso-pic,calc,graphicx}
\usepackage{lipsum}

\newcommand\BackgroundPicture{%
   \put(0,0){%
     \parbox[b][\paperheight]{\paperwidth}{%       
       \vfill
       \centering
       \includegraphics[width=\textwidth]{bg}
       \vfill
     }}}

\begin{document}
\AddToShipoutPicture{\BackgroundPicture}
\lipsum
\end{document}

沒有留言: