Page LayoutHorizontal Line spanning the complete Page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
User avatar
butek
Posts: 15
Joined: Tue Feb 19, 2013 9:35 pm

Horizontal Line spanning the complete Page

Post by butek »

How can I put a horizontal line without page margins?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Horizontal Line spanning the complete Page

Post by tom »

Hi Butek,

You can draw a horizontal line using \rule{width}{height}. E.g.:

Code: Select all

\documentclass[11pt]{article}

\begin{document}
  Before line \rule{40pt}{1pt} after line.
\end{document}
HTH,
Tom
Namrod
Posts: 8
Joined: Fri Apr 26, 2013 9:10 pm

Horizontal Line spanning the complete Page

Post by Namrod »

To draw an horizontal line spanning the page, you can use the \rule command with a width equal to the width of the page (\paperwidth). But don't forget to put it in a \makebox. Without that, the line will not go through the left margin. For example :

Code: Select all

\documentclass{article}
\usepackage[margin=1in]{geometry}

\begin{document}
 \noindent\makebox[\linewidth]{\rule{\paperwidth}{.4pt}}  % 0.4pt is the default thickness
\end{document}
Post Reply