39

How can I make a horizontal dashed line in LaTeX?

Just writing lots of single dashes results in a continuous horizontal line.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195

3 Answers3

39

You can look at the dashrule package, for example.

lockstep
  • 250,273
chl
  • 8,890
16

With Plain leaders, for example:

\def\dashfill{\cleaders\hbox{-}\hfill}
\hbox to \hsize{\dashfill\hfil}
\bye

Changing the spacing is then a matter of redefining the dashfill's hbox:

\def\dashfill{\cleaders\hbox to 2em{-}\hfill}
morbusg
  • 25,490
  • 4
  • 81
  • 162
2

What about adding spaces between the dashes: - - - - - - ? When I try it, it works just fine. Or do you want something else?

meep.meep
  • 16,905