Produce a rubber length which has no natural space but that can stretch horizontally as far as needed (see Lengths).

This creates a one-line paragraph with ‘Name:’ on the left side of the page and ‘Quiz One’ on the right.

\noindent Name:\hfill Quiz One

The \hfill command is equivalent to \hspace{\fill} and so the space can be discarded at line breaks. To avoid that instead use \hspace*{\fill} (see \hspace).

Here the graphs are evenly spaced in the middle of the figure.

\newcommand*{\vcenteredhbox}[1]{\begin{tabular}{@{}[email protected]{}}#1\end{tabular}}
  \caption{Comparison of two graphs} \label{fig:twographs}

Note the \hspace*’s where the space could otherwise be dropped.

© 2007–2018 Karl Berry
Public Domain Software