答案1
用红色来强调效果。显然,规则厚度、深度等是在定义中设置的,可以更改。
\documentclass{article}
\newcommand\shadowfill{%
\leavevmode\leaders\hbox{\ooalign{%
\vrule height 1pt depth 0pt width 1pt\cr%
\textcolor{red}{\vrule height 0pt depth 1pt width 1pt}}%
}\hskip\fill\kern0pt%
}
\usepackage{xcolor}
\begin{document}
This is a test\shadowfill
or this\shadowfill
or maybe\shadowfill this
\shadowfill
\end{document}
飞涨:
答案2
带有模糊的阴影。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur,tikzmark}
\newcounter{fshadow}
\newcommand{\shadowfill}{\stepcounter{fshadow}
\tikzmark{XL-\thefshadow}\hrulefill\tikzmark{XR-\thefshadow}
\tikz[overlay,remember picture]{%
\path[blur shadow={shadow yshift=-0.4pt}] ([yshift=-0.2pt]pic cs:XL-\thefshadow) rectangle ([yshift=0.2pt]pic cs:XR-\thefshadow);}
}
\begin{document}
\shadowfill
abc\shadowfill def
\end{document}