General ⇒ Line
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Line
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
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: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Line
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}