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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.