![如何在精确位置绘制垂直线](https://linux22.com/image/383694/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%B2%BE%E7%A1%AE%E4%BD%8D%E7%BD%AE%E7%BB%98%E5%88%B6%E5%9E%82%E7%9B%B4%E7%BA%BF.png)
答案1
这是你想要的吗 ?
\documentclass{article}
\usepackage[a4paper,landscape,left=0.5cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes,calc,positioning,arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\draw[,dash pattern=on 10pt off 3pt,line width=2pt]($(current page.north)+(0cm,-2cm)$)--($(current page.south)+(0cm,2cm)$);
\draw[line width=2pt,purple,latex-latex,,dash pattern=on 10pt off 3pt]($(current page.north west)+(0cm,-4cm)$)--($(current page.north)+(0cm,-4cm)$);
\end{tikzpicture}
\end{document}
答案2
以下代码使用eso-pic
用于精确定位两个规则,一个位于 ,148mm
另一个位于160mm
(cm
长度不适合放在页面上,因为landscape
A4 很297mm
宽)。规则放置在它所调用的页面的F
圆形部分中(因为; 删除会将其放置在所有页面上)。G
*
*
\documentclass{article}
\usepackage[
paper = a4paper,
landscape,
margin = 1cm,
left = 5mm
]{geometry}
\usepackage{eso-pic}
\begin{document}
\mbox{}% Some text on this page
\pagestyle{empty}% Remove header/footer
\AddToShipoutPictureFG*{%
\AtPageLowerLeft{%
\hspace*{148mm}%
\rule{1pt}{\paperheight}%
}%
\AtPageLowerLeft{%
\hspace*{160mm}%
\rule{1pt}{\paperheight}%
}%
}
\end{document}