如何在每个页面上包含 tikzpicture?
我想创建一个复杂的文档模板(页面应该有框架,并有一个表格来保存页眉和页脚中的文档信息)。
我正在考虑使用类似的东西:
\begin{tikzpicture}[remember picture,overlay]
% complicated layout should be here, simple example is given below:
% \node [xshift=1cm,yshift=1cm] at (current page.south west)
% {This is an absolutely positioned text in the page};
\end{tikzpicture}
您对如何创建这样的模板有任何其他建议吗?
最佳答案
使用 fancyhdr
向页眉/页脚添加信息或 KOMA Script
为了在每个页面上添加一些东西,我使用了这个:
\usepackage{eso-pic}
\makeatletter
\AddToShipoutPicture{%
\setlength{\@tempdimb}{.1\paperwidth}%
\setlength{\@tempdimc}{.04\paperheight}%
\setlength{\unitlength}{1pt}%
\put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
\makebox(0,0){ \textcolor{gray}{Rev: \svnrev{} (\svnfilerev)} }%
}%
}
\makeatother
在这里,我在每个页面的右下角添加了 SVN 修订号。我不记得为什么我没有在
\AddToShipoutPicture
中使用 tikzpicture[overlay,remember picture] ,可能是因为它在页面发货的状态下无法记住图片位置。希望有帮助。
关于latex - 每页上的 Tikzpicture,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4098356/