1

Please help: I want to draw 2 vertical lines: one line at 148 cm & one line at 160 cm

\usepackage[a4paper,landscape,left=0.5cm,right=1cm,top=1cm,bottom=1cm]{geometry}

enter image description here

Thanks

0

Is this what you want ?

\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}
  • Welcome to TeX.SE! Please consider restricting yourself to the necessary packages and libraries, in particular in answers. I do not see why shapes, positioning and/or arrows are needed, and anyway arrows got superseded by arrows.meta. Note that I do appreciate your efforts of helping here and do not want to criticize you, but please understand that it is not helpful to load unnecessary things. (BTW, with the tikzpagenodes package you may be able to achieve this in a slightly more elegant way.) – user121799 Oct 4 '18 at 2:39
  • @F.HA: you're right. and where in your code that i can see "148 cm". I need draw other parallel line at 160 cm. Thanks – Ti Saigon Oct 4 '18 at 9:08
  • I didn't understand what you want, try this : – F.HA Oct 16 '18 at 15:30
  • \foreach \x in {0,3,6,9,12,15,18} \draw[,dash pattern=on 10pt off 3pt,line width=2pt]($(current page.north)+(\x cm,-2cm)$)--($(current page.south)+(\x cm,2cm)$); – F.HA Oct 16 '18 at 15:31
  • Add after the second line : \draw .... node[rectangle,fill=green, below=1ex,pos=0.5]{148 cm} – F.HA Oct 16 '18 at 15:31
1

The following code uses eso-pic for exact positioning of two rules, one at 148mm and another at 160mm (cm lengths would not fit on the page since a landscape A4 is 297mm wide). The rules are placed in the ForeGround of the page that it's called on (because of the *; removal of the * will place it on all pages).

enter image description here

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.