Page Layouthorizontal rule

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Willie
Posts: 42
Joined: Sat Aug 27, 2011 3:43 am

horizontal rule

Post by Willie »

I want to produce two horizontal rules as in the picture
I tried to use a \newline and a \vspace with negative height to compensate for the too-big space between text lines, but it doesn't work.

Code: Select all

\documentclass{article}

\newcommand{\myline}{\noindent\rule{\textwidth}{2pt}\newline\vspace{-0.9\baselineskip}\rule{\textwidth}{0.1pt}}

\begin{document}
	This is a rule
	\myline
	This is an after-text
\end{document}
How should I do it?
Attachments
rules.png
rules.png (7.2 KiB) Viewed 3125 times
Last edited by Willie on Thu Oct 06, 2011 7:41 am, edited 1 time in total.

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 many kinds of documents

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

horizontal rule

Post by Frits »

I ran into this problem with one of my templates (the newsletter, here). I fixed it as follows:

Code: Select all

\documentclass{article}

\newcommand{\myline}{\par\noindent%	
						\rule{\linewidth}{1pt} \\[-0.75\baselineskip]%
						\rule{\linewidth}{2pt}%
						}
\begin{document}
   This is a rule
   \myline
   This is an after-text
\end{document}
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
Willie
Posts: 42
Joined: Sat Aug 27, 2011 3:43 am

Re: horizontal rule

Post by Willie »

great. thank you so much :-)
Post Reply