[Tex/LaTex] Two rules directly under each other

rulesspacingvertical alignment

I'm trying to make two rules of different length (fatness) directly under each other, something like:

--------------------

====================

Where = is a fatter line than -. The vertical space between the two should be 1mm. However this doesn't work:

\rule{\textwidth}{1mm}
\vspace{1mm}
\rule{\textwidth}{3mm}

The lines are way more than 1mm separated. How can I get this working?

Best Answer

\documentclass{minimal}
\begin{document}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt 
\end{document}

The top line has the default width of 0.4pt and the lower line is 2pt wide. Both lines are 1mm apart.

The terms width and height are a little confusing here. \hrule height 2pt refers to what is commonly thought as line width and width \hsize is the length of the line which here is the full width available (\hsize).

Edit: I removed an outer \vbox{\hrule .. 2pt} as suggested in the comments. I assumed it would be safer to enclose everything in a box to make sure it would work in as many contexts as possible, for example in a table.

Screenshot - two lines

Related Question