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}
Oscar
  • 33
  • Welcome to TeX-SE! According to https://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} –  Mar 11 '19 at 04:29

1 Answers1

10

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

Alan Munn
  • 218,180