3

How can I draw lines like in the picture in Latex? I tried using two consecutive \rule but they are not as close together as I would like them to beenter image description here. This is how I tried:

\noindent\rule{15cm}{0.7pt}
\noindent\rule{15cm}{0.7pt}
1
  • Welcome to TeX-SE! According to tex.stackexchange.com/a/89424/121799 you could do \documentclass[fleqn]{article} \begin{document} \noindent \hrule width \hsize \kern 0.5mm \hrule width \hsize height 0.4pt \end{document}
    – user121799
    Commented Mar 11, 2019 at 4:29

1 Answer 1

11

The \rule macro has an optional first parameter which specifies the height above the baseline. So you can use that to bring two rules closer together:

\begin{document}
This is some text.
\par\noindent\rule{\textwidth}{.5pt}
\rule[.8\baselineskip]{\textwidth}{.5pt}
This is some text.
\end{document}

output of code

The disadvantage of this approach is that the rule behaves like a single character and must be in its own paragraph. If you want to avoid that, then the \hrule approach is better, and you can get very exact spacing. Of course in this case you would probably want to add vertical space around the rules themselves. The following example doesn't do that in order to show the difference between the two methods.

\documentclass[11pt]{article}

\begin{document}

This is some text.
\hrule height 0.5pt depth 0pt width \textwidth
\vspace{2pt}
\hrule height 0.5pt depth 0pt width \textwidth
This is some text.
\end{document}

output of code

3
  • I don't really see the difference between the two approaches as the first example contains no text.
    – Arsenal
    Commented Mar 11, 2019 at 7:25
  • @Arsenal I've made the two examples parallel to show the difference more clearly.
    – Alan Munn
    Commented Mar 11, 2019 at 12:47
  • Yes, that shows the difference very clearly. Thank you.
    – Arsenal
    Commented Mar 11, 2019 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .