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 2986 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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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