# Horizontal line in LATEX

I want to draw a horizontal line in a LATEX file. The starting point is at the middle of the page and the length is the half of the paperwidth.

How can this be done? Thanks for your help.

This revised version works with documentclasses that have symmetric or skewed margins. I interpreted "middle of the page" to mean "middle of the paper", and not "middle of the textblock".

\documentclass{book}
\usepackage{lipsum}
\begin{document}
\noindent\kern.5\paperwidth\kern-1in\kern-\hoffset\kern-\oddsidemargin%
\makebox[0pt][l]{\makebox[.5\paperwidth]{\hrulefill}}\par

\lipsum[3]
\end{document}


BOOK:

ARTICLE:

• (My understanding of the question) Wouldn't \centerline{\hspace{0.5\textwidth}\makebox[.5\paperwidth]{\hrulefill}} be closer to the OP's request ? – BambOo Aug 21 '18 at 13:13
• Thank you for your reply but i want the starting point of the line to be at center of the page. Obviously in your solution the starting point of the line is not at the center of the page. – Apostolos K Aug 21 '18 at 13:14
• @ApostolosK Sorry. I will revise. – Steven B. Segletes Aug 21 '18 at 13:15
• @ApostolosK Please see revision. – Steven B. Segletes Aug 21 '18 at 13:21
• @ApostolosK That is not the question you asked. Which it is why it is the site policy that your question should be accompanied by a small self-contained code (starting with \documentclass, etc.) that demonstrates the problem. – Steven B. Segletes Aug 21 '18 at 13:34
\documentclass[twocolumn]{article}
\usepackage{tikz,lipsum}
\begin{document}

\lipsum[1-4]
\noindent%
\tikz[remember picture,overlay]{\draw(0,0)coordinate(o)--(o -| current page.east);}

New line here

\end{document}