我在 A5 紙上列印文件。我有一個帶有頁眉和頁腳的模板。現在,我的雷射印表機在左邊距留下黑色標記,從而破壞了頁面。如何在左邊距畫一條5毫米寬的黑色垂直條來隱藏這些標記?
答案1
帶background
包。
\documentclass[a5paper]{article}
\usepackage{background}
\usetikzlibrary{calc}
\newsavebox\mybox
\sbox\mybox{%
\begin{tikzpicture}[remember picture]
\fill[black] (current page.north west) rectangle ($(current page.south west) +(5mm,0)$);
\end{tikzpicture}%
}
\backgroundsetup{
angle=0,
scale=1,
opacity=1,
color=black,
contents={%
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=west] at (current page.west) {\usebox{\mybox}};
\end{tikzpicture}%
}
}
\begin{document}
\section{A section}
Some text\newpage
\section{Another section}
Some text
\end{document}
答案2
\AddToShipoutPictureBG
在包的幫助下eso-pic
,我們在每頁的輸出處繪製一個黑色矩形。
微量元素
\documentclass[a5paper]{article}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[remember picture, overlay]
\fill[black] (current page.north west) --
($(current page.north west) +(5mm,0)$) --
($(current page.south west) +(5mm,0)$) --
(current page.south west);
\end{tikzpicture}%
}
\begin{document}
\section{A section}
Some text\newpage
\section{Another section}
Some text
\end{document}
輸出