6

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
\newcommand\doublerulefill{\leavevmode\leaders\hbox{\doublerule}\hfill\kern\z@}

\begin{document}

\doublerulefill this is a test \doublerulefill

\end{document}

1 Answer 1

6

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

enter image description here

\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
\newcommand\doublerulefill{\leavevmode\leaders\vbox{\hrule width .1pt\kern1pt\hrule}\hfill\kern0pt }

\begin{document}

\doublerulefill\ this is a test \doublerulefill

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .