\hrulefill 自定义规则

\hrulefill 自定义规则

我创建了一个新命令来生成双倍规则。如何使用或创建类似的新命令\hrulefill来强制我的双倍规则填充行的其余部分。到目前为止,我已经尝试过这个,但无济于事。

\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

你需要构造一个盒子来送给\leaders例如

在此处输入图片描述

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

相关内容