Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Guido Jan 5 '13 at 9:52
add comment

2 Answers

up vote 29 down vote accepted
\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

share|improve this answer
    
Great, many thanks! –  Camil Staps Jan 5 '13 at 9:20
1  
The \vbox is not needed; simply use \kern 1mm instead of \vskip 1mm. –  egreg Jan 5 '13 at 11:31
6  
You can remove the \vbox altogether! \hrule<spec>\kern1mm\hrule<spec> will never be broken across pages (and it will force "end of paragraph", which \vbox doesn't). Also, the default rule thickness is 0.4pt, rather than 0.7pt. –  egreg Jan 5 '13 at 11:44
    
@christian-lindig @egreg \vbox actually is necessary when you want to end with a vskip to reserve space beneath the rules. –  Camil Staps Jan 6 '13 at 8:24
add comment

Just to get your code working:

\documentclass{article}
\begin{document}
\begin{minipage}{.475\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt 
\end{minipage}%
\hfill
\begin{minipage}{.475\textwidth}                          %% getting your code to work
\rule{\textwidth}{.4pt}\\[\dimexpr-\baselineskip+1mm+2pt]
\rule{\textwidth}{2pt}
\end{minipage}
\end{document}

We have to subtract the baselineskip and add the thickness of second line along with the distance between rules.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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