[Tex/LaTex] Drawing a double line

rules

I went to create a horizontal double line that fills the page after some words. The code

\newcommand{\raisedrule}[2][0em]{\leaders\hbox{\rule[#1]{1pt}{#2}}\hfill}

obtain from LaTeX rule filling the line does most of what I want, but I want the line to be a double line (ie. ======) instead of a single line (ie. ——–).

How can I achieve this?

Best Answer

Two options, depending on your usage:

enter image description here

\documentclass{article}

\usepackage{lipsum}% Just for this example

\newcommand{\doublerule}[1][.4pt]{%
  \noindent
  \makebox[0pt][l]{\rule[.7ex]{\linewidth}{#1}}%
  \rule[.3ex]{\linewidth}{#1}}

\newcommand{\raisedrule}[2][0pt]{%
  \leaders
  \hbox{%
    \makebox[0pt][l]{\rule[#1]{1pt}{#2}}%
    \rule[\dimexpr#1+.4ex]{1pt}{#2}%
  }\hfill}

\begin{document}

\lipsum*[1]%
\raisedrule{.4pt}

\doublerule

\lipsum*[2]%
\raisedrule[.3ex]{1pt}

\doublerule[1pt]

\lipsum[3]

\end{document}

Of course, other fine-tuning is possible.