[Tex/LaTex] How to Make a Three-Column Title

horizontal alignmentspacingtitles

I'm trying to format a title for my document. Normally, I write <Title> \hfill \today, to have a title nicely split into two columns, each aligned at the left and right margin, respectively.

Now I want to add my name into the middle, i.e. I want to split the title into three columns: aligned left, center, and right. How do I do this? I tried tabbing, but I don't know how to configure the hspace{} correctly to get three columns of equal length.

Best Answer

This is probably the easiest way of doing it:

enter image description here

\documentclass{article}
\begin{document}

\noindent
{\large Title of Document \hfill
  An Author \hfill
  \today\par}

\noindent
{\large \makebox[0pt][l]{Title of Document} \hfill
  \makebox[0pt][c]{An Author} \hfill 
  \makebox[0pt][r]{\today}\par}

\end{document}

Note that the first option inserts equal spacing between the left and right entries. This would only center the An Author if they are of equal width (not always the case). The second option centers the content regardless of the length of the left/right component. Since each component is placed in a box of width 0pt, overlapping could occur, but I'm not sure whether this is a concern. Of course, that can be updated, if needed.

Note also that \large is a switch and not a macro (taking an argument). So, I've included it inside {...}. Also ending it with a paragraph break to allow for proper vertical alignment/spacing due to a different\baselineskip.

\noindent, of course, removes the regular paragraph indent inserted for regular paragraph text.

Related Question