I am creating a letterhead or other heading to be used at the top of invoices and the like and am having an issue with the spacing of one element:
\documentclass[12pt]{article}
\usepackage{changepage}
\setlength{\parindent}{0pt}
\begin{document}
\begin{center}
\Large \bfseries My Name
\end{center}
\hrulefill
\begin{minipage}[t]{0.5\textwidth}
My street \\
And my city, zip
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\raggedleft
(my) phone-number \\
my@email.com
\end{minipage}
\vspace{0.5in}
\begin{minipage}[t]{0.5\textwidth}
\textbf{To:}
\begin{adjustwidth}{1em}{}
The Person \\
His street \\
His city, zip
\end{adjustwidth}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\textbf{Date:}
\hspace*{1em}\today
\end{minipage}
\end{document}
I would like the "Date" block to be aligned to the right of the page similarly to the phone and email block above it. My first stab at a solution was to add \raggedleft
and some spacing adjustment to the last minipage
:
\begin{minipage}[t]{0.5\textwidth}
\raggedleft
\textbf{Date:}\phantom{\today}\hspace*{-1.4em}
\hspace*{1em}\today
\end{minipage}
This almost works: unfortunately, I can't devise a way to make sure the horizontal distance between the start of "Date:" and the start of "January..." is exactly 1em, as I was able to specify in the "To" block.
The idea I have in my head for the solution involves something like this:
\hfill % or \hspace{\fill}: which is preferred here?
\begin{minipage}[t]{\the-exact-width-of-the-date-block}
Date:
\hspace*{1em}\today
\end{minipage}
But, I can't come up with a way to have TeX calculate that width for me--perhaps some sort of multi-line box that can be forced to the left?