Hi Guys,
Anyone can help me with the code to insert dash line in the document? and how to change space between the line and the style of the line, and the color
Thanks
Sam
General ⇒ Line
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10337
- Joined: Mon Mar 10, 2008 9:44 pm
Line
Hi Sam,
you could use the
dashrule package. For example:
Click the link above to see the manual with explanation of the options. You can use the usual color commands if you like, such as
if you load the
Stefan
you could use the

Code: Select all
\documentclass{article}
\usepackage{dashrule}
\begin{document}
text
\hdashrule[0.75ex]{\textwidth}{1pt}{1ex}
text
\end{document}
\textcolor{red}{\hdashrule[0.75ex]{\textwidth}{1pt}{1ex}}
if you load the
color
or xcolor
package.Stefan
LaTeX.org admin
Line
Stefan Kottwitz wrote:Hi Sam,
you could use thedashrule package. For example:
Click the link above to see the manual with explanation of the options. You can use the usual color commands if you like, such asCode: Select all
\documentclass{article} \usepackage{dashrule} \begin{document} text \hdashrule[0.75ex]{\textwidth}{1pt}{1ex} text \end{document}
\textcolor{red}{\hdashrule[0.75ex]{\textwidth}{1pt}{1ex}}
if you load thecolor
orxcolor
package.
Stefan
Thanks Stefan..
This is useful.
is there a way to auto fill the dash line for the rest or entire A4 page?
- Stefan Kottwitz
- Site Admin
- Posts: 10337
- Joined: Mon Mar 10, 2008 9:44 pm
Line
Perhaps like this:
Stefan
Code: Select all
\documentclass{article}
\usepackage{dashrule}
\usepackage{xcolor}
\newlength{\mypageheight}
\newcommand\lines[3][1pt]{%
\setlength{\mypageheight}{#3}%
\loop%
\addtolength{\mypageheight}{-#2}%
\ifdim\mypageheight>0pt%
\textcolor{red}{\hdashrule{\textwidth}{#1}{#2}}%
\repeat%
}
\begin{document}
\noindent text
\noindent text
\noindent\lines[1pt]{1ex}{0.68\textheight}
\end{document}
LaTeX.org admin