答案1
一个选项是使用background
包裹:
\documentclass{article}
\usepackage[scale=1,angle=0,opacity=1]{background}
\usepackage{lipsum}
\definecolor{myblue}{RGB}{29,57,127}
\backgroundsetup{
position=current page.north west,
color=myblue,
nodeanchor=north west,
contents={\rule{10pt}{\paperheight}}
}
\begin{document}
\lipsum[1-10]
\end{document}
答案2
这使用了包\AddEverypageHook
的宏everypage
。
\documentclass{article}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
\AddEverypageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
\raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{\textcolor{blue!70}{#3}}}}}
\atxy{0in}{0in}{\rule[-\paperheight]{4pt}{\paperheight}}
\begin{document}
\lipsum[1-35]
\end{document}