我创建了一个新命令来生成双倍规则。如何使用或创建类似的新命令\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}