答案1
tikzpicture
使用选项构建框架remember picture,overlay
。在图片中,您可以使用(current page.north west)
等来参考页面的角落。
\AddEverypageHook
然后使用包提供的命令everypage
将框架添加到每个页面。
\documentclass{article}
\usepackage{everypage}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\myframe
{\begin{tikzpicture}[remember picture, overlay]
\draw[rounded corners=20pt,blue]
($(current page.north west) + (1in,-1in)$)
rectangle
($(current page.south east) + (-1in,1in)$);
\draw[red,thick]
($(current page.north west) + (1in+\oddsidemargin,-(1in+\topmargin+\headheight+\headsep)$)
-- +(\textwidth,0);
\end{tikzpicture}
}
\AddEverypageHook{\myframe}
\usepackage{blindtext}
\begin{document}
\Blindtext
\Blindtext
\Blindtext
\end{document}