I've created a command for filling a line with a black rectangle. It's called \fullrule, you can find it in the code below.
I have several questions regarding this MWE:
\documentclass[10pt]{article}
\usepackage[a4paper]{geometry}
\newlength{\mylift}
\setlength{\mylift}{-10pt} % MARK2
\addtolength{\mylift}{-1ex}
\addtolength{\mylift}{\baselineskip}
\newcommand{\fullrule}{%
{\hspace*{0pt}\leaders\hbox{\rule[\mylift]{1pt}{10pt}}\hfill}% % MARK 1
\hspace*{0pt}}
\begin{document}
aaa
\fullrule
aaa\fullrule{}\\
\fullrule{}\\
\fullrule{}
\fullrule
aaa\fullrule{}aaa
\fullrule{}\\
\fullrule{}aaa\\
\fullrule
\end{document}
This is what it produces:

- Why is the first line of my document indented? (Okay, this one is the smallest problem.)
- I had to add
\hspace*{0pt}right before\leaders, and after the "whole\leaderspart" to get it work with lines with no leading characters before\fullrule. Why? (I'd like to understand this, because it took a long time to figure out with trying.) - Is there any way to rewrite the
\fullrulecommand to use the actual font size instead of 10pt (see% MARK 1in the code above), and to calculate the rule's raise using the actual font size (see% MARK 2in the code above).
Thanks!