# \hrulefill with customized rule

I created a new command to generate doubled rules. How can I use or create a new command similar to \hrulefill in order to force my doubled rules to fill the rest of the line. So far I have tried this but to no avail.

\documentclass{article}

% Configure style for custom doubled line
\newcommand*{\doublerule}{\hrule width \hsize height 1pt \kern 0.5mm \hrule width \hsize height 2pt}

% Configure function to fill line with doubled line

\begin{document}

\doublerulefill this is a test \doublerulefill

\end{document}


You need to construct a box to give to \leaders eg

\documentclass{article}

% Configure style for custom doubled line
\newcommand*{\doublerule}{\hrule width \hsize height 1pt \kern 0.5mm \hrule width \hsize height 2pt}

% Configure function to fill line with doubled line