答案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}