5

In HTML, I can insert a line below any text using <hr> tag.




How can I do same thing it in LaTeX?

  • 1
    Perhaps \par\noindent\hrulefill\par – Steven B. Segletes May 16 '16 at 12:45
  • @StevenB.Segletes It works! But if I insert it following \section{}, the distance between section and line is too long. Can I set it? – KyL May 16 '16 at 12:49
  • I added a small negative \vspace, and posted as an answer. Is this better, or do you still not like the space following the section. Compare to a section without the \ht included. – Steven B. Segletes May 16 '16 at 12:54
5

Here is a possibility, I created a macro \hr.

\documentclass{article}
\usepackage{lipsum}
\newcommand\hr{\par\vspace{-.5\ht\strutbox}\noindent\hrulefill\par}
\begin{document}
\lipsum[1]
\hr
\lipsum[2]
\hr
\lipsum[3]
\clearpage
\section{header}
\hr
\lipsum[4]
\section{header}
\lipsum[4]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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