%% $Id: xhfill-doc.tex 501 2011-05-14 09:41:09Z herbert $
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[scaled=0.85]{beramono}
\usepackage{berasans}
\usepackage{beraserif}
\usepackage{xhfill}
\let\FileVersion\fileversion
\usepackage{listings}
\lstset{language=[LaTeX]TEX,basicstyle=\ttfamily\small,%
        extendedchars=true,numbers=left,numberstyle=\tiny,%
        xleftmargin=2em,breaklines=true}

\newcommand{\xfill}[2][1ex]{{%
  \dimen0=#2\advance\dimen0 by #1
  \leaders\hrule height \dimen0 depth -#1\hfill%
}}
\newcommand{\xfilll}[2][1ex]{%
  \dimen0=#2\advance\dimen0 by #1%
  \leaders\hrule height \dimen0 depth -#1\hfill%
}

\begin{document}
\title{Package \texttt{xhfill}\\v\FileVersion}
\author{Herbert Vo\ss}
\date{\today}
\maketitle
blah\xfill{1pt}blub
\begin{lstlisting}
blah\xfill{1pt}blub
\end{lstlisting}

blah\xfill{3pt}blub
\begin{lstlisting}
blah\xfill{3pt}blub
\end{lstlisting}

blah\xfill[0pt]{4pt}blub
\begin{lstlisting}
blah\xfill[0pt]{4pt}blub
\end{lstlisting}

blah\xfill[-12pt]{12pt}blub
\begin{lstlisting}
blah\xfill[-12pt]{12pt}blub
\end{lstlisting}

blah\xfilll{1pt}blub
\begin{lstlisting}
blah\xfilll{1pt}blub
\end{lstlisting}
blah\xfilll{1pt}blub
\begin{lstlisting}
blah\xfilll{1pt}blub
\end{lstlisting}

blah\xfilll[0pt]{4pt}blub
\begin{lstlisting}
blah\xfilll[0pt]{4pt}blub
\end{lstlisting}

blah\xfilll[-12pt]{12pt}blub
\begin{lstlisting}
blah\xfilll[-12pt]{12pt}blub
\end{lstlisting}

blah\xrfill{1pt}[blue]blub blah\xrfill{2pt}[cyan]blub
\begin{lstlisting}
blah\xrfill{1pt}[blue]blub blah\xrfill{2pt}[cyan]blub
\end{lstlisting}

laber\xrfill[0pt]{4pt}[green]blub blub
\begin{lstlisting}
laber\xrfill[0pt]{4pt}[green]blub blub
\end{lstlisting}

blah\xrfill[-1ex]{1pt}[red]blub
\begin{lstlisting}
blah\xrfill[-1ex]{1pt}[red]blub
\end{lstlisting}

blah \xhrulefill{cyan}{1cm} blub
\begin{lstlisting}
blah \xhrulefill{cyan}{1cm} blub
\end{lstlisting}

blah \xhrectanglefill{0.5cm}{1pt} blubber
\begin{lstlisting}
blah \xhrectanglefill{0.5cm}{1pt} blubber
\end{lstlisting}

blah\xdotfill{1pt}[blue]blah\xdotfill{2pt}[red]blub
\begin{lstlisting}
blah\xdotfill{1pt}[blue]blah\xdotfill{2pt}[red]blub
\end{lstlisting}


\subsection*{The code}

\lstinputlisting{xhfill.sty}


\end{document}
